Class: ProspectusGems::Gemspec
- Inherits:
-
Module
- Object
- Module
- ProspectusGems::Gemspec
- Defined in:
- lib/prospectus_gems.rb
Overview
Helper for automatically adding dependency status check
Class Method Summary collapse
Instance Method Summary collapse
-
#extended(other) ⇒ Object
rubocop:disable Metrics/MethodLength.
Class Method Details
.fetch_gem(name) ⇒ Object
55 56 57 58 59 60 |
# File 'lib/prospectus_gems.rb', line 55 def fetch_gem(name) # rubocop:disable Security/Open body = open("#{versions_base_uri}/#{name}/latest.json").read # rubocop:enable Security/Open JSON.parse(body)['version'] end |
.lookup_gem(name) ⇒ Object
51 52 53 |
# File 'lib/prospectus_gems.rb', line 51 def lookup_gem(name) @gem_version_cache[name] ||= fetch_gem(name) end |
.versions_base_uri ⇒ Object
62 63 64 |
# File 'lib/prospectus_gems.rb', line 62 def versions_base_uri @versions_base_uri ||= 'https://rubygems.org/api/v1/versions' end |
Instance Method Details
#extended(other) ⇒ Object
rubocop:disable Metrics/MethodLength
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/prospectus_gems.rb', line 9 def extended(other) # rubocop:disable Metrics/MethodLength gem_deps = parse_deps other.deps do gem_deps.each do |dep_name, current, latest| item do name 'gems::' + dep_name expected do static set latest end actual do static set current end end end end end |