Created
April 28, 2014 07:38
-
-
Save swanandp/11364447 to your computer and use it in GitHub Desktop.
Rake task to load up your gem in a pry repl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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