Class: Warbler::Traits::Merb
- Inherits:
-
Object
- Object
- Warbler::Traits::Merb
- Includes:
- Warbler::Trait
- Defined in:
- lib/warbler/traits/merb.rb
Overview
The Merb trait adds Merb::BootLoader gem dependencies to the project.
Instance Attribute Summary
Attributes included from Warbler::Trait
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Warbler::Trait
#add_init_load_path, #add_main_rb, #after_configure, included, #initialize, #jruby_jars, #update_archive, #update_gem_path
Class Method Details
.detect? ⇒ Boolean
14 15 16 |
# File 'lib/warbler/traits/merb.rb', line 14 def self.detect? File.exist?("config/init.rb") end |
Instance Method Details
#before_configure ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/warbler/traits/merb.rb', line 22 def before_configure return false unless task = Warbler.project_application.lookup("merb_env") task.invoke rescue nil return false unless defined?(::Merb) config.webxml.booter = :merb if defined?(::Merb::BootLoader::Dependencies.dependencies) ::Merb::BootLoader::Dependencies.dependencies.each {|g| config.gems << g } else warn "unable to auto-detect Merb dependencies; upgrade to Merb 1.0 or greater" end end |