Class: Fastr::Application
- Inherits:
-
Object
- Object
- Fastr::Application
- Defined in:
- lib/fastr/application.rb
Overview
This class represents a fastr application.
Direct Known Subclasses
Defined Under Namespace
Modules: Handler
Constant Summary collapse
- SETTINGS_FILE =
The file that contains application settings.
"app/config/settings.rb"
- INIT_FILE =
The file that is evaluated when fastr finishes booting.
"app/config/init.rb"
- @@load_paths =
These are resources we are watching to change. They will be reloaded upon change.
{ :controller => "app/controllers/*.rb", :model => "app/models/*.rb", :lib => "lib/*.rb" }
Constants included from Dispatch
Instance Attribute Summary collapse
-
#app_path ⇒ String
The full path the application’s path.
-
#plugins ⇒ Array
The list of plugins enabled for this application.
-
#router ⇒ Fastr::Router
The router for this application.
-
#settings ⇒ Fastr::Settings
The settings for this application.
Instance Method Summary collapse
-
#initialize(path) ⇒ Application
constructor
Sets the application’s initial state to booting and then kicks off the boot.
- #plugin_after_boot ⇒ Object
Methods included from Dispatch
#dispatch, #dispatch_controller, #dispatch_public, #do_dispatch, #plugin_after_dispatch, #plugin_before_dispatch, #setup_controller, #setup_controller_params
Methods included from Log
create_logger, included, level=
Constructor Details
#initialize(path) ⇒ Application
Sets the application’s initial state to booting and then kicks off the boot.
43 44 45 46 47 48 49 |
# File 'lib/fastr/application.rb', line 43 def initialize(path) self.app_path = path self.settings = Fastr::Settings.new(self) self.plugins = [] @booting = true boot end |
Instance Attribute Details
#app_path ⇒ String
The full path the application’s path.
24 25 26 |
# File 'lib/fastr/application.rb', line 24 def app_path @app_path end |
#plugins ⇒ Array
The list of plugins enabled for this application.
32 33 34 |
# File 'lib/fastr/application.rb', line 32 def plugins @plugins end |
#router ⇒ Fastr::Router
The router for this application.
20 21 22 |
# File 'lib/fastr/application.rb', line 20 def router @router end |
#settings ⇒ Fastr::Settings
The settings for this application.
28 29 30 |
# File 'lib/fastr/application.rb', line 28 def settings @settings end |
Instance Method Details
#plugin_after_boot ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/fastr/application.rb', line 51 def plugin_after_boot self.plugins.each do |plugin| if plugin.respond_to? :after_boot new_env = plugin.send(:after_boot, self) end end end |