Skip to content

Commit

Permalink
New option irb_requires.
Browse files Browse the repository at this point in the history
  • Loading branch information
janfri committed Mar 27, 2015
1 parent 752c3f8 commit c3308d7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/rim/irb.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
# -- encoding: utf-8 --
class Rim
# Required files for irb (default: Rim#name)
attr_accessor :irb_requires
end

Rim.defaults do
irb_requires name
end

Rim.after_setup do
desc 'Start an irb session and loading lib'
task :irb do
i_params = Array(require_paths).map {|e| '-I ' << e}.join(' ')
sh "irb #{i_params} -r #{name}"
r_params = Array(irb_requires).map {|e| '-r' << e}.join(' ')
sh "irb #{i_params} #{r_params}"
end
end

0 comments on commit c3308d7

Please sign in to comment.