Sha256: f860422761364c17c2d24cf123aebec2f73132f984fb2fc4d24fefdef8eb5f33
Contents?: true
Size: 874 Bytes
Versions: 17
Compression:
Stored size: 874 Bytes
Contents
class KeyDependency def initialize(attributes={}) @slug = attributes[:slug] @name = attributes.fetch(:as, @slug.titleize) @target_versions = attributes.fetch(:target_versions, []).map(&Gem::Version.method(:new)) end attr_reader :slug, :name, :target_versions def versions @versions ||= KeyDependency.versions_for(self) end def latest_version versions.first end def to_s slug end def self.all @dependency_versions ||= Houston.config.key_dependencies.map do |dependency| KeyDependency.new(dependency) end end def self.versions_for(dependency) # Right now the only supported dependencies are Ruby Gems # In the future, as other kinds of dependencies are supported, # we'll support different adapters to fetch their version info Rubygems::Gem.new(dependency.slug).versions end end
Version data entries
17 entries across 17 versions & 1 rubygems