Class: Gem::Dependency
- Inherits:
-
Object
- Object
- Gem::Dependency
- Defined in:
- lib/bundler/rubygems_ext.rb,
lib/bundler/shared_helpers.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#all_sources ⇒ Object
Returns the value of attribute all_sources.
-
#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.
- #requirement ⇒ Object
- #to_lock ⇒ Object
- #to_yaml_properties ⇒ Object
Instance Attribute Details
#all_sources ⇒ Object
Returns the value of attribute all_sources.
139 140 141 |
# File 'lib/bundler/rubygems_ext.rb', line 139 def all_sources @all_sources end |
#groups ⇒ Object
Returns the value of attribute groups.
139 140 141 |
# File 'lib/bundler/rubygems_ext.rb', line 139 def groups @groups end |
#source ⇒ Object
Returns the value of attribute source.
139 140 141 |
# File 'lib/bundler/rubygems_ext.rb', line 139 def source @source end |
Instance Method Details
#encode_with(coder) ⇒ Object
143 144 145 146 147 |
# File 'lib/bundler/rubygems_ext.rb', line 143 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
163 164 165 166 167 168 169 |
# File 'lib/bundler/rubygems_ext.rb', line 163 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 |
#requirement ⇒ Object
17 18 19 |
# File 'lib/bundler/shared_helpers.rb', line 17 def requirement version_requirements end |
#to_lock ⇒ Object
153 154 155 156 157 158 159 160 |
# File 'lib/bundler/rubygems_ext.rb', line 153 def to_lock out = String.new(" #{name}") unless requirement.none? reqs = requirement.requirements.map {|o, v| "#{o} #{v}" }.sort.reverse out << " (#{reqs.join(", ")})" end out end |
#to_yaml_properties ⇒ Object
149 150 151 |
# File 'lib/bundler/rubygems_ext.rb', line 149 def to_yaml_properties instance_variables.reject {|p| ["@source", "@groups", "@all_sources"].include?(p.to_s) } end |