Class: Gem::Dependency
- Defined in:
- lib/bundler/resolver.rb,
lib/bundler/rubygems_ext.rb,
lib/bundler/shared_helpers.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#groups ⇒ Object
Returns the value of attribute groups.
-
#source ⇒ Object
Returns the value of attribute source.
Instance Method Summary collapse
- #encode_with(coder) ⇒ Object
-
#matches_spec?(spec) ⇒ Boolean
Backport of performance enhancement added to Rubygems 1.4.
- #required_by ⇒ Object
- #requirement ⇒ Object
- #to_lock ⇒ Object
- #to_yaml_properties ⇒ Object
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
110 111 112 |
# File 'lib/bundler/rubygems_ext.rb', line 110 def groups @groups end |
#source ⇒ Object
Returns the value of attribute source.
110 111 112 |
# File 'lib/bundler/rubygems_ext.rb', line 110 def source @source end |
Instance Method Details
#encode_with(coder) ⇒ Object
114 115 116 117 118 |
# File 'lib/bundler/rubygems_ext.rb', line 114 def encode_with(coder) to_yaml_properties.each do |ivar| coder[ivar.to_s.sub(/^@/, '')] = instance_variable_get(ivar) end end |
#matches_spec?(spec) ⇒ Boolean
Backport of performance enhancement added to Rubygems 1.4
134 135 136 137 138 139 140 |
# File 'lib/bundler/rubygems_ext.rb', line 134 def matches_spec?(spec) # name can be a Regexp, so use === return false unless name === spec.name return true if requirement.none? requirement.satisfied_by?(spec.version) end |
#required_by ⇒ Object
16 17 18 |
# File 'lib/bundler/resolver.rb', line 16 def required_by @required_by ||= [] end |
#requirement ⇒ Object
9 10 11 |
# File 'lib/bundler/shared_helpers.rb', line 9 def requirement version_requirements end |
#to_lock ⇒ Object
124 125 126 127 128 129 130 131 |
# File 'lib/bundler/rubygems_ext.rb', line 124 def to_lock out = " #{name}" unless requirement == Gem::Requirement.default reqs = requirement.requirements.map{|o,v| "#{o} #{v}" }.sort.reverse out << " (#{reqs.join(', ')})" end out end |
#to_yaml_properties ⇒ Object
120 121 122 |
# File 'lib/bundler/rubygems_ext.rb', line 120 def to_yaml_properties instance_variables.reject { |p| ["@source", "@groups"].include?(p.to_s) } end |