Class: Gem::Dependency
- Inherits:
-
Object
- Object
- Gem::Dependency
- Includes:
- Bundler::ForcePlatform
- Defined in:
- lib/bundler/rubygems_ext.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
- #force_ruby_platform ⇒ Object
- #to_lock ⇒ Object
- #to_yaml_properties ⇒ Object
Instance Attribute Details
#groups ⇒ Object
Returns the value of attribute groups.
161 162 163 |
# File 'lib/bundler/rubygems_ext.rb', line 161 def groups @groups end |
#source ⇒ Object
Returns the value of attribute source.
161 162 163 |
# File 'lib/bundler/rubygems_ext.rb', line 161 def source @source end |
Instance Method Details
#encode_with(coder) ⇒ Object
171 172 173 174 175 |
# File 'lib/bundler/rubygems_ext.rb', line 171 def encode_with(coder) to_yaml_properties.each do |ivar| coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar) end end |
#force_ruby_platform ⇒ Object
165 166 167 168 169 |
# File 'lib/bundler/rubygems_ext.rb', line 165 def force_ruby_platform return @force_ruby_platform if defined?(@force_ruby_platform) && !@force_ruby_platform.nil? @force_ruby_platform = default_force_ruby_platform end |
#to_lock ⇒ Object
181 182 183 184 185 186 187 188 |
# File 'lib/bundler/rubygems_ext.rb', line 181 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
177 178 179 |
# File 'lib/bundler/rubygems_ext.rb', line 177 def to_yaml_properties instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) } end |