Question

I set up a new Rails app today according to the advanced setup in Michael Hartl's Rails Tutorial (http://youtu.be/FZ-b9oZpCZY and http://ruby.railstutorial.org/chapters/static-pages#sec-advanced_setup). I've done this before, but, peculiarly, the output from Guard is very different.

Firstly, whereas before, Guard would run and sit there listening for changes, on the new project, Guard runs a console. It still sits there and runs the tests when there are changes, but I wondered if anyone knew why this would be, especially as, to my knowledge, I've set this project up exactly the same as my other projects (the Gemfiles are exactly the same).

Secondly, all the output messages are coming out with a timestamp and INFO preceding them. Again, does anyone know why this is?

Just to illustrate, here's the output from an old project:

$ guard
Guard uses Growl to send notifications.
Guard is now watching at '/Users/billmurray/rails_projects/sample_app'
Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
Spork server for RSpec successfully started
Guard::RSpec is running, with RSpec 2!
Running all specs
Running tests with args ["--color", "--failure-exit-code", "2", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/billmurray/.rvm/gems/ruby-1.9.3-p194@rails3tutorial/gems/guard-rspec-1.2.1/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
.........

Finished in 0.66338 seconds
9 examples, 0 failures

Randomized with seed 46867

Done.

Here's the same for the new app. Note how the console fires up at the bottom.

$ guard
14:52:42 - INFO - Guard uses Growl to send notifications.
14:52:42 - INFO - Guard uses TerminalTitle to send notifications.
14:52:42 - INFO - Guard is now watching at '/Users/billmurray/rails_projects/new_app'
14:52:42 - INFO - Starting Spork for RSpec
Using RSpec
Preloading Rails environment
Loading Spork.prefork block...
Spork is ready and listening on 8989!
14:52:47 - INFO - Spork server for RSpec successfully started

14:52:47 - INFO - Guard::RSpec is running, with RSpec 2!
14:52:47 - INFO - Running all specs
Running tests with args ["--color", "--failure-exit-code", "2", "--format", "progress", "--format", "Guard::RSpec::Formatter::NotificationRSpec", "--out", "/dev/null", "--require", "/Users/billmurray/.rvm/gems/ruby-1.9.3-p194@rails3tutorial/gems/guard-rspec-1.2.1/lib/guard/rspec/formatters/notification_rspec.rb", "spec"]...
No examples found.


Finished in 0.00213 seconds
0 examples, 0 failures


Randomized with seed 11776

Done.

[1] guard(main)> 

This isn't preventing the thing from running, but I was wondering what was causing it. I should probably mention that I'm using Mac OS X Mountain Lion. Any help would be greatly appreciated. Thanks!

Was it helpful?

Solution

When you've a look at the Guard CHANGELOG, you see that the following new features have arrived with Guard 1.5.0:

  • Use Pry as interactor.
  • Use Lumberjack as customizable logger.

Guard now integrates Pry to get commands from the user (called the interactor). The interactor has been a part of Guard since almost the beginning, but with Pry you get a plugin API that allows you to add custom commands to your Guard. You can see the registered Guard commands with:

[1] guard(main)> help guard

See https://github.com/guard/guard#interactions for more information.

Lumberjack is a configurable Ruby logger, which allows you to customize the Guard UI logger, see https://github.com/guard/guard#logger for more information.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top