lib/praxis/tasks/console.rb in praxis-0.17.1 vs lib/praxis/tasks/console.rb in praxis-0.18.0
- old
+ new
@@ -9,21 +9,28 @@
require 'pry'
have_pry = true
rescue LoadError
# Fall back on irb
require 'irb'
- require 'irb/ext/multi-irb'
end
Rake::Task['praxis:environment'].invoke
if have_pry
Praxis::Application.instance.pry
else
- # Use some special initialization magic to ensure that 'self' in the
- # IRB session refers to Praxis::Application.instance.
+ # Keep IRB.setup from complaining about bad ARGV options
+ old_argv = ARGV.dup
+ ARGV.clear
IRB.setup nil
+ ARGV.concat(old_argv)
+
+ # Allow reentrant IRB
IRB.conf[:MAIN_CONTEXT] = IRB::Irb.new.context
+ require 'irb/ext/multi-irb'
+
+ # Use some special initialization magic to ensure that 'self' in the
+ # IRB session refers to Praxis::Application.instance.
IRB.irb(nil, Praxis::Application.instance)
end
end
end