Class: Ripl::Shell
- Inherits:
-
Object
- Object
- Ripl::Shell
- Includes:
- Completion, History, Readline, API
- Defined in:
- lib/ripl/shell.rb
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 History
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 Completion
Methods included from Readline
Methods included from History
#after_loop, #before_loop, #get_input, #history, #history_file, #read_history, #write_history
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 |