Class: Orb::Runner
- Inherits:
-
Object
- Object
- Orb::Runner
- Defined in:
- lib/orb/runner.rb
Class Attribute Summary collapse
-
.current ⇒ Object
Returns the value of attribute current.
Instance Attribute Summary collapse
-
#test_buffer ⇒ Object
readonly
Returns the value of attribute test_buffer.
Instance Method Summary collapse
-
#initialize(context) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
- #setup_pry ⇒ Object
Constructor Details
#initialize(context) ⇒ Runner
Returns a new instance of Runner.
10 11 12 13 14 15 |
# File 'lib/orb/runner.rb', line 10 def initialize(context) @context = context @test_buffer = TestBuffer.new setup_pry Orb::Runner.current = self end |
Class Attribute Details
.current ⇒ Object
Returns the value of attribute current.
7 8 9 |
# File 'lib/orb/runner.rb', line 7 def current @current end |
Instance Attribute Details
#test_buffer ⇒ Object (readonly)
Returns the value of attribute test_buffer.
5 6 7 |
# File 'lib/orb/runner.rb', line 5 def test_buffer @test_buffer end |
Instance Method Details
#run ⇒ Object
30 31 32 |
# File 'lib/orb/runner.rb', line 30 def run @pry.repl(@context) end |
#setup_pry ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/orb/runner.rb', line 17 def setup_pry Pry.instance_eval do if initial_session? load_rc if Pry.config.should_load_rc # load_plugins if Pry.config.plugins.enabled load_requires if Pry.config.should_load_requires load_history if Pry.config.history.should_load end end @pry = Pry.new @pry.instance_variable_set("@orb_test_buffer", @test_buffer) end |