Class: Warbler::Runtime::Spec

Inherits:
Object
  • Object
show all
Defined in:
lib/warbler/runtime.rb

Instance Method Summary collapse

Constructor Details

#initialize(spec, gem_path) ⇒ Spec

Returns a new instance of Spec.



13
14
15
16
17
18
19
# File 'lib/warbler/runtime.rb', line 13

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

Instance Method Details

#inspectObject



21
22
23
24
# File 'lib/warbler/runtime.rb', line 21

def inspect
  str = @spec.inspect
  str.gsub(%r'"/WEB-INF(/[^"]*)"', 'File.expand_path("../..\1", __FILE__)')
end