Class: ReverseProxy::Application
- Inherits:
-
Object
- Object
- ReverseProxy::Application
- Includes:
- Logger
- Defined in:
- lib/reverse_proxy/application.rb
Instance Attribute Summary collapse
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
Instance Method Summary collapse
- #assets ⇒ Object
-
#initialize(proxy) ⇒ Application
constructor
A new instance of Application.
- #mime_types ⇒ Object
- #send_assets? ⇒ Boolean
- #socket ⇒ Object
Methods included from Logger
Constructor Details
#initialize(proxy) ⇒ Application
Returns a new instance of Application.
5 6 7 |
# File 'lib/reverse_proxy/application.rb', line 5 def initialize proxy @proxy = proxy end |
Instance Attribute Details
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
4 5 6 |
# File 'lib/reverse_proxy/application.rb', line 4 def proxy @proxy end |
Instance Method Details
#assets ⇒ Object
15 16 17 |
# File 'lib/reverse_proxy/application.rb', line 15 def assets "/assets" end |
#mime_types ⇒ Object
18 19 20 21 22 23 |
# File 'lib/reverse_proxy/application.rb', line 18 def mime_types return unless Object.const_defined? :Mime types = {} Mime::EXTENSION_LOOKUP.each{|ext,type| types[type.to_s] ||= []; types[type.to_s] << ext } types.collect{|name,extensions| [name,extensions.join(" ")]}.to_h end |
#send_assets? ⇒ Boolean
11 12 13 14 |
# File 'lib/reverse_proxy/application.rb', line 11 def send_assets? return false unless Object.const_defined?(:Rails) return Rails.application.config.assets.compile == false end |
#socket ⇒ Object
8 9 10 |
# File 'lib/reverse_proxy/application.rb', line 8 def socket proxy.server.socket.unix.to_puma end |