bundler 1.9.10 → 1.10.0.pre
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of bundler might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +21 -13
- data/Rakefile +2 -2
- data/bin/bundle_ruby +2 -0
- data/bin/bundler +1 -1
- data/lib/bundler.rb +6 -10
- data/lib/bundler/cli.rb +23 -1
- data/lib/bundler/cli/gem.rb +5 -2
- data/lib/bundler/cli/install.rb +37 -5
- data/lib/bundler/cli/lock.rb +36 -0
- data/lib/bundler/cli/outdated.rb +9 -2
- data/lib/bundler/definition.rb +22 -7
- data/lib/bundler/dependency.rb +7 -6
- data/lib/bundler/deployment.rb +3 -0
- data/lib/bundler/dsl.rb +172 -39
- data/lib/bundler/endpoint_specification.rb +1 -1
- data/lib/bundler/fetcher.rb +90 -252
- data/lib/bundler/fetcher/base.rb +27 -0
- data/lib/bundler/fetcher/dependency.rb +88 -0
- data/lib/bundler/fetcher/downloader.rb +61 -0
- data/lib/bundler/fetcher/index.rb +31 -0
- data/lib/bundler/friendly_errors.rb +3 -0
- data/lib/bundler/inline.rb +50 -0
- data/lib/bundler/installer.rb +15 -60
- data/lib/bundler/installer/parallel_installer.rb +117 -0
- data/lib/bundler/lazy_specification.rb +1 -1
- data/lib/bundler/lockfile_parser.rb +26 -10
- data/lib/bundler/remote_specification.rb +21 -1
- data/lib/bundler/resolver.rb +2 -1
- data/lib/bundler/retry.rb +11 -10
- data/lib/bundler/rubygems_ext.rb +1 -1
- data/lib/bundler/rubygems_integration.rb +33 -6
- data/lib/bundler/settings.rb +58 -14
- data/lib/bundler/shared_helpers.rb +6 -3
- data/lib/bundler/source.rb +0 -10
- data/lib/bundler/source/git.rb +2 -2
- data/lib/bundler/source/path.rb +1 -1
- data/lib/bundler/source/path/installer.rb +8 -11
- data/lib/bundler/source/rubygems.rb +46 -16
- data/lib/bundler/source/rubygems/remote.rb +39 -0
- data/lib/bundler/templates/newgem/.travis.yml.tt +1 -0
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +2 -2
- data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
- data/lib/bundler/templates/newgem/test/{test_newgem.rb.tt → newgem_test.rb.tt} +2 -2
- data/lib/bundler/templates/newgem/test/{minitest_helper.rb.tt → test_helper.rb.tt} +0 -0
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-config.ronn +7 -0
- data/man/bundle-install.ronn +9 -0
- data/man/bundle.ronn +3 -3
- data/man/gemfile.5.ronn +9 -5
- metadata +13 -8
- data/UPGRADING.md +0 -103
- data/lib/bundler/anonymizable_uri.rb +0 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4128a621db3d926d6579de067a966664457734f
|
4
|
+
data.tar.gz: b0629f20a391f86092ce149087566e1f16ed7991
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7000dfc488e2c0c88fd3e195803b2ba301004f97a91c1ab7c8d56a4b06391a7000a78f4b9cd429ede5be1d50d34e1e727cd363253ebae4478ef44fd922191d1b
|
7
|
+
data.tar.gz: e4da7e38155cc47bb60b9727445d36974c19faee89bdaa596dc0d195a57cd69ca9aeb4002b2712e9009c05f7ce6c8061bac5cc271b87bcab016ed21ca249f12f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,26 +1,33 @@
|
|
1
|
-
## 1.
|
1
|
+
## 1.10.0.pre (2015-05-03)
|
2
2
|
|
3
3
|
Features:
|
4
4
|
|
5
|
-
-
|
6
|
-
|
7
|
-
|
5
|
+
- support gem extensions built into any directory on RubyGems 2.2+ (#3582, @voxik)
|
6
|
+
- add 'bundler/inline' which provides a `gemfile` method (#3440, @segiddins)
|
7
|
+
- improved error reports for Gemfile errors (#3480, @segiddins)
|
8
|
+
- `lock` command (#3437, @segiddins)
|
9
|
+
- add `ignore_messages` config to suppress post-install text (#3510, @pducks32)
|
10
|
+
- improve `gem` minitest template (#3513, #3515, @arthurnn)
|
11
|
+
- add `install --force` to re-install installed gems (#3519, @segiddins)
|
12
|
+
- show more `outdated` information, including groups (@smlance, @indirect)
|
13
|
+
- add optional groups to the Gemfile (#3531, @jhass)
|
14
|
+
- accept glob argument to `gemspec` in Gemfile (#3464, @pjump)
|
15
|
+
- make timeouts and retries configurable via `config` (#3601, @pducks32)
|
16
|
+
- add `install_if` Gemfile method for conditional installs (#3611, @segiddins)
|
8
17
|
|
9
18
|
Bugfixes:
|
10
19
|
|
11
|
-
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
Bugfixes:
|
20
|
+
- standalone mode now uses builtin gems correctly (#3610, @segiddins)
|
21
|
+
- fix `rake spec:deps` on MinGW Ruby 2.0+ (#3487, @marutosi)
|
22
|
+
- remember all y/n answers when generating gems (#3579, @pducks32)
|
16
23
|
|
17
|
-
|
24
|
+
Performance:
|
18
25
|
|
19
|
-
|
26
|
+
- use RubyGems stub specifications when possible (#3580, @segiddins)
|
20
27
|
|
21
|
-
|
28
|
+
Deprecations:
|
22
29
|
|
23
|
-
-
|
30
|
+
- deprecated the (never enabled) `bundle_ruby` binary (@smlance)
|
24
31
|
|
25
32
|
## 1.9.6 (2015-05-02)
|
26
33
|
|
@@ -76,6 +83,7 @@ Bugfixes:
|
|
76
83
|
|
77
84
|
- make Bundler.which stop finding directories (@nohoho)
|
78
85
|
- handle Bundler prereleases correctly (#3470, @segiddins)
|
86
|
+
- add before_install to .travis.yml template for new gems (@kodnin)
|
79
87
|
|
80
88
|
## 1.9.0.pre.1 (2015-03-11)
|
81
89
|
|
data/Rakefile
CHANGED
@@ -98,8 +98,8 @@ namespace :spec do
|
|
98
98
|
end
|
99
99
|
|
100
100
|
deps.sort_by{|name, _| name }.each do |name, version|
|
101
|
-
sh
|
102
|
-
|
101
|
+
sh %{#{Gem.ruby} -S gem list -i "^#{name}$" -v "#{version}" || } +
|
102
|
+
%{#{Gem.ruby} -S gem install #{name} -v "#{version}" --no-ri --no-rdoc}
|
103
103
|
end
|
104
104
|
|
105
105
|
# Download and install gems used inside tests
|
data/bin/bundle_ruby
CHANGED
data/bin/bundler
CHANGED
@@ -6,7 +6,7 @@ Signal.trap("INT") { exit 1 }
|
|
6
6
|
require 'bundler'
|
7
7
|
# Check if an older version of bundler is installed
|
8
8
|
$LOAD_PATH.each do |path|
|
9
|
-
if path =~ %r'/bundler-0
|
9
|
+
if path =~ %r'/bundler-0\.(\d+)' && $1.to_i < 9
|
10
10
|
err = "Looks like you have a version of bundler that's older than 0.9.\n"
|
11
11
|
err << "Please remove your old versions.\n"
|
12
12
|
err << "An easy way to do this is by running `gem cleanup bundler`."
|
data/lib/bundler.rb
CHANGED
@@ -12,7 +12,6 @@ module Bundler
|
|
12
12
|
preserve_gem_path
|
13
13
|
ORIGINAL_ENV = ENV.to_hash
|
14
14
|
|
15
|
-
autoload :AnonymizableURI, 'bundler/anonymizable_uri'
|
16
15
|
autoload :Definition, 'bundler/definition'
|
17
16
|
autoload :Dependency, 'bundler/dependency'
|
18
17
|
autoload :DepProxy, 'bundler/dep_proxy'
|
@@ -121,12 +120,7 @@ module Bundler
|
|
121
120
|
# Load all groups, but only once
|
122
121
|
@setup = load.setup
|
123
122
|
else
|
124
|
-
|
125
|
-
# Figure out which groups haven't been loaded yet
|
126
|
-
unloaded = groups - @completed_groups
|
127
|
-
# Record groups that are now loaded
|
128
|
-
@completed_groups = groups
|
129
|
-
unloaded.any? ? load.setup(*groups) : load
|
123
|
+
load.setup(*groups)
|
130
124
|
end
|
131
125
|
end
|
132
126
|
|
@@ -212,11 +206,13 @@ module Bundler
|
|
212
206
|
end
|
213
207
|
|
214
208
|
def tmp(name = Process.pid.to_s)
|
215
|
-
Pathname.new
|
209
|
+
@tmp ||= Pathname.new Dir.mktmpdir("bundler")
|
210
|
+
@tmp.join(name)
|
216
211
|
end
|
217
212
|
|
218
|
-
def
|
219
|
-
FileUtils.remove_entry_secure(
|
213
|
+
def cleanup
|
214
|
+
FileUtils.remove_entry_secure(@tmp) if defined?(@tmp) && @tmp
|
215
|
+
rescue
|
220
216
|
end
|
221
217
|
|
222
218
|
def settings
|
data/lib/bundler/cli.rb
CHANGED
@@ -11,6 +11,8 @@ module Bundler
|
|
11
11
|
rescue Exception => e
|
12
12
|
Bundler.ui = UI::Shell.new
|
13
13
|
raise e
|
14
|
+
ensure
|
15
|
+
Bundler.cleanup
|
14
16
|
end
|
15
17
|
|
16
18
|
def initialize(*args)
|
@@ -18,7 +20,7 @@ module Bundler
|
|
18
20
|
current_cmd = args.last[:current_command].name
|
19
21
|
custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
|
20
22
|
ENV['BUNDLE_GEMFILE'] = File.expand_path(custom_gemfile) if custom_gemfile
|
21
|
-
Bundler
|
23
|
+
Bundler.settings[:retry] = options[:retry] if options[:retry]
|
22
24
|
Bundler.rubygems.ui = UI::RGProxy.new(Bundler.ui)
|
23
25
|
auto_install if AUTO_INSTALL_CMDS.include?(current_cmd)
|
24
26
|
rescue UnknownArgumentError => e
|
@@ -132,6 +134,8 @@ module Bundler
|
|
132
134
|
"Do not attempt to fetch gems remotely and use the gem cache instead"
|
133
135
|
method_option "no-cache", :type => :boolean, :banner =>
|
134
136
|
"Don't update the existing gem cache."
|
137
|
+
method_option "force", :type => :boolean, :banner =>
|
138
|
+
"Force downloading every gem."
|
135
139
|
method_option "no-prune", :type => :boolean, :banner =>
|
136
140
|
"Don't remove stale gems from the cache."
|
137
141
|
method_option "path", :type => :string, :banner =>
|
@@ -149,6 +153,8 @@ module Bundler
|
|
149
153
|
Bundler.rubygems.security_policy_keys.join('|')
|
150
154
|
method_option "without", :type => :array, :banner =>
|
151
155
|
"Exclude gems that are part of the specified named group."
|
156
|
+
method_option "with", :type => :array, :banner =>
|
157
|
+
"Include gems that are part of the specified named group."
|
152
158
|
|
153
159
|
def install
|
154
160
|
require 'bundler/cli/install'
|
@@ -173,6 +179,8 @@ module Bundler
|
|
173
179
|
"Only output warnings and errors."
|
174
180
|
method_option "source", :type => :array, :banner =>
|
175
181
|
"Update a specific source (and all gems associated with it)"
|
182
|
+
method_option "force", :type => :boolean, :banner =>
|
183
|
+
"Force downloading every gem."
|
176
184
|
def update(*gems)
|
177
185
|
require 'bundler/cli/update'
|
178
186
|
Update.new(options, gems).run
|
@@ -377,6 +385,20 @@ module Bundler
|
|
377
385
|
Inject.new(options, name, version, gems).run
|
378
386
|
end
|
379
387
|
|
388
|
+
desc "lock", "Creates a lockfile without installing"
|
389
|
+
method_option "update", :type => :boolean, :default => false, :banner =>
|
390
|
+
"ignore the existing lockfile"
|
391
|
+
method_option "local", :type => :boolean, :default => false, :banner =>
|
392
|
+
"do not attempt to fetch remote gemspecs and use the local gem cache only"
|
393
|
+
method_option "print", :type => :boolean, :default => false, :banner =>
|
394
|
+
"print the lockfile to STDOUT instead of writing to the file system"
|
395
|
+
method_option "lockfile", :type => :string, :default => nil, :banner =>
|
396
|
+
"the path the lockfile should be written to"
|
397
|
+
def lock
|
398
|
+
require 'bundler/cli/lock'
|
399
|
+
Lock.new(options).run
|
400
|
+
end
|
401
|
+
|
380
402
|
desc "env", "Print information about the environment Bundler is running under"
|
381
403
|
def env
|
382
404
|
Env.new.write($stdout)
|
data/lib/bundler/cli/gem.rb
CHANGED
@@ -66,6 +66,7 @@ module Bundler
|
|
66
66
|
"of enforcing it, so be sure that you are prepared to do that. For suggestions about " \
|
67
67
|
"how to enforce codes of conduct, see bit.ly/coc-enforcement."
|
68
68
|
)
|
69
|
+
Bundler.ui.info "Code of conduct enabled in config"
|
69
70
|
templates.merge!("CODE_OF_CONDUCT.md.tt" => "CODE_OF_CONDUCT.md")
|
70
71
|
end
|
71
72
|
|
@@ -75,10 +76,12 @@ module Bundler
|
|
75
76
|
"at choosealicense.com/licenses/mit."
|
76
77
|
)
|
77
78
|
config[:mit] = true
|
79
|
+
Bundler.ui.info "MIT License enabled in config"
|
78
80
|
templates.merge!("LICENSE.txt.tt" => "LICENSE.txt")
|
79
81
|
end
|
80
82
|
|
81
83
|
if test_framework = ask_and_set_test_framework
|
84
|
+
config[:test] = test_framework
|
82
85
|
templates.merge!(".travis.yml.tt" => ".travis.yml")
|
83
86
|
|
84
87
|
case test_framework
|
@@ -90,8 +93,8 @@ module Bundler
|
|
90
93
|
)
|
91
94
|
when 'minitest'
|
92
95
|
templates.merge!(
|
93
|
-
"test/
|
94
|
-
"test/
|
96
|
+
"test/test_helper.rb.tt" => "test/test_helper.rb",
|
97
|
+
"test/newgem_test.rb.tt" => "test/#{namespaced_path}_test.rb"
|
95
98
|
)
|
96
99
|
end
|
97
100
|
end
|
data/lib/bundler/cli/install.rb
CHANGED
@@ -10,10 +10,35 @@ module Bundler
|
|
10
10
|
|
11
11
|
warn_if_root
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
[:with, :without].each do |option|
|
14
|
+
if options[option]
|
15
|
+
options[option] = options[option].join(":").tr(" ", ":").split(":")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
if options[:without] && options[:with]
|
20
|
+
conflicting_groups = options[:without] & options[:with]
|
21
|
+
unless conflicting_groups.empty?
|
22
|
+
Bundler.ui.error "You can't list a group in both, --with and --without." \
|
23
|
+
"The offending groups are: #{conflicting_groups.join(", ")}."
|
24
|
+
exit 1
|
25
|
+
end
|
15
26
|
end
|
16
27
|
|
28
|
+
Bundler.settings.with = [] if options[:with] && options[:with].empty?
|
29
|
+
Bundler.settings.without = [] if options[:without] && options[:without].empty?
|
30
|
+
|
31
|
+
with = options.fetch("with", [])
|
32
|
+
with |= Bundler.settings.with.map {|group| group.to_s }
|
33
|
+
with -= options[:without] if options[:without]
|
34
|
+
|
35
|
+
without = options.fetch("without", [])
|
36
|
+
without |= Bundler.settings.without.map {|group| group.to_s }
|
37
|
+
without -= options[:with] if options[:with]
|
38
|
+
|
39
|
+
options[:with] = with
|
40
|
+
options[:without] = without
|
41
|
+
|
17
42
|
ENV['RB_USER_INSTALL'] = '1' if Bundler::FREEBSD
|
18
43
|
|
19
44
|
# Just disable color in deployment mode
|
@@ -69,6 +94,7 @@ module Bundler
|
|
69
94
|
Bundler.settings[:no_install] = true if options["no-install"]
|
70
95
|
Bundler.settings[:clean] = options["clean"] if options["clean"]
|
71
96
|
Bundler.settings.without = options[:without]
|
97
|
+
Bundler.settings.with = options[:with]
|
72
98
|
Bundler::Fetcher.disable_endpoint = options["full-index"]
|
73
99
|
Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? '1' : nil
|
74
100
|
|
@@ -91,9 +117,10 @@ module Bundler
|
|
91
117
|
Bundler.ui.confirm "Use `bundle show [gemname]` to see where a bundled gem is installed."
|
92
118
|
end
|
93
119
|
|
94
|
-
|
95
|
-
|
96
|
-
|
120
|
+
unless Bundler.settings["ignore_messages"]
|
121
|
+
Installer.post_install_messages.to_a.each do |name, msg|
|
122
|
+
print_post_install_message(name, msg) unless Bundler.settings["ignore_messages.#{name}"]
|
123
|
+
end
|
97
124
|
end
|
98
125
|
|
99
126
|
Installer.ambiguous_gems.to_a.each do |name, installed_from_uri, *also_found_in_uris|
|
@@ -152,5 +179,10 @@ module Bundler
|
|
152
179
|
"#{count} #{count == 1 ? 'gem' : 'gems'} now installed"
|
153
180
|
end
|
154
181
|
|
182
|
+
def print_post_install_message(name, msg)
|
183
|
+
Bundler.ui.confirm "Post-install message from #{name}:"
|
184
|
+
Bundler.ui.info msg
|
185
|
+
end
|
186
|
+
|
155
187
|
end
|
156
188
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
module Bundler
|
2
|
+
class CLI::Lock
|
3
|
+
attr_reader :options
|
4
|
+
|
5
|
+
def initialize(options)
|
6
|
+
@options = options
|
7
|
+
end
|
8
|
+
|
9
|
+
def run
|
10
|
+
unless Bundler.default_gemfile
|
11
|
+
Bundler.ui.error "Unable to find a Gemfile to lock"
|
12
|
+
exit 1
|
13
|
+
end
|
14
|
+
|
15
|
+
print = options[:print]
|
16
|
+
ui = Bundler.ui
|
17
|
+
Bundler.ui = UI::Silent.new if print
|
18
|
+
|
19
|
+
unlock = options[:update]
|
20
|
+
definition = Bundler.definition(unlock)
|
21
|
+
definition.resolve_remotely! unless options[:local]
|
22
|
+
|
23
|
+
if print
|
24
|
+
puts definition.to_lock
|
25
|
+
else
|
26
|
+
file = options[:lockfile]
|
27
|
+
file = file ? File.expand_path(file) : Bundler.default_lockfile
|
28
|
+
puts "Writing lockfile to #{file}"
|
29
|
+
definition.lock(file)
|
30
|
+
end
|
31
|
+
|
32
|
+
Bundler.ui = ui
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
end
|
data/lib/bundler/cli/outdated.rb
CHANGED
@@ -62,8 +62,15 @@ module Bundler
|
|
62
62
|
|
63
63
|
spec_version = "#{active_spec.version}#{active_spec.git_version}"
|
64
64
|
current_version = "#{current_spec.version}#{current_spec.git_version}"
|
65
|
-
dependency_version =
|
66
|
-
|
65
|
+
dependency_version = %|, requested #{dependency.requirement}| if dependency && dependency.specific?
|
66
|
+
|
67
|
+
if dependency
|
68
|
+
groups = dependency.groups.join(", ")
|
69
|
+
pl = (dependency.groups.length > 1) ? "s" : ""
|
70
|
+
groups = " in group#{pl} \"#{groups}\""
|
71
|
+
end
|
72
|
+
|
73
|
+
Bundler.ui.info " * #{active_spec.name} (newest #{spec_version}, installed #{current_version}#{dependency_version})#{groups}".rstrip
|
67
74
|
out_count += 1
|
68
75
|
end
|
69
76
|
Bundler.ui.debug "from #{active_spec.loaded_from}"
|
data/lib/bundler/definition.rb
CHANGED
@@ -43,10 +43,11 @@ module Bundler
|
|
43
43
|
# @param unlock [Hash, Boolean, nil] Gems that have been requested
|
44
44
|
# to be updated or true if all gems should be updated
|
45
45
|
# @param ruby_version [Bundler::RubyVersion, nil] Requested Ruby Version
|
46
|
-
|
46
|
+
# @param optional_groups [Array(String)] A list of optional groups
|
47
|
+
def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil, optional_groups = [])
|
47
48
|
@unlocking = unlock == true || !unlock.empty?
|
48
49
|
|
49
|
-
@dependencies, @sources, @unlock = dependencies, sources, unlock
|
50
|
+
@dependencies, @sources, @unlock, @optional_groups = dependencies, sources, unlock, optional_groups
|
50
51
|
@remote = false
|
51
52
|
@specs = nil
|
52
53
|
@lockfile_contents = ""
|
@@ -56,6 +57,7 @@ module Bundler
|
|
56
57
|
@lockfile_contents = Bundler.read_file(lockfile)
|
57
58
|
locked = LockfileParser.new(@lockfile_contents)
|
58
59
|
@platforms = locked.platforms
|
60
|
+
@locked_bundler_version = locked.bundler_version
|
59
61
|
|
60
62
|
if unlock != true
|
61
63
|
@locked_deps = locked.dependencies
|
@@ -161,7 +163,7 @@ module Bundler
|
|
161
163
|
|
162
164
|
def requested_specs
|
163
165
|
@requested_specs ||= begin
|
164
|
-
groups =
|
166
|
+
groups = requested_groups
|
165
167
|
groups.map! { |g| g.to_sym }
|
166
168
|
specs_for(groups)
|
167
169
|
end
|
@@ -255,6 +257,16 @@ module Bundler
|
|
255
257
|
"#{File.expand_path(file)}"
|
256
258
|
end
|
257
259
|
|
260
|
+
# Returns the version of Bundler that is creating or has created
|
261
|
+
# Gemfile.lock. Used in #to_lock.
|
262
|
+
def lock_version
|
263
|
+
if @locked_bundler_version && @locked_bundler_version < Gem::Version.new(Bundler::VERSION)
|
264
|
+
new_version = Bundler::VERSION
|
265
|
+
end
|
266
|
+
|
267
|
+
new_version || @locked_bundler_version || Bundler::VERSION
|
268
|
+
end
|
269
|
+
|
258
270
|
def to_lock
|
259
271
|
out = ""
|
260
272
|
|
@@ -293,9 +305,9 @@ module Bundler
|
|
293
305
|
handled << dep.name
|
294
306
|
end
|
295
307
|
|
296
|
-
|
297
|
-
|
298
|
-
|
308
|
+
# Record the version of Bundler that was used to create the lockfile
|
309
|
+
out << "\nBUNDLED WITH\n"
|
310
|
+
out << " #{lock_version}\n"
|
299
311
|
|
300
312
|
out
|
301
313
|
end
|
@@ -594,7 +606,7 @@ module Bundler
|
|
594
606
|
end
|
595
607
|
|
596
608
|
def requested_dependencies
|
597
|
-
groups =
|
609
|
+
groups = requested_groups
|
598
610
|
groups.map! { |g| g.to_sym }
|
599
611
|
dependencies.reject { |d| !d.should_include? || (d.groups & groups).empty? }
|
600
612
|
end
|
@@ -628,5 +640,8 @@ module Bundler
|
|
628
640
|
names
|
629
641
|
end
|
630
642
|
|
643
|
+
def requested_groups
|
644
|
+
self.groups - Bundler.settings.without - @optional_groups + Bundler.settings.with
|
645
|
+
end
|
631
646
|
end
|
632
647
|
end
|
data/lib/bundler/dependency.rb
CHANGED
@@ -50,11 +50,12 @@ module Bundler
|
|
50
50
|
type = options["type"] || :runtime
|
51
51
|
super(name, version, type)
|
52
52
|
|
53
|
-
@autorequire
|
54
|
-
@groups
|
55
|
-
@source
|
56
|
-
@platforms
|
57
|
-
@env
|
53
|
+
@autorequire = nil
|
54
|
+
@groups = Array(options["group"] || :default).map { |g| g.to_sym }
|
55
|
+
@source = options["source"]
|
56
|
+
@platforms = Array(options["platforms"])
|
57
|
+
@env = options["env"]
|
58
|
+
@should_include = options.fetch("should_include", true)
|
58
59
|
|
59
60
|
if options.key?('require')
|
60
61
|
@autorequire = Array(options['require'] || [])
|
@@ -74,7 +75,7 @@ module Bundler
|
|
74
75
|
end
|
75
76
|
|
76
77
|
def should_include?
|
77
|
-
current_env? && current_platform?
|
78
|
+
@should_include && current_env? && current_platform?
|
78
79
|
end
|
79
80
|
|
80
81
|
def current_env?
|