Class: Rail::Application
- Inherits:
-
Object
- Object
- Rail::Application
- Defined in:
- lib/rail/application.rb
Instance Attribute Summary collapse
-
#browser ⇒ Object
readonly
Returns the value of attribute browser.
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#pipeline ⇒ Object
readonly
Returns the value of attribute pipeline.
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize ⇒ Application
constructor
A new instance of Application.
- #precompile ⇒ Object
Constructor Details
#initialize ⇒ Application
Returns a new instance of Application.
5 6 7 8 9 |
# File 'lib/rail/application.rb', line 5 def initialize @config = self.class.config @browser = Browser.new(config) @pipeline = Pipeline.new(config) end |
Instance Attribute Details
#browser ⇒ Object (readonly)
Returns the value of attribute browser.
3 4 5 |
# File 'lib/rail/application.rb', line 3 def browser @browser end |
#config ⇒ Object (readonly)
Returns the value of attribute config.
3 4 5 |
# File 'lib/rail/application.rb', line 3 def config @config end |
#pipeline ⇒ Object (readonly)
Returns the value of attribute pipeline.
3 4 5 |
# File 'lib/rail/application.rb', line 3 def pipeline @pipeline end |
Class Method Details
.config ⇒ Object
24 25 26 |
# File 'lib/rail/application.rb', line 24 def self.config @config ||= Support::QueryStruct.new() end |
.inherited(klass) ⇒ Object
20 21 22 |
# File 'lib/rail/application.rb', line 20 def self.inherited(klass) klass.config.root = File.('../..', caller[0].sub(/:.*/, '')) end |
.load_tasks ⇒ Object
28 29 30 31 32 |
# File 'lib/rail/application.rb', line 28 def self.load_tasks Dir[File.join(File.dirname(__FILE__), 'tasks/*.rake')].each do |path| Rake::load_rakefile(path) end end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 |
# File 'lib/rail/application.rb', line 11 def call(env) request = Request.new(env) (browser.accept?(request) ? browser : pipeline).process(request) end |
#precompile ⇒ Object
16 17 18 |
# File 'lib/rail/application.rb', line 16 def precompile Precompiler.new(pipeline).process(config.precompile) end |