Skip to content

Commit

Permalink
by default don't load irbrc but do write to ~/.irb_history
Browse files Browse the repository at this point in the history
  • Loading branch information
cldwalker committed Aug 18, 2011
1 parent 3ab19c7 commit b8437a3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/rack/webconsole/shell.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
class Rack::Webconsole
module Shell
def self.eval_query(query)
# Initialize ripl plugins
@before_loop_called ||= Ripl.shell.before_loop

Ripl.shell.input = query
Ripl.shell.loop_once
{}.tap do |hash|
Expand Down Expand Up @@ -52,21 +55,20 @@ def return_result
@error_raised ? result : result.inspect
end

# Disable unused callbacks
def print_result(result) end
def before_loop() end
end
end

# Disable readline's #get_input
Ripl.config[:readline] = false
Ripl.config[:multi_line_prompt] = '|| '
Ripl.config[:prompt] = '>> '
Ripl.config[:irbrc] = false
# Let ripl users detect web shells
Ripl.config[:web] = true

Ripl::Shell.include Rack::Webconsole::Shell
# must come after Webconsole plugin
require 'ripl/multi_line'
# Initialize ripl plugins
Ripl.shell.before_loop

at_exit { Ripl.shell.after_loop }

0 comments on commit b8437a3

Please sign in to comment.