diff options
author | David RodrÃguez <[email protected]> | 2023-03-16 17:23:19 +0100 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2023-11-13 11:06:10 +0900 |
commit | f273132bc017ee2d2c10f95f6629717f33ed54f9 (patch) | |
tree | b7501b396a6d531d803a7ac8490adc52be3870e5 /lib/bundler/lazy_specification.rb | |
parent | 58b0a67432f5fd69d169ed4919ec0db6e6680279 (diff) |
[rubygems/rubygems] Extract builder to create a `LazySpecification` from full spec
https://github.com/rubygems/rubygems/commit/957d3d9a7f
Diffstat (limited to 'lib/bundler/lazy_specification.rb')
-rw-r--r-- | lib/bundler/lazy_specification.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/bundler/lazy_specification.rb b/lib/bundler/lazy_specification.rb index 62d028356e..fdd3efb443 100644 --- a/lib/bundler/lazy_specification.rb +++ b/lib/bundler/lazy_specification.rb @@ -10,6 +10,14 @@ module Bundler attr_reader :name, :version, :platform attr_accessor :source, :remote, :force_ruby_platform, :dependencies, :required_ruby_version, :required_rubygems_version + def self.from_spec(s) + lazy_spec = new(s.name, s.version, s.platform, s.source) + lazy_spec.dependencies = s.dependencies + lazy_spec.required_ruby_version = s.required_ruby_version + lazy_spec.required_rubygems_version = s.required_rubygems_version + lazy_spec + end + def initialize(name, version, platform, source = nil) @name = name @version = version |