blob: 295c82b5ecd491a629e0aaf1cac11a560ac8a0ec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
require 'rubygems/dependency'
require 'bundler/shared_helpers'
module Bundler
class Dependency < Gem::Dependency
attr_reader :autorequire
attr_reader :groups
def initialize(name, version, options = {}, &blk)
super(name, version)
@autorequire = nil
@groups = Array(options["group"] || :default).map { |g| g.to_sym }
@source = options["source"]
if options.key?('require')
@autorequire = Array(options['require'] || [])
end
end
def to_lock
out = " #{name}"
unless requirement == Gem::Requirement.default
out << " (#{requirement.to_s})"
end
out << '!' if source
out << "\n"
end
end
end
|