Class: Volt::App
- Includes:
- ServerSetup::App
- Defined in:
- lib/volt/volt/app.rb
Instance Attribute Summary collapse
-
#app_path ⇒ Object
readonly
Returns the value of attribute app_path.
-
#channel_live_queries ⇒ Object
readonly
Returns the value of attribute channel_live_queries.
-
#component_paths ⇒ Object
readonly
Returns the value of attribute component_paths.
-
#database ⇒ Object
readonly
Returns the value of attribute database.
-
#live_query_pool ⇒ Object
readonly
Returns the value of attribute live_query_pool.
-
#message_bus ⇒ Object
readonly
Returns the value of attribute message_bus.
-
#middleware ⇒ Object
readonly
Returns the value of attribute middleware.
-
#page ⇒ Object
readonly
Returns the value of attribute page.
-
#router ⇒ Object
readonly
Returns the value of attribute router.
-
#sprockets ⇒ Object
Returns the value of attribute sprockets.
Instance Method Summary collapse
-
#initialize(app_path = nil) ⇒ App
constructor
A new instance of App.
-
#setup_page ⇒ Object
Setup a Page instance.
Methods included from ServerSetup::App
#load_app_code, #require_http_controllers, #reset_query_pool!, #run_app_and_initializers, #run_config, #setup_paths, #setup_postboot_middleware, #setup_preboot_middleware, #setup_router, #start_message_bus
Constructor Details
#initialize(app_path = nil) ⇒ App
Returns a new instance of App.
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/volt/volt/app.rb', line 44 def initialize(app_path=nil) if Volt.server? && !app_path raise "Volt::App.new requires an app path to boot" end @app_path = app_path $volt_app = self # Setup root path Volt.root = app_path setup_page if RUBY_PLATFORM != 'opal' # We need to run the root config first so we can setup the Rack::Session # middleware. run_config # Setup all of the middleware we can before we load the users components # since the users components might want to add middleware during boot. setup_preboot_middleware # Setup all app paths setup_paths # Require in app and initializers run_app_and_initializers unless RUBY_PLATFORM == 'opal' # abort_on_exception is a useful debugging tool, and in my opinion something # you probbaly want on. That said you can disable it if you need. unless RUBY_PLATFORM == 'opal' Thread.abort_on_exception = Volt.config.abort_on_exception end load_app_code reset_query_pool! # Setup the middleware that we can only setup after all components boot. setup_postboot_middleware end end |
Instance Attribute Details
#app_path ⇒ Object (readonly)
Returns the value of attribute app_path.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def app_path @app_path end |
#channel_live_queries ⇒ Object (readonly)
Returns the value of attribute channel_live_queries.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def channel_live_queries @channel_live_queries end |
#component_paths ⇒ Object (readonly)
Returns the value of attribute component_paths.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def component_paths @component_paths end |
#database ⇒ Object (readonly)
Returns the value of attribute database.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def database @database end |
#live_query_pool ⇒ Object (readonly)
Returns the value of attribute live_query_pool.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def live_query_pool @live_query_pool end |
#message_bus ⇒ Object (readonly)
Returns the value of attribute message_bus.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def @message_bus end |
#middleware ⇒ Object (readonly)
Returns the value of attribute middleware.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def middleware @middleware end |
#page ⇒ Object (readonly)
Returns the value of attribute page.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def page @page end |
#router ⇒ Object (readonly)
Returns the value of attribute router.
39 40 41 |
# File 'lib/volt/volt/app.rb', line 39 def router @router end |
#sprockets ⇒ Object
Returns the value of attribute sprockets.
42 43 44 |
# File 'lib/volt/volt/app.rb', line 42 def sprockets @sprockets end |