Parent

Included Modules

Warbler::Traits::Rack

The Rack trait adds config.ru to a Rack-based war project.

Public Class Methods

detect?() click to toggle source
# File lib/warbler/traits/rack.rb, line 14
def self.detect?
  !Rails.detect? && (File.exist?("config.ru") || !Dir['*/config.ru'].empty?)
end
requires?(trait) click to toggle source
# File lib/warbler/traits/rack.rb, line 18
def self.requires?(trait)
  trait == Traits::War
end

Public Instance Methods

after_configure() click to toggle source
# File lib/warbler/traits/rack.rb, line 28
def after_configure
  config.init_contents << "#{config.warbler_templates}/rack.erb"
end
before_configure() click to toggle source
# File lib/warbler/traits/rack.rb, line 22
def before_configure
  config.webxml.booter = :rack
  config.webinf_files += [FileList['config.ru', '*/config.ru'].detect {|f| File.exist?(f)}]
  config.webxml.rack.env = ENV['RACK_ENV'] || 'production'
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.