Skip to content

Instantly share code, notes, and snippets.

@swanandp
Created April 28, 2014 07:38
Show Gist options
  • Save swanandp/11364447 to your computer and use it in GitHub Desktop.
Save swanandp/11364447 to your computer and use it in GitHub Desktop.
Rake task to load up your gem in a pry repl
desc "Open an irb (or pry) session preloaded with this gem"
task :console do
begin
require 'pry'
gem_name = File.basename(Dir.pwd)
sh %{pry -I lib -r #{gem_name}.rb}
rescue LoadError => _
sh %{irb -rubygems -I lib -r #{gem_name}.rb}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment