Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: b3ea35bc68
Fetching contributors…

Cannot retrieve contributors at this time

45 lines (37 sloc) 1.205 kb
module Warbler
# Extension module for a Bundler::Runtime instance, to add methods
# to create a Bundler environment file specific to war packaging.
module Runtime
WAR_ENV = ".bundle/war-environment.rb"
attr_writer :gem_path
def gem_path
@gem_path || Config::DEFAULT_GEM_PATH
end
class Spec
def initialize(spec, gem_path)
location = spec[:loaded_from][%r{(.*)/specifications}, 1]
spec = spec.dup
spec[:loaded_from] = spec[:loaded_from].sub(location, gem_path)
spec[:load_paths] = spec[:load_paths].map {|p| p.sub(location, gem_path)}
@spec = spec
end
def inspect
str = @spec.inspect
str.gsub(%r'"/WEB-INF(/[^"]*)"', 'File.expand_path("../..\1", __FILE__)')
end
end
# deprecated; compatibility with Bundler <= 0.9.14
def rb_lock_file #:nocov:
root.join(WAR_ENV) #:nocov:
end #:nocov:
def specs_for_lock_file
super.map {|s| Spec.new(s, gem_path)}
end
def write_war_environment
write_rb_lock
end
def war_specs
respond_to?(:requested_specs) ? requested_specs : specs_for
end
end
end
Jump to Line
Something went wrong with that request. Please try again.