class Guard::Dsl
Public Instance Methods
Source
# File lib/guard/shell.rb, line 37 def eager(command) require 'pty' begin PTY.spawn command do |r, w, pid| begin $stdout.puts r.each {|line| print line } rescue Errno::EIO # the process has finished end end rescue PTY::ChildExited $stdout.puts "The child process exited!" end end
Eager prints the result for stdout and stderr as it would be written when running the command from the terminal. This is useful for long running tasks.
Source
# File lib/guard/shell.rb, line 30 def n(msg, title='', image=nil) Compat::UI.notify(msg, :title => title, :image => image) end
Easy method to display a notification