diff options
author | Samuel E. Giddins <segiddins@segiddins.me> | 2015-04-09 21:44:01 -0700 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2016-01-25 10:45:41 -0600 |
commit | bbd643474caac11a12bd4f2f6210d192b7fbf37c (patch) | |
tree | 2e052ea2d529778bbd36200257a654cd3a0268ee /lib/bundler/endpoint_specification.rb | |
parent | 7e87a8d9bc19c96b3a75405107d02de175ebcb75 (diff) | |
download | bundler-bbd643474caac11a12bd4f2f6210d192b7fbf37c.tar.gz |
[Fetcher] Add Fetchers for the new index format!
Diffstat (limited to 'lib/bundler/endpoint_specification.rb')
-rw-r--r-- | lib/bundler/endpoint_specification.rb | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/bundler/endpoint_specification.rb b/lib/bundler/endpoint_specification.rb index 21a6c85c5a..c46f4cd277 100644 --- a/lib/bundler/endpoint_specification.rb +++ b/lib/bundler/endpoint_specification.rb @@ -3,14 +3,16 @@ module Bundler class EndpointSpecification < Gem::Specification include MatchPlatform - attr_reader :name, :version, :platform, :dependencies + attr_reader :name, :version, :platform, :dependencies, :required_rubygems_version, :required_ruby_version, :checksum attr_accessor :source, :remote - def initialize(name, version, platform, dependencies) + def initialize(name, version, platform, dependencies, metadata = {}) @name = name @version = version @platform = platform @dependencies = dependencies + + parse_metadata(metadata) end def fetch_platform @@ -96,5 +98,18 @@ module Bundler def local_specification_path "#{base_dir}/specifications/#{full_name}.gemspec" end + + def parse_metadata(data) + data.each do |k, v| + case k.to_s + when "checksum" + @checksum = v.last + when "rubygems" + @required_rubygems_version = Gem::Requirement.new(v) if v + when "ruby" + @required_ruby_version = Gem::Requirement.new(v) if v + end + end + end end end |