This gem allows you to write rewrite your Ruby methods and test them from the command line.
$ gem install ruby-racer
# my_method.rb
require 'ruby-racer'
method_name = :method_name
input = [1, 2, 3]
my_method = Proc.new do |input|
# write method code here
end
RubyRacer.go(method_name, input, &my_method)
$ ruby my_method.rb
- Fork it ( https://github.com/danielleadams/ruby-racer/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request