Module: RakeTasks::Console
Instance Method Summary collapse
Instance Method Details
#lib_name ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/rake_tasks/console.rb', line 10 def lib_name return @lib_name if defined?(@lib_name) lib = File.basename(System.pwd) file = "lib/#{lib}.rb" @lib_name = lib if System.file?(file) @lib_name ||= nil end |
#run ⇒ Object
6 7 8 |
# File 'lib/rake_tasks/console.rb', line 6 def run System.system "bundle exec irb -Ilib -r#{lib_name}" end |
#set_lib(lib) ⇒ Object
21 22 23 |
# File 'lib/rake_tasks/console.rb', line 21 def set_lib(lib) @lib_name = lib end |