==(other)
click to toggle source
def ==(other)
return unless other.is_a?(SpecGroup)
name == other.name &&
version == other.version &&
sorted_activated_platforms == other.sorted_activated_platforms &&
source == other.source
end
copy_for(platforms)
click to toggle source
def copy_for(platforms)
platforms.select! {|p| for?(p) }
return unless platforms.any?
copied_sg = self.class.new(@all_specs)
copied_sg.ignores_bundler_dependencies = @ignores_bundler_dependencies
copied_sg.activated_platforms = platforms
copied_sg
end
eql?(other)
click to toggle source
def eql?(other)
return unless other.is_a?(SpecGroup)
name.eql?(other.name) &&
version.eql?(other.version) &&
sorted_activated_platforms.eql?(other.sorted_activated_platforms) &&
source.eql?(other.source)
end
for?(platform)
click to toggle source
def for?(platform)
@specs[platform].any?
end
hash()
click to toggle source
def hash
name.hash ^ version.hash ^ sorted_activated_platforms.hash ^ source.hash
end
to_s()
click to toggle source
def to_s
activated_platforms_string = sorted_activated_platforms.join(", ")
"#{name} (#{version}) (#{activated_platforms_string})"
end
to_specs()
click to toggle source
def to_specs
@activated_platforms.map do |p|
specs = @specs[p]
next unless specs.any?
specs.map do |s|
lazy_spec = LazySpecification.new(name, version, s.platform, source)
lazy_spec.dependencies.replace s.dependencies
lazy_spec
end
end.flatten.compact.uniq
end