Class: Sparrowhawk::Configuration
- Inherits:
-
Object
- Object
- Sparrowhawk::Configuration
- Defined in:
- lib/sparrowhawk/configuration.rb
Instance Attribute Summary collapse
-
#application_dirs ⇒ Object
Sets the base directories that will be scanned for application files (not static content).
-
#environment ⇒ Object
Which environment to use when running the application.
-
#other_files ⇒ Object
Other files to include in the application code (LICENSE, README, etc.).
-
#runtimes ⇒ Object
The min and max runtimes that will be used to service requests.
-
#war_file ⇒ Object
Sets the name/file path of the war file.
Instance Method Summary collapse
-
#initialize {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
-
#war ⇒ Object
Returns an object instance that can be used to build a war.
Constructor Details
#initialize {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
43 44 45 |
# File 'lib/sparrowhawk/configuration.rb', line 43 def initialize yield self if block_given? end |
Instance Attribute Details
#application_dirs ⇒ Object
Sets the base directories that will be scanned for application files (not static content). Some directories will always be excluded implicitly (e.g. vendor/cache)
11 12 13 |
# File 'lib/sparrowhawk/configuration.rb', line 11 def application_dirs @application_dirs end |
#environment ⇒ Object
Which environment to use when running the application
18 19 20 |
# File 'lib/sparrowhawk/configuration.rb', line 18 def environment @environment end |
#other_files ⇒ Object
Other files to include in the application code (LICENSE, README, etc.)
21 22 23 |
# File 'lib/sparrowhawk/configuration.rb', line 21 def other_files @other_files end |
#runtimes ⇒ Object
The min and max runtimes that will be used to service requests. Accepts a range.
15 16 17 |
# File 'lib/sparrowhawk/configuration.rb', line 15 def runtimes @runtimes end |
#war_file ⇒ Object
Sets the name/file path of the war file. Ex: ../distro/example.war
6 7 8 |
# File 'lib/sparrowhawk/configuration.rb', line 6 def war_file @war_file end |
Instance Method Details
#war ⇒ Object
Returns an object instance that can be used to build a war
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/sparrowhawk/configuration.rb', line 24 def war war = War.new war_file war.entries << PublicDirMapper.new.to_a war.entries << WebXmlEntry.new() war.entries << ManifestEntry.new war.entries << ApplicationFilesMapper.new(application_dirs).to_a war.entries << JRubyCoreJarEntry.new war.entries << JRubyStdLibJarEntry.new war.entries << JRubyRackJarEntry.new gem_finder = BundlerGemFinder.new war.entries << GemMapper.new(gem_finder).to_a war.entries << GemfileEntry.new war.entries << LockfileEntry.new other_files.each do |file| war.entries << FileEntry.new("WEB-INF/#{file}", file) end if other_files war end |