Class: Gem::Dependency

Inherits:
Object
  • Object
show all
Includes:
Bundler::ForcePlatform
Defined in:
lib/bundler/rubygems_ext.rb

Direct Known Subclasses

Bundler::Dependency

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#groupsObject

Returns the value of attribute groups.



240
241
242
# File 'lib/bundler/rubygems_ext.rb', line 240

def groups
  @groups
end

#sourceObject

Returns the value of attribute source.



240
241
242
# File 'lib/bundler/rubygems_ext.rb', line 240

def source
  @source
end

Instance Method Details

#encode_with(coder) ⇒ Object



250
251
252
253
254
# File 'lib/bundler/rubygems_ext.rb', line 250

def encode_with(coder)
  to_yaml_properties.each do |ivar|
    coder[ivar.to_s.sub(/^@/, "")] = instance_variable_get(ivar)
  end
end

#force_ruby_platformObject



244
245
246
247
248
# File 'lib/bundler/rubygems_ext.rb', line 244

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_lockObject



260
261
262
263
264
265
266
267
# File 'lib/bundler/rubygems_ext.rb', line 260

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_propertiesObject



256
257
258
# File 'lib/bundler/rubygems_ext.rb', line 256

def to_yaml_properties
  instance_variables.reject {|p| ["@source", "@groups"].include?(p.to_s) }
end