Skip to content

Instantly share code, notes, and snippets.

@harssh
Created February 8, 2014 15:50
Show Gist options
  • Select an option

  • Save harssh/8885754 to your computer and use it in GitHub Desktop.

Select an option

Save harssh/8885754 to your computer and use it in GitHub Desktop.
7 Lines Every Gem's Rakefile Should Have
#Add these 7 lines to your project's Rakefile:
task :console do
require 'irb'
require 'irb/completion'
require 'my_gem' # You know what to do.
ARGV.clear
IRB.start
end
#Now, a suitable playground is only a rake console away. For bonus points, if your gem requires a bit of fixture data to do #anything useful, you can stage some data before starting the console. Even users who aren't adept at writing tests should be #able to give you steps to reproduce problems using this console, in a clean environment free of their app code and other gems.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment