Class: BirdGrinder::Console
- Inherits:
-
Object
- Object
- BirdGrinder::Console
- Defined in:
- lib/bird_grinder/console.rb
Overview
A simple controller for bringing up an IRB instance with the birdgrinder environment pre-loaded.
Defined Under Namespace
Modules: BaseExtensions
Class Method Summary collapse
-
.run ⇒ Object
Starts up a new IRB instance with access to birdgrinder features.
Instance Method Summary collapse
-
#initialize ⇒ Console
constructor
A new instance of Console.
-
#run ⇒ Object
Actually starts IRB.
-
#setup_irb ⇒ Object
Include the base extensions in our top level binding so they can be accessed at the prompt.
Constructor Details
#initialize ⇒ Console
Returns a new instance of Console.
16 17 18 |
# File 'lib/bird_grinder/console.rb', line 16 def initialize setup_irb end |
Class Method Details
.run ⇒ Object
Starts up a new IRB instance with access to birdgrinder features.
37 38 39 |
# File 'lib/bird_grinder/console.rb', line 37 def self.run self.new.run end |
Instance Method Details
#run ⇒ Object
Actually starts IRB
29 30 31 32 33 34 |
# File 'lib/bird_grinder/console.rb', line 29 def run puts "Loading BirdGrinder Console..." # Trick IRB into thinking it has no arguments. ARGV.replace [] IRB.start end |
#setup_irb ⇒ Object
Include the base extensions in our top level binding so they can be accessed at the prompt.
22 23 24 25 26 |
# File 'lib/bird_grinder/console.rb', line 22 def setup_irb # This is a bit hacky, surely there is a better way? # e.g. some way to specify which scope irb runs in. eval("include BirdGrinder::Console::BaseExtensions", TOPLEVEL_BINDING) end |