Class: Ripl::Shell
Defined Under Namespace
Modules: API
Constant Summary collapse
- OPTIONS =
{ :name => 'ripl', :result_prompt => '=> ', :prompt => '>> ', :binding => TOPLEVEL_BINDING, :irbrc=>'~/.irbrc' }
- EXIT_WORDS =
[nil, 'exit', 'quit']
Constants included from API
Instance Attribute Summary collapse
-
#binding ⇒ Object
Returns the value of attribute binding.
-
#input ⇒ Object
Returns the value of attribute input.
-
#line ⇒ Object
Returns the value of attribute line.
-
#name ⇒ Object
Returns the value of attribute name.
-
#result ⇒ Object
Returns the value of attribute result.
Attributes included from API
Class Method Summary collapse
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(options = {}) ⇒ Shell
constructor
A new instance of Shell.
-
#loop ⇒ Object
Loops shell until user exits.
Methods included from API
#add_commands, #after_loop, #before_loop, #eval_input, #format_error, #format_result, #get_input, #handle_interrupt, #in_loop, #loop_eval, #loop_once, #print_eval_error, #print_result
Constructor Details
Instance Attribute Details
#binding ⇒ Object
Returns the value of attribute binding
24 25 26 |
# File 'lib/ripl/shell.rb', line 24 def binding @binding end |
#input ⇒ Object
Returns the value of attribute input
24 25 26 |
# File 'lib/ripl/shell.rb', line 24 def input @input end |
#line ⇒ Object
Returns the value of attribute line
24 25 26 |
# File 'lib/ripl/shell.rb', line 24 def line @line end |
#name ⇒ Object
Returns the value of attribute name
24 25 26 |
# File 'lib/ripl/shell.rb', line 24 def name @name end |
#result ⇒ Object
Returns the value of attribute result
24 25 26 |
# File 'lib/ripl/shell.rb', line 24 def result @result end |
Class Method Details
.create(options = {}) ⇒ Object
2 3 4 5 6 7 8 9 10 11 |
# File 'lib/ripl/shell.rb', line 2 def self.create(={}) if [:readline] require [:readline] == true ? 'readline' : [:readline] require 'ripl/readline' end require 'ripl/completion' if [:completion] new() rescue LoadError new() end |
Instance Method Details
#loop ⇒ Object
Loops shell until user exits
33 34 35 36 37 |
# File 'lib/ripl/shell.rb', line 33 def loop before_loop in_loop after_loop end |