Method: FileUtils#ruby

Defined in:
lib/rake/file_utils.rb

#ruby(*args, &block) ⇒ Object

Run a Ruby interpreter with the given arguments.

Example:

ruby %{-pe '$_.upcase!' <README}

100
101
102
103
104
105
106
107
# File 'lib/rake/file_utils.rb', line 100

def ruby(*args, &block)
  options = (Hash === args.last) ? args.pop : {}
  if args.length > 1
    sh(*([RUBY] + args + [options]), &block)
  else
    sh("#{RUBY} #{args.first}", options, &block)
  end
end