diff options
author | Andre Arko <andre@arko.net> | 2015-05-30 17:34:30 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2015-05-30 17:34:32 -0700 |
commit | 6817f3ad86bceb5f56108a67d3a1f7b11d78dc69 (patch) | |
tree | 113b7db14f124f1187935d2ed715779fc5e3f183 | |
parent | d93b37e49266fd7adfd550f12295ac2593605085 (diff) | |
download | bundler-6817f3ad86bceb5f56108a67d3a1f7b11d78dc69.tar.gz |
Hoist StubSpecification up into a file
-rw-r--r-- | lib/bundler.rb | 1 | ||||
-rw-r--r-- | lib/bundler/remote_specification.rb | 20 | ||||
-rw-r--r-- | lib/bundler/stub_specification.rb | 21 |
3 files changed, 22 insertions, 20 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb index 2ca9f1624f..d9da139895 100644 --- a/lib/bundler.rb +++ b/lib/bundler.rb @@ -40,6 +40,7 @@ module Bundler autoload :Settings, 'bundler/settings' autoload :SharedHelpers, 'bundler/shared_helpers' autoload :SpecSet, 'bundler/spec_set' + autoload :StubSpecification, 'bundler/stub_specification' autoload :Source, 'bundler/source' autoload :SourceList, 'bundler/source_list' autoload :Specification, 'bundler/shared_helpers' diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb index 456686dc0f..c80eaa40fc 100644 --- a/lib/bundler/remote_specification.rb +++ b/lib/bundler/remote_specification.rb @@ -54,24 +54,4 @@ module Bundler end end end - - class StubSpecification < RemoteSpecification - def self.from_stub(stub) - spec = new(stub.name, stub.version, stub.platform, nil) - spec.stub = stub - spec - end - - attr_accessor :stub - - def to_yaml - _remote_specification.to_yaml - end - - private - - def _remote_specification - stub.to_spec - end - end end diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb new file mode 100644 index 0000000000..53db25c7ed --- /dev/null +++ b/lib/bundler/stub_specification.rb @@ -0,0 +1,21 @@ +require 'bundler/remote_specification' + +class StubSpecification < RemoteSpecification + def self.from_stub(stub) + spec = new(stub.name, stub.version, stub.platform, nil) + spec.stub = stub + spec + end + + attr_accessor :stub + + def to_yaml + _remote_specification.to_yaml + end + +private + + def _remote_specification + stub.to_spec + end +end |