Class: Sparrowhawk::RackWebXmlEntry
- Inherits:
-
WebXmlEntry
- Object
- WebXmlEntry
- Sparrowhawk::RackWebXmlEntry
- Defined in:
- lib/sparrowhawk/rack_web_xml_entry.rb
Instance Attribute Summary
Attributes inherited from WebXmlEntry
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(options = {}) ⇒ RackWebXmlEntry
constructor
A new instance of RackWebXmlEntry.
- #rackup ⇒ Object
- #rackup? ⇒ Boolean
Constructor Details
#initialize(options = {}) ⇒ RackWebXmlEntry
Returns a new instance of RackWebXmlEntry.
3 4 5 6 |
# File 'lib/sparrowhawk/rack_web_xml_entry.rb', line 3 def initialize ={} super @rackup_file = [:rackup] end |
Instance Method Details
#content ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/sparrowhawk/rack_web_xml_entry.rb', line 8 def content web_app do |xml| xml << public_root xml << context_param('rackup', rackup) if rackup? xml << rack_filter xml << listener('org.jruby.rack.RackServletContextListener') end.target! end |
#rackup ⇒ Object
17 18 19 |
# File 'lib/sparrowhawk/rack_web_xml_entry.rb', line 17 def rackup @rackup ||= IO.read(@rackup_file) end |
#rackup? ⇒ Boolean
21 22 23 |
# File 'lib/sparrowhawk/rack_web_xml_entry.rb', line 21 def rackup? @rackup_file && File.exists?(@rackup_file) end |