Class: StaticRails::Configuration
- Inherits:
-
Object
- Object
- StaticRails::Configuration
- Defined in:
- lib/static-rails/configuration.rb
Instance Attribute Summary collapse
-
#app ⇒ Object
When Rails invokes our Railtie, we’ll save off a reference to the Rails app.
-
#ping_server_timeout ⇒ Object
Number of seconds to wait on sites to confirm servers are ready.
-
#proxy_requests ⇒ Object
When true, our middleware will proxy requests to static site servers.
-
#serve_compiled_assets ⇒ Object
When true, our middleware will serve sites’ compiled asset files.
-
#set_csrf_token_cookie ⇒ Object
When true, a cookie named “_csrf_token” will be set by static-rails middleware.
-
#sites ⇒ Object
Returns the value of attribute sites.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
28 29 30 31 32 33 34 |
# File 'lib/static-rails/configuration.rb', line 28 def initialize @sites = [] @proxy_requests = !Rails.env.production? @serve_compiled_assets = Rails.env.production? @ping_server_timeout = 5 @set_csrf_token_cookie = false end |
Instance Attribute Details
#app ⇒ Object
When Rails invokes our Railtie, we’ll save off a reference to the Rails app
14 15 16 |
# File 'lib/static-rails/configuration.rb', line 14 def app @app end |
#ping_server_timeout ⇒ Object
Number of seconds to wait on sites to confirm servers are ready
23 24 25 |
# File 'lib/static-rails/configuration.rb', line 23 def ping_server_timeout @ping_server_timeout end |
#proxy_requests ⇒ Object
When true, our middleware will proxy requests to static site servers
17 18 19 |
# File 'lib/static-rails/configuration.rb', line 17 def proxy_requests @proxy_requests end |
#serve_compiled_assets ⇒ Object
When true, our middleware will serve sites’ compiled asset files
20 21 22 |
# File 'lib/static-rails/configuration.rb', line 20 def serve_compiled_assets @serve_compiled_assets end |
#set_csrf_token_cookie ⇒ Object
When true, a cookie named “_csrf_token” will be set by static-rails middleware
26 27 28 |
# File 'lib/static-rails/configuration.rb', line 26 def @set_csrf_token_cookie end |
#sites ⇒ Object
Returns the value of attribute sites.
36 37 38 |
# File 'lib/static-rails/configuration.rb', line 36 def sites @sites end |