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.

Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGELOG.md +21 -13
  4. data/Rakefile +2 -2
  5. data/bin/bundle_ruby +2 -0
  6. data/bin/bundler +1 -1
  7. data/lib/bundler.rb +6 -10
  8. data/lib/bundler/cli.rb +23 -1
  9. data/lib/bundler/cli/gem.rb +5 -2
  10. data/lib/bundler/cli/install.rb +37 -5
  11. data/lib/bundler/cli/lock.rb +36 -0
  12. data/lib/bundler/cli/outdated.rb +9 -2
  13. data/lib/bundler/definition.rb +22 -7
  14. data/lib/bundler/dependency.rb +7 -6
  15. data/lib/bundler/deployment.rb +3 -0
  16. data/lib/bundler/dsl.rb +172 -39
  17. data/lib/bundler/endpoint_specification.rb +1 -1
  18. data/lib/bundler/fetcher.rb +90 -252
  19. data/lib/bundler/fetcher/base.rb +27 -0
  20. data/lib/bundler/fetcher/dependency.rb +88 -0
  21. data/lib/bundler/fetcher/downloader.rb +61 -0
  22. data/lib/bundler/fetcher/index.rb +31 -0
  23. data/lib/bundler/friendly_errors.rb +3 -0
  24. data/lib/bundler/inline.rb +50 -0
  25. data/lib/bundler/installer.rb +15 -60
  26. data/lib/bundler/installer/parallel_installer.rb +117 -0
  27. data/lib/bundler/lazy_specification.rb +1 -1
  28. data/lib/bundler/lockfile_parser.rb +26 -10
  29. data/lib/bundler/remote_specification.rb +21 -1
  30. data/lib/bundler/resolver.rb +2 -1
  31. data/lib/bundler/retry.rb +11 -10
  32. data/lib/bundler/rubygems_ext.rb +1 -1
  33. data/lib/bundler/rubygems_integration.rb +33 -6
  34. data/lib/bundler/settings.rb +58 -14
  35. data/lib/bundler/shared_helpers.rb +6 -3
  36. data/lib/bundler/source.rb +0 -10
  37. data/lib/bundler/source/git.rb +2 -2
  38. data/lib/bundler/source/path.rb +1 -1
  39. data/lib/bundler/source/path/installer.rb +8 -11
  40. data/lib/bundler/source/rubygems.rb +46 -16
  41. data/lib/bundler/source/rubygems/remote.rb +39 -0
  42. data/lib/bundler/templates/newgem/.travis.yml.tt +1 -0
  43. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +2 -2
  44. data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
  45. data/lib/bundler/templates/newgem/test/{test_newgem.rb.tt → newgem_test.rb.tt} +2 -2
  46. data/lib/bundler/templates/newgem/test/{minitest_helper.rb.tt → test_helper.rb.tt} +0 -0
  47. data/lib/bundler/version.rb +1 -1
  48. data/man/bundle-config.ronn +7 -0
  49. data/man/bundle-install.ronn +9 -0
  50. data/man/bundle.ronn +3 -3
  51. data/man/gemfile.5.ronn +9 -5
  52. metadata +13 -8
  53. data/UPGRADING.md +0 -103
  54. data/lib/bundler/anonymizable_uri.rb +0 -32
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7ba9a5f037fd8b2267e68e4e626430415af1bad
4
- data.tar.gz: d8a8a8c16b072a11b045ee0aa8a552ceafcc6efc
3
+ metadata.gz: a4128a621db3d926d6579de067a966664457734f
4
+ data.tar.gz: b0629f20a391f86092ce149087566e1f16ed7991
5
5
  SHA512:
6
- metadata.gz: eff7b83bdb98b930a813a883b342040eee62223128c873b183923cdfcaaf9e3686ff07cf0a3472899e3fea03e884cc188049a7f37bab9d001f4dfc25675c6728
7
- data.tar.gz: 876a966f750690227641524d8cd6bf4dc4d0b72c1ff6b3a92ba8514ab858e53d828de7da19c7fcfffff6fe0adef0af37105c838483514a974858c31a89412ee9
6
+ metadata.gz: 7000dfc488e2c0c88fd3e195803b2ba301004f97a91c1ab7c8d56a4b06391a7000a78f4b9cd429ede5be1d50d34e1e727cd363253ebae4478ef44fd922191d1b
7
+ data.tar.gz: e4da7e38155cc47bb60b9727445d36974c19faee89bdaa596dc0d195a57cd69ca9aeb4002b2712e9009c05f7ce6c8061bac5cc271b87bcab016ed21ca249f12f
@@ -33,6 +33,7 @@ rvm:
33
33
  - 2.0.0
34
34
  - 1.9.3
35
35
  - 1.8.7
36
+ - rbx-2
36
37
 
37
38
  # Rubygems versions MUST be available as rake tasks
38
39
  # see Rakefile:66 for the list of possible RGV values
@@ -1,26 +1,33 @@
1
- ## 1.9.10 (2015-06-22)
1
+ ## 1.10.0.pre (2015-05-03)
2
2
 
3
3
  Features:
4
4
 
5
- - the `BUNDLED WITH` section of lockfiles generated by 1.10+ will be preserved (@segiddins)
6
-
7
- ## 1.9.9 (2015-05-16)
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
- - read mirror and credential settings from older versions (#3557, @Strech)
12
-
13
- ## 1.9.8 (2015-05-12)
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
- - fix regression in sudo mode introduced by 1.9.7 (#3642, @segiddins)
24
+ Performance:
18
25
 
19
- ## 1.9.7 (2015-05-11)
26
+ - use RubyGems stub specifications when possible (#3580, @segiddins)
20
27
 
21
- Bugfixes:
28
+ Deprecations:
22
29
 
23
- - always clean up tmp dirs (#3277, @hone, @indirect, @segiddins)
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 "#{Gem.ruby} -S gem list -i '^#{name}$' -v '#{version}' || " \
102
- "#{Gem.ruby} -S gem install #{name} -v '#{version}' --no-ri --no-rdoc"
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
@@ -41,6 +41,8 @@ module Bundler
41
41
  end
42
42
  end
43
43
 
44
+ STDERR.puts "Warning: bundle_ruby will be deprecated in Bundler 2.0.0."
45
+
44
46
  dsl = Bundler::Dsl.new
45
47
  begin
46
48
  dsl.eval_gemfile(Bundler::SharedHelpers.default_gemfile)
@@ -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.(\d+)' && $1.to_i < 9
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`."
@@ -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
- @completed_groups ||= []
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(Dir.mktmpdir(["bundler", name]))
209
+ @tmp ||= Pathname.new Dir.mktmpdir("bundler")
210
+ @tmp.join(name)
216
211
  end
217
212
 
218
- def rm_rf(path)
219
- FileUtils.remove_entry_secure(path) if path && File.exist?(path)
213
+ def cleanup
214
+ FileUtils.remove_entry_secure(@tmp) if defined?(@tmp) && @tmp
215
+ rescue
220
216
  end
221
217
 
222
218
  def settings
@@ -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::Retry.attempts = options[:retry] || Bundler.settings[:retry] || Bundler::Retry::DEFAULT_ATTEMPTS
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)
@@ -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/minitest_helper.rb.tt" => "test/minitest_helper.rb",
94
- "test/test_newgem.rb.tt" => "test/test_#{namespaced_path}.rb"
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
@@ -10,10 +10,35 @@ module Bundler
10
10
 
11
11
  warn_if_root
12
12
 
13
- if options[:without]
14
- options[:without] = options[:without].map{|g| g.tr(' ', ':') }
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
- Installer.post_install_messages.to_a.each do |name, msg|
95
- Bundler.ui.confirm "Post-install message from #{name}:"
96
- Bundler.ui.info msg
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
@@ -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 = %|Gemfile specifies "#{dependency.requirement}"| if dependency && dependency.specific?
66
- Bundler.ui.info " * #{active_spec.name} (#{spec_version} > #{current_version}) #{dependency_version}".rstrip
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}"
@@ -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
- def initialize(lockfile, dependencies, sources, unlock, ruby_version = nil)
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 = self.groups - Bundler.settings.without
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
- if @lockfile_contents =~ /^BUNDLED WITH[\r]?\n(\s{2,}#{Gem::Version::VERSION_PATTERN})[\r]?\n\Z/
297
- out << "\nBUNDLED WITH\n" << $1 << "\n"
298
- end
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 = self.groups - Bundler.settings.without
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
@@ -50,11 +50,12 @@ module Bundler
50
50
  type = options["type"] || :runtime
51
51
  super(name, version, type)
52
52
 
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"]
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?