guard/guard-process

How to run Ruby code from command?

Closed this issue · 3 comments

The example is:

:command => 'rails runner Something::ThatGoesOnAndOn'

How run Ruby code?

I tried ruby -e but got -e:1: unterminated string meets end of file.

Also, ruby -e seems like a hack...

guard-process is designed to run command line processes, so any command line process should do. the easiest way to run ruby code is to save it to a file and run that: ruby /path/to/your/file.rb

e2 commented

@georgeu2000 - use guard-yield instead, which is exactly designed for running Ruby code directly.

OK, thanks.