Class: Ripl::Rack::App
- Inherits:
-
Object
- Object
- Ripl::Rack::App
- Includes:
- Rack::Test::Methods
- Defined in:
- lib/ripl/rack.rb
Constant Summary collapse
- MESSAGE =
"Rack config file '%s' doesn't exist. Specify with ENV['RACK_CONFIG']"
Instance Attribute Summary collapse
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
Class Method Summary collapse
Instance Method Summary collapse
- #actions ⇒ Object
-
#initialize(config_ru = nil) ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize(config_ru = nil) ⇒ App
Returns a new instance of App.
35 36 37 38 39 40 |
# File 'lib/ripl/rack.rb', line 35 def initialize(config_ru=nil) config_ru ||= ENV['RACK_CONFIG'] || 'config.ru' abort(MESSAGE % config_ru) unless File.exists? config_ru @app = Kernel.eval("Rack::Builder.new { #{File.read(config_ru)} }") @env = ENV['RACK_ENV'] || 'development' end |
Instance Attribute Details
#app ⇒ Object (readonly)
Returns the value of attribute app.
32 33 34 |
# File 'lib/ripl/rack.rb', line 32 def app @app end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
32 33 34 |
# File 'lib/ripl/rack.rb', line 32 def env @env end |
Class Method Details
.instance ⇒ Object
46 47 48 |
# File 'lib/ripl/rack.rb', line 46 def self.instance @instance ||= self.new end |
Instance Method Details
#actions ⇒ Object
42 43 44 |
# File 'lib/ripl/rack.rb', line 42 def actions ::Rack::Test::Methods::METHODS end |