blob: b9aebd1351fc30a7e78479bf29af398eda1fe986 (
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'
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
if @source
out << ":\n #{@source.to_lock}\n"
else
out << "\n"
end
end
end
end
|