Class: Sparrowhawk::RailsWebXmlEntry
- Inherits:
-
WebXmlEntry
- Object
- WebXmlEntry
- Sparrowhawk::RailsWebXmlEntry
- Defined in:
- lib/sparrowhawk/rails_web_xml_entry.rb
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #content ⇒ Object
-
#initialize(options = {}) ⇒ RailsWebXmlEntry
constructor
A new instance of RailsWebXmlEntry.
- #max_runtimes ⇒ Object
- #min_runtimes ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RailsWebXmlEntry
Returns a new instance of RailsWebXmlEntry.
6 7 8 9 10 |
# File 'lib/sparrowhawk/rails_web_xml_entry.rb', line 6 def initialize ={} super @runtimes = [:runtimes] || (1..1) @environment = [:environment] || 'development' end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
4 5 6 |
# File 'lib/sparrowhawk/rails_web_xml_entry.rb', line 4 def environment @environment end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/sparrowhawk/rails_web_xml_entry.rb', line 4 def name @name end |
Instance Method Details
#content ⇒ Object
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/sparrowhawk/rails_web_xml_entry.rb', line 12 def content web_app do |xml| xml << context_param('rails.env', environment) xml << public_root xml << context_param('jruby.min.runtimes', min_runtimes) xml << context_param('jruby.max.runtimes', max_runtimes) xml << rack_filter xml << listener('org.jruby.rack.rails.RailsServletContextListener') end.target! end |
#max_runtimes ⇒ Object
23 24 25 |
# File 'lib/sparrowhawk/rails_web_xml_entry.rb', line 23 def max_runtimes @runtimes.end.to_s end |
#min_runtimes ⇒ Object
27 28 29 |
# File 'lib/sparrowhawk/rails_web_xml_entry.rb', line 27 def min_runtimes @runtimes.begin.to_s end |