Module: Warbler::BundlerHelper

Included in:
Traits::Bundler
Defined in:
lib/warbler/bundler_helper.rb

Class Method Summary collapse

Class Method Details

.to_spec(spec) ⇒ Object


9
10
11
12
13
14
15
16
17
18
# File 'lib/warbler/bundler_helper.rb', line 9

def to_spec(spec)
  # JRuby <= 1.7.20 does not handle respond_to? with method_missing right
  # thus a `spec.respond_to?(:to_spec) ? spec.to_spec : spec` won't do :
  if ::Bundler.const_defined?(:StubSpecification) # since Bundler 1.10.1
    spec = spec.to_spec if spec.is_a?(::Bundler::StubSpecification)
  else
    spec = spec.to_spec if spec.respond_to?(:to_spec)
  end
  spec
end