Class: Sidekiq::Web
- Inherits:
-
Object
- Object
- Sidekiq::Web
- Defined in:
- lib/sidekiq/web.rb
Constant Summary collapse
- ROOT =
File.("#{File.dirname(__FILE__)}/../../web")
- VIEWS =
"#{ROOT}/views".freeze
- LOCALES =
["#{ROOT}/locales".freeze]
- LAYOUT =
"#{VIEWS}/layout.erb".freeze
- ASSETS =
"#{ROOT}/assets".freeze
- DEFAULT_TABS =
{ "Dashboard" => '', "Busy" => 'busy', "Queues" => 'queues', "Retries" => 'retries', "Scheduled" => 'scheduled', "Dead" => 'morgue', }
Class Attribute Summary collapse
-
.app_url ⇒ Object
Returns the value of attribute app_url.
- .locales ⇒ Object
-
.redis_pool ⇒ Object
Returns the value of attribute redis_pool.
-
.session_secret ⇒ Object
Returns the value of attribute session_secret.
- .views ⇒ Object
Class Method Summary collapse
- .call(env) ⇒ Object
- .custom_tabs ⇒ Object (also: tabs)
- .default_tabs ⇒ Object
- .middlewares ⇒ Object
- .register(extension) ⇒ Object
-
.set(attribute, value) ⇒ Object
Helper for the Sinatra syntax: Sidekiq::Web.set(:session_secret, Rails.application.secrets…).
- .settings ⇒ Object
- .use(*middleware_args, &block) ⇒ Object
Instance Method Summary collapse
- #app ⇒ Object
- #call(env) ⇒ Object
- #middlewares ⇒ Object
- #settings ⇒ Object
- #use(*middleware_args, &block) ⇒ Object
Class Attribute Details
.app_url ⇒ Object
Returns the value of attribute app_url.
71 72 73 |
# File 'lib/sidekiq/web.rb', line 71 def app_url @app_url end |
.locales ⇒ Object
58 59 60 |
# File 'lib/sidekiq/web.rb', line 58 def locales @locales ||= LOCALES end |
.redis_pool ⇒ Object
Returns the value of attribute redis_pool.
71 72 73 |
# File 'lib/sidekiq/web.rb', line 71 def redis_pool @redis_pool end |
.session_secret ⇒ Object
Returns the value of attribute session_secret.
71 72 73 |
# File 'lib/sidekiq/web.rb', line 71 def session_secret @session_secret end |
.views ⇒ Object
62 63 64 |
# File 'lib/sidekiq/web.rb', line 62 def views @views ||= VIEWS end |
Class Method Details
.call(env) ⇒ Object
91 92 93 94 |
# File 'lib/sidekiq/web.rb', line 91 def self.call(env) @app ||= new @app.call(env) end |
.custom_tabs ⇒ Object Also known as: tabs
53 54 55 |
# File 'lib/sidekiq/web.rb', line 53 def custom_tabs @custom_tabs ||= {} end |
.default_tabs ⇒ Object
49 50 51 |
# File 'lib/sidekiq/web.rb', line 49 def default_tabs DEFAULT_TABS end |
.middlewares ⇒ Object
41 42 43 |
# File 'lib/sidekiq/web.rb', line 41 def middlewares @middlewares ||= [] end |
.register(extension) ⇒ Object
100 101 102 |
# File 'lib/sidekiq/web.rb', line 100 def self.register(extension) extension.registered(WebApplication) end |
.set(attribute, value) ⇒ Object
Helper for the Sinatra syntax: Sidekiq::Web.set(:session_secret, Rails.application.secrets…)
67 68 69 |
# File 'lib/sidekiq/web.rb', line 67 def set(attribute, value) send(:"#{attribute}=", value) end |
.settings ⇒ Object
37 38 39 |
# File 'lib/sidekiq/web.rb', line 37 def settings self end |
.use(*middleware_args, &block) ⇒ Object
45 46 47 |
# File 'lib/sidekiq/web.rb', line 45 def use(*middleware_args, &block) middlewares << [middleware_args, block] end |
Instance Method Details
#app ⇒ Object
96 97 98 |
# File 'lib/sidekiq/web.rb', line 96 def app @app ||= build end |
#call(env) ⇒ Object
87 88 89 |
# File 'lib/sidekiq/web.rb', line 87 def call(env) app.call(env) end |
#middlewares ⇒ Object
83 84 85 |
# File 'lib/sidekiq/web.rb', line 83 def middlewares @middlewares ||= Web.middlewares.dup end |
#settings ⇒ Object
75 76 77 |
# File 'lib/sidekiq/web.rb', line 75 def settings self.class.settings end |
#use(*middleware_args, &block) ⇒ Object
79 80 81 |
# File 'lib/sidekiq/web.rb', line 79 def use(*middleware_args, &block) middlewares << [middleware_args, block] end |