Class: Rack::Console
- Inherits:
-
Object
- Object
- Rack::Console
- Defined in:
- lib/rack/console.rb,
lib/rack/console/version.rb
Defined Under Namespace
Classes: Version
Constant Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Console
constructor
A new instance of Console.
- #start ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Console
Returns a new instance of Console.
7 8 9 |
# File 'lib/rack/console.rb', line 7 def initialize( = {}) @options = { config: 'config.ru' }.merge() end |
Instance Method Details
#start ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rack/console.rb', line 11 def start ENV['RACK_ENV'] = @options[:environment] || 'development' if includes = @options[:include] $LOAD_PATH.unshift(*includes) end if library = @options[:require] require library end Rack::Builder.parse_file(@options[:config]) Object.class_eval do def reload! puts 'Reloading...' exec $0 end end begin require 'pry' Pry.start rescue LoadError require 'irb' IRB.start end end |