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 /lib/bundler/stub_specification.rb | |
| parent | d93b37e49266fd7adfd550f12295ac2593605085 (diff) | |
| download | bundler-6817f3ad86bceb5f56108a67d3a1f7b11d78dc69.tar.gz | |
Hoist StubSpecification up into a file
Diffstat (limited to 'lib/bundler/stub_specification.rb')
| -rw-r--r-- | lib/bundler/stub_specification.rb | 21 |
1 files changed, 21 insertions, 0 deletions
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 |
