bundler 1.10.6 → 1.11.0.pre.1

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 (126) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +105 -0
  3. data/.rubocop_todo.yml +120 -0
  4. data/.travis.yml +8 -23
  5. data/CHANGELOG.md +69 -0
  6. data/CODE_OF_CONDUCT.md +6 -4
  7. data/DEVELOPMENT.md +4 -5
  8. data/README.md +2 -2
  9. data/Rakefile +70 -87
  10. data/bin/rake +14 -0
  11. data/bin/rspec +10 -0
  12. data/bin/rubocop +11 -0
  13. data/bundler.gemspec +17 -15
  14. data/exe/bundle +20 -0
  15. data/{bin → exe}/bundle_ruby +6 -4
  16. data/exe/bundler +20 -0
  17. data/lib/bundler.rb +98 -119
  18. data/lib/bundler/capistrano.rb +2 -2
  19. data/lib/bundler/cli.rb +85 -74
  20. data/lib/bundler/cli/binstubs.rb +1 -2
  21. data/lib/bundler/cli/cache.rb +0 -1
  22. data/lib/bundler/cli/check.rb +7 -5
  23. data/lib/bundler/cli/clean.rb +0 -1
  24. data/lib/bundler/cli/common.rb +6 -7
  25. data/lib/bundler/cli/config.rb +69 -56
  26. data/lib/bundler/cli/console.rb +8 -8
  27. data/lib/bundler/cli/exec.rb +4 -3
  28. data/lib/bundler/cli/gem.rb +50 -39
  29. data/lib/bundler/cli/init.rb +5 -6
  30. data/lib/bundler/cli/inject.rb +1 -2
  31. data/lib/bundler/cli/install.rb +18 -21
  32. data/lib/bundler/cli/lock.rb +8 -3
  33. data/lib/bundler/cli/open.rb +4 -5
  34. data/lib/bundler/cli/outdated.rb +7 -8
  35. data/lib/bundler/cli/package.rb +1 -1
  36. data/lib/bundler/cli/platform.rb +2 -3
  37. data/lib/bundler/cli/show.rb +9 -9
  38. data/lib/bundler/cli/update.rb +2 -3
  39. data/lib/bundler/cli/viz.rb +1 -2
  40. data/lib/bundler/constants.rb +1 -1
  41. data/lib/bundler/current_ruby.rb +38 -3
  42. data/lib/bundler/definition.rb +83 -88
  43. data/lib/bundler/dep_proxy.rb +11 -9
  44. data/lib/bundler/dependency.rb +26 -11
  45. data/lib/bundler/deployment.rb +2 -2
  46. data/lib/bundler/deprecate.rb +3 -3
  47. data/lib/bundler/dsl.rb +63 -44
  48. data/lib/bundler/env.rb +19 -12
  49. data/lib/bundler/environment.rb +1 -2
  50. data/lib/bundler/errors.rb +82 -0
  51. data/lib/bundler/fetcher.rb +45 -39
  52. data/lib/bundler/fetcher/base.rb +20 -7
  53. data/lib/bundler/fetcher/dependency.rb +5 -5
  54. data/lib/bundler/fetcher/downloader.rb +1 -2
  55. data/lib/bundler/fetcher/index.rb +4 -7
  56. data/lib/bundler/friendly_errors.rb +15 -8
  57. data/lib/bundler/gem_helper.rb +44 -35
  58. data/lib/bundler/gem_helpers.rb +7 -8
  59. data/lib/bundler/gem_remote_fetcher.rb +41 -0
  60. data/lib/bundler/gem_tasks.rb +4 -1
  61. data/lib/bundler/graph.rb +25 -24
  62. data/lib/bundler/index.rb +21 -18
  63. data/lib/bundler/injector.rb +2 -4
  64. data/lib/bundler/inline.rb +3 -3
  65. data/lib/bundler/installer.rb +57 -144
  66. data/lib/bundler/installer/gem_installer.rb +76 -0
  67. data/lib/bundler/installer/parallel_installer.rb +22 -13
  68. data/lib/bundler/installer/standalone.rb +48 -0
  69. data/lib/bundler/lazy_specification.rb +3 -4
  70. data/lib/bundler/lockfile_parser.rb +21 -19
  71. data/lib/bundler/match_platform.rb +4 -4
  72. data/lib/bundler/psyched_yaml.rb +3 -3
  73. data/lib/bundler/remote_specification.rb +1 -1
  74. data/lib/bundler/resolver.rb +93 -88
  75. data/lib/bundler/retry.rb +9 -10
  76. data/lib/bundler/ruby_dsl.rb +1 -1
  77. data/lib/bundler/ruby_version.rb +7 -10
  78. data/lib/bundler/rubygems_ext.rb +32 -27
  79. data/lib/bundler/{gem_installer.rb → rubygems_gem_installer.rb} +2 -2
  80. data/lib/bundler/rubygems_integration.rb +85 -70
  81. data/lib/bundler/runtime.rb +57 -61
  82. data/lib/bundler/settings.rb +27 -26
  83. data/lib/bundler/setup.rb +3 -3
  84. data/lib/bundler/shared_helpers.rb +45 -20
  85. data/lib/bundler/similarity_detector.rb +19 -21
  86. data/lib/bundler/source.rb +4 -5
  87. data/lib/bundler/source/git.rb +29 -31
  88. data/lib/bundler/source/git/git_proxy.rb +52 -26
  89. data/lib/bundler/source/path.rb +25 -28
  90. data/lib/bundler/source/path/installer.rb +4 -4
  91. data/lib/bundler/source/rubygems.rb +62 -48
  92. data/lib/bundler/source/rubygems/remote.rb +3 -3
  93. data/lib/bundler/source_list.rb +4 -4
  94. data/lib/bundler/spec_set.rb +17 -15
  95. data/lib/bundler/ssl_certs/certificate_manager.rb +5 -6
  96. data/lib/bundler/stub_specification.rb +2 -2
  97. data/lib/bundler/templates/Executable +5 -5
  98. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +42 -6
  99. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  100. data/lib/bundler/templates/newgem/Rakefile.tt +4 -2
  101. data/lib/bundler/templates/newgem/bin/setup.tt +2 -1
  102. data/lib/bundler/templates/newgem/newgem.gemspec.tt +2 -2
  103. data/lib/bundler/ui.rb +3 -3
  104. data/lib/bundler/ui/rg_proxy.rb +2 -2
  105. data/lib/bundler/ui/shell.rb +10 -6
  106. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +82 -71
  107. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +1 -1
  108. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +9 -0
  109. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +40 -21
  110. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -0
  111. data/lib/bundler/vendored_molinillo.rb +1 -1
  112. data/lib/bundler/vendored_persistent.rb +3 -3
  113. data/lib/bundler/vendored_thor.rb +2 -2
  114. data/lib/bundler/version.rb +1 -1
  115. data/lib/bundler/vlad.rb +1 -1
  116. data/lib/bundler/worker.rb +4 -5
  117. data/man/bundle-config.ronn +4 -2
  118. data/man/bundle-gem.ronn +77 -0
  119. data/man/bundle-install.ronn +13 -6
  120. data/man/bundle-lock.ronn +47 -0
  121. data/man/bundle.ronn +1 -1
  122. data/man/gemfile.5.ronn +8 -0
  123. data/man/index.txt +1 -0
  124. metadata +37 -8
  125. data/bin/bundle +0 -21
  126. data/bin/bundler +0 -21
@@ -7,7 +7,7 @@ module Bundler
7
7
 
8
8
  def run
9
9
  if File.exist?("Gemfile")
10
- Bundler.ui.error "Gemfile already exists at #{Dir.pwd}/Gemfile"
10
+ Bundler.ui.error "Gemfile already exists at #{SharedHelpers.pwd}/Gemfile"
11
11
  exit 1
12
12
  end
13
13
 
@@ -18,16 +18,15 @@ module Bundler
18
18
  exit 1
19
19
  end
20
20
  spec = Gem::Specification.load(gemspec)
21
- puts "Writing new Gemfile to #{Dir.pwd}/Gemfile"
22
- File.open('Gemfile', 'wb') do |file|
21
+ puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
22
+ File.open("Gemfile", "wb") do |file|
23
23
  file << "# Generated from #{gemspec}\n"
24
24
  file << spec.to_gemfile
25
25
  end
26
26
  else
27
- puts "Writing new Gemfile to #{Dir.pwd}/Gemfile"
28
- FileUtils.cp(File.expand_path('../../templates/Gemfile', __FILE__), 'Gemfile')
27
+ puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile"
28
+ FileUtils.cp(File.expand_path("../../templates/Gemfile", __FILE__), "Gemfile")
29
29
  end
30
30
  end
31
-
32
31
  end
33
32
  end
@@ -23,11 +23,10 @@ module Bundler
23
23
 
24
24
  if added.any?
25
25
  Bundler.ui.confirm "Added to Gemfile:"
26
- Bundler.ui.confirm added.map{ |g| " #{g}" }.join("\n")
26
+ Bundler.ui.confirm added.map {|g| " #{g}" }.join("\n")
27
27
  else
28
28
  Bundler.ui.confirm "All injected gems were already present in the Gemfile"
29
29
  end
30
30
  end
31
-
32
31
  end
33
32
  end
@@ -29,17 +29,17 @@ module Bundler
29
29
  Bundler.settings.without = [] if options[:without] && options[:without].empty?
30
30
 
31
31
  with = options.fetch("with", [])
32
- with |= Bundler.settings.with.map {|group| group.to_s }
32
+ with |= Bundler.settings.with.map(&:to_s)
33
33
  with -= options[:without] if options[:without]
34
34
 
35
35
  without = options.fetch("without", [])
36
- without |= Bundler.settings.without.map {|group| group.to_s }
36
+ without |= Bundler.settings.without.map(&:to_s)
37
37
  without -= options[:with] if options[:with]
38
38
 
39
39
  options[:with] = with
40
40
  options[:without] = without
41
41
 
42
- ENV['RB_USER_INSTALL'] = '1' if Bundler::FREEBSD
42
+ ENV["RB_USER_INSTALL"] = "1" if Bundler::FREEBSD
43
43
 
44
44
  # Just disable color in deployment mode
45
45
  Bundler.ui.shell = Thor::Shell::Basic.new if options[:deployment]
@@ -50,10 +50,10 @@ module Bundler
50
50
  exit 1
51
51
  end
52
52
 
53
- if (options["trust-policy"])
54
- unless (Bundler.rubygems.security_policies.keys.include?(options["trust-policy"]))
53
+ if options["trust-policy"]
54
+ unless Bundler.rubygems.security_policies.keys.include?(options["trust-policy"])
55
55
  Bundler.ui.error "Rubygems doesn't know about trust policy '#{options["trust-policy"]}'. " \
56
- "The known policies are: #{Bundler.rubygems.security_policies.keys.join(', ')}."
56
+ "The known policies are: #{Bundler.rubygems.security_policies.keys.join(", ")}."
57
57
  exit 1
58
58
  end
59
59
  Bundler.settings["trust-policy"] = options["trust-policy"]
@@ -63,17 +63,15 @@ module Bundler
63
63
 
64
64
  if options[:deployment] || options[:frozen]
65
65
  unless Bundler.default_lockfile.exist?
66
- flag = options[:deployment] ? '--deployment' : '--frozen'
67
- raise ProductionError, "The #{flag} flag requires a Gemfile.lock. Please make " \
68
- "sure you have checked your Gemfile.lock into version control " \
66
+ flag = options[:deployment] ? "--deployment" : "--frozen"
67
+ raise ProductionError, "The #{flag} flag requires a #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)}. Please make " \
68
+ "sure you have checked your #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} into version control " \
69
69
  "before deploying."
70
70
  end
71
71
 
72
- if Bundler.app_cache.exist?
73
- options[:local] = true
74
- end
72
+ options[:local] = true if Bundler.app_cache.exist?
75
73
 
76
- Bundler.settings[:frozen] = '1'
74
+ Bundler.settings[:frozen] = "1"
77
75
  end
78
76
 
79
77
  # When install is called with --no-deployment, disable deployment mode
@@ -85,7 +83,7 @@ module Bundler
85
83
  Bundler.settings[:path] = nil if options[:system]
86
84
  Bundler.settings[:path] = "vendor/bundle" if options[:deployment]
87
85
  Bundler.settings[:path] = options["path"] if options["path"]
88
- Bundler.settings[:path] ||= "bundle" if options["standalone"]
86
+ Bundler.settings[:path] ||= "bundle" if options["standalone"]
89
87
  Bundler.settings[:bin] = options["binstubs"] if options["binstubs"]
90
88
  Bundler.settings[:bin] = nil if options["binstubs"] && options["binstubs"].empty?
91
89
  Bundler.settings[:shebang] = options["shebang"] if options["shebang"]
@@ -96,7 +94,7 @@ module Bundler
96
94
  Bundler.settings.without = options[:without]
97
95
  Bundler.settings.with = options[:with]
98
96
  Bundler::Fetcher.disable_endpoint = options["full-index"]
99
- Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? '1' : nil
97
+ Bundler.settings[:disable_shared_gems] = Bundler.settings[:path] ? "1" : nil
100
98
 
101
99
  # rubygems plugins sometimes hook into the gem install process
102
100
  Gem.load_env_plugins if Gem.respond_to?(:load_env_plugins)
@@ -112,7 +110,7 @@ module Bundler
112
110
 
113
111
  if Bundler.settings[:path]
114
112
  absolute_path = File.expand_path(Bundler.settings[:path])
115
- relative_path = absolute_path.sub(File.expand_path('.'), '.')
113
+ relative_path = absolute_path.sub(File.expand_path("."), ".")
116
114
  Bundler.ui.confirm "Bundled gems are installed into #{relative_path}."
117
115
  else
118
116
  Bundler.ui.confirm "Use `bundle show [gemname]` to see where a bundled gem is installed."
@@ -128,7 +126,7 @@ module Bundler
128
126
  Bundler.ui.error "Warning: the gem '#{name}' was found in multiple sources."
129
127
  Bundler.ui.error "Installed from: #{installed_from_uri}"
130
128
  Bundler.ui.error "Also found in:"
131
- also_found_in_uris.each { |uri| Bundler.ui.error " * #{uri}" }
129
+ also_found_in_uris.each {|uri| Bundler.ui.error " * #{uri}" }
132
130
  Bundler.ui.error "You should add a source requirement to restrict this gem to your preferred source."
133
131
  Bundler.ui.error "For example:"
134
132
  Bundler.ui.error " gem '#{name}', :source => '#{installed_from_uri}'"
@@ -157,7 +155,7 @@ module Bundler
157
155
  private
158
156
 
159
157
  def warn_if_root
160
- return if Bundler::WINDOWS || !Process.uid.zero?
158
+ return if Bundler.settings[:silence_root_warning] || Bundler::WINDOWS || !Process.uid.zero?
161
159
  Bundler.ui.warn "Don't run Bundler as root. Bundler can ask for sudo " \
162
160
  "if it is needed, and installing your bundle as root will break this " \
163
161
  "application for all non-root users on this machine.", :wrap => true
@@ -172,18 +170,17 @@ module Bundler
172
170
 
173
171
  def dependencies_count_for(definition)
174
172
  count = definition.dependencies.count
175
- "#{count} Gemfile #{count == 1 ? 'dependency' : 'dependencies'}"
173
+ "#{count} Gemfile #{count == 1 ? "dependency" : "dependencies"}"
176
174
  end
177
175
 
178
176
  def gems_installed_for(definition)
179
177
  count = definition.specs.count
180
- "#{count} #{count == 1 ? 'gem' : 'gems'} now installed"
178
+ "#{count} #{count == 1 ? "gem" : "gems"} now installed"
181
179
  end
182
180
 
183
181
  def print_post_install_message(name, msg)
184
182
  Bundler.ui.confirm "Post-install message from #{name}:"
185
183
  Bundler.ui.info msg
186
184
  end
187
-
188
185
  end
189
186
  end
@@ -16,8 +16,14 @@ module Bundler
16
16
  ui = Bundler.ui
17
17
  Bundler.ui = UI::Silent.new if print
18
18
 
19
- unlock = options[:update]
20
- definition = Bundler.definition(unlock)
19
+ gems = options[:update]
20
+
21
+ if gems && !gems.empty?
22
+ definition = Bundler.definition(:gems => gems)
23
+ else
24
+ definition = Bundler.definition(true)
25
+ end
26
+
21
27
  definition.resolve_remotely! unless options[:local]
22
28
 
23
29
  if print
@@ -31,6 +37,5 @@ module Bundler
31
37
 
32
38
  Bundler.ui = ui
33
39
  end
34
-
35
40
  end
36
41
  end
@@ -1,5 +1,5 @@
1
- require 'bundler/cli/common'
2
- require 'shellwords'
1
+ require "bundler/cli/common"
2
+ require "shellwords"
3
3
 
4
4
  module Bundler
5
5
  class CLI::Open
@@ -10,14 +10,13 @@ module Bundler
10
10
  end
11
11
 
12
12
  def run
13
- editor = [ENV['BUNDLER_EDITOR'], ENV['VISUAL'], ENV['EDITOR']].find{|e| !e.nil? && !e.empty? }
13
+ editor = [ENV["BUNDLER_EDITOR"], ENV["VISUAL"], ENV["EDITOR"]].find {|e| !e.nil? && !e.empty? }
14
14
  return Bundler.ui.info("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR") unless editor
15
15
  path = Bundler::CLI::Common.select_spec(name, :regex_match).full_gem_path
16
16
  Dir.chdir(path) do
17
17
  command = Shellwords.split(editor) + [path]
18
- system(*command) || Bundler.ui.info("Could not run '#{command.join(' ')}'")
18
+ system(*command) || Bundler.ui.info("Could not run '#{command.join(" ")}'")
19
19
  end
20
20
  end
21
-
22
21
  end
23
22
  end
@@ -1,4 +1,4 @@
1
- require 'bundler/cli/common'
1
+ require "bundler/cli/common"
2
2
 
3
3
  module Bundler
4
4
  class CLI::Outdated
@@ -18,7 +18,7 @@ module Bundler
18
18
  Bundler.definition.validate_ruby!
19
19
  current_specs = Bundler.ui.silence { Bundler.load.specs }
20
20
  current_dependencies = {}
21
- Bundler.ui.silence { Bundler.load.dependencies.each { |dep| current_dependencies[dep.name] = dep } }
21
+ Bundler.ui.silence { Bundler.load.dependencies.each {|dep| current_dependencies[dep.name] = dep } }
22
22
 
23
23
  if gems.empty? && sources.empty?
24
24
  # We're doing a full update
@@ -32,18 +32,18 @@ module Bundler
32
32
 
33
33
  out_count = 0
34
34
  # Loop through the current specs
35
- gemfile_specs, dependency_specs = current_specs.partition { |spec| current_dependencies.has_key? spec.name }
35
+ gemfile_specs, dependency_specs = current_specs.partition {|spec| current_dependencies.key? spec.name }
36
36
  [gemfile_specs.sort_by(&:name), dependency_specs.sort_by(&:name)].flatten.each do |current_spec|
37
37
  next if !gems.empty? && !gems.include?(current_spec.name)
38
38
 
39
39
  dependency = current_dependencies[current_spec.name]
40
40
 
41
41
  if options["strict"]
42
- active_spec = definition.specs.detect { |spec| spec.name == current_spec.name }
42
+ active_spec = definition.specs.detect {|spec| spec.name == current_spec.name }
43
43
  else
44
- active_spec = definition.index[current_spec.name].sort_by { |b| b.version }
44
+ active_spec = definition.index[current_spec.name].sort_by(&:version)
45
45
  if !current_spec.version.prerelease? && !options[:pre] && active_spec.size > 1
46
- active_spec = active_spec.delete_if { |b| b.respond_to?(:version) && b.version.prerelease? }
46
+ active_spec = active_spec.delete_if {|b| b.respond_to?(:version) && b.version.prerelease? }
47
47
  end
48
48
  active_spec = active_spec.last
49
49
  end
@@ -62,7 +62,7 @@ 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 = %|, requested #{dependency.requirement}| if dependency && dependency.specific?
65
+ dependency_version = %(, requested #{dependency.requirement}) if dependency && dependency.specific?
66
66
 
67
67
  if dependency
68
68
  groups = dependency.groups.join(", ")
@@ -82,6 +82,5 @@ module Bundler
82
82
  exit 1
83
83
  end
84
84
  end
85
-
86
85
  end
87
86
  end
@@ -23,7 +23,7 @@ module Bundler
23
23
  private
24
24
 
25
25
  def install
26
- require 'bundler/cli/install'
26
+ require "bundler/cli/install"
27
27
  options = self.options.dup
28
28
  if Bundler.settings[:cache_all_platforms]
29
29
  options["local"] = false
@@ -7,8 +7,8 @@ module Bundler
7
7
 
8
8
  def run
9
9
  platforms, ruby_version = Bundler.ui.silence do
10
- [ Bundler.definition.platforms.map {|p| "* #{p}" },
11
- Bundler.definition.ruby_version ]
10
+ [Bundler.definition.platforms.map {|p| "* #{p}" },
11
+ Bundler.definition.ruby_version]
12
12
  end
13
13
  output = []
14
14
 
@@ -38,6 +38,5 @@ module Bundler
38
38
 
39
39
  Bundler.ui.info output.join("\n\n")
40
40
  end
41
-
42
41
  end
43
42
  end
@@ -1,4 +1,4 @@
1
- require 'bundler/cli/common'
1
+ require "bundler/cli/common"
2
2
 
3
3
  module Bundler
4
4
  class CLI::Show
@@ -23,7 +23,7 @@ module Bundler
23
23
  spec = Bundler::CLI::Common.select_spec(gem_name, :regex_match)
24
24
  return unless spec
25
25
  path = spec.full_gem_path
26
- if !File.directory?(path)
26
+ unless File.directory?(path)
27
27
  Bundler.ui.warn "The gem #{gem_name} has been deleted. It was installed at:"
28
28
  end
29
29
  end
@@ -31,19 +31,19 @@ module Bundler
31
31
  end
32
32
 
33
33
  if options[:paths]
34
- Bundler.load.specs.sort_by { |s| s.name }.map do |s|
34
+ Bundler.load.specs.sort_by(&:name).map do |s|
35
35
  Bundler.ui.info s.full_gem_path
36
36
  end
37
37
  else
38
38
  Bundler.ui.info "Gems included by the bundle:"
39
- Bundler.load.specs.sort_by { |s| s.name }.each do |s|
39
+ Bundler.load.specs.sort_by(&:name).each do |s|
40
40
  desc = " * #{s.name} (#{s.version}#{s.git_version})"
41
41
  if @verbose
42
- latest = latest_specs.find { |l| l.name == s.name }
43
- Bundler.ui.info <<-END.gsub(/^ +/, '')
42
+ latest = latest_specs.find {|l| l.name == s.name }
43
+ Bundler.ui.info <<-END.gsub(/^ +/, "")
44
44
  #{desc}
45
- \tSummary: #{s.summary || 'No description available.'}
46
- \tHomepage: #{s.homepage || 'No website available.'}
45
+ \tSummary: #{s.summary || "No description available."}
46
+ \tHomepage: #{s.homepage || "No website available."}
47
47
  \tStatus: #{outdated?(s, latest) ? "Outdated - #{s.version} < #{latest.version}" : "Up to date"}
48
48
  END
49
49
  else
@@ -53,7 +53,7 @@ module Bundler
53
53
  end
54
54
  end
55
55
 
56
- private
56
+ private
57
57
 
58
58
  def fetch_latest_specs
59
59
  definition = Bundler.definition(true)
@@ -21,7 +21,7 @@ module Bundler
21
21
  "Run `bundle install` to update and install the bundled gems."
22
22
  end
23
23
  # cycle through the requested gems, just to make sure they exist
24
- names = Bundler.locked_gems.specs.map{ |s| s.name }
24
+ names = Bundler.locked_gems.specs.map(&:name)
25
25
  gems.each do |g|
26
26
  next if names.include?(g)
27
27
  require "bundler/cli/common"
@@ -30,7 +30,7 @@ module Bundler
30
30
 
31
31
  if groups.any?
32
32
  specs = Bundler.definition.specs_for groups
33
- sources.concat(specs.map(&:name))
33
+ gems.concat(specs.map(&:name))
34
34
  end
35
35
 
36
36
  Bundler.definition(:gems => gems, :sources => sources)
@@ -68,6 +68,5 @@ module Bundler
68
68
  Bundler.ui.confirm Bundler::CLI::Common.without_groups_message
69
69
  end
70
70
  end
71
-
72
71
  end
73
72
  end
@@ -6,7 +6,7 @@ module Bundler
6
6
  end
7
7
 
8
8
  def run
9
- require 'graphviz'
9
+ require "graphviz"
10
10
  output_file = File.expand_path(options[:file])
11
11
  graph = Graph.new(Bundler.load, output_file, options[:version], options[:requirements], options[:format], options[:without])
12
12
  graph.viz
@@ -22,6 +22,5 @@ module Bundler
22
22
  raise
23
23
  end
24
24
  end
25
-
26
25
  end
27
26
  end
@@ -1,5 +1,5 @@
1
1
  module Bundler
2
- WINDOWS = RbConfig::CONFIG["host_os"] =~ %r!(msdos|mswin|djgpp|mingw)!
2
+ WINDOWS = RbConfig::CONFIG["host_os"] =~ /(msdos|mswin|djgpp|mingw)/
3
3
  FREEBSD = RbConfig::CONFIG["host_os"] =~ /bsd/
4
4
  NULL = WINDOWS ? "NUL" : "/dev/null"
5
5
  end
@@ -27,6 +27,14 @@ module Bundler
27
27
  RUBY_VERSION =~ /^2\.2/
28
28
  end
29
29
 
30
+ def on_23?
31
+ RUBY_VERSION =~ /^2\.3/
32
+ end
33
+
34
+ def on_2?
35
+ on_20? || on_21? || on_22? || on_23?
36
+ end
37
+
30
38
  def ruby?
31
39
  !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby" || RUBY_ENGINE == "rbx" || RUBY_ENGINE == "maglev")
32
40
  end
@@ -51,6 +59,14 @@ module Bundler
51
59
  ruby? && on_22?
52
60
  end
53
61
 
62
+ def ruby_23?
63
+ ruby? && on_23?
64
+ end
65
+
66
+ def ruby_2?
67
+ ruby? && on_2?
68
+ end
69
+
54
70
  def mri?
55
71
  !mswin? && (!defined?(RUBY_ENGINE) || RUBY_ENGINE == "ruby")
56
72
  end
@@ -75,6 +91,10 @@ module Bundler
75
91
  mri? && on_22?
76
92
  end
77
93
 
94
+ def mri_23?
95
+ mri? && on_23?
96
+ end
97
+
78
98
  def rbx?
79
99
  ruby? && defined?(RUBY_ENGINE) && RUBY_ENGINE == "rbx"
80
100
  end
@@ -119,8 +139,12 @@ module Bundler
119
139
  mswin? && on_22?
120
140
  end
121
141
 
142
+ def mswin_23?
143
+ mswin? && on_23?
144
+ end
145
+
122
146
  def mswin64?
123
- Bundler::WINDOWS && Gem::Platform.local.os == "mswin64" && Gem::Platform.local.cpu == 'x64'
147
+ Bundler::WINDOWS && Gem::Platform.local.os == "mswin64" && Gem::Platform.local.cpu == "x64"
124
148
  end
125
149
 
126
150
  def mswin64_19?
@@ -139,8 +163,12 @@ module Bundler
139
163
  mswin64? && on_22?
140
164
  end
141
165
 
166
+ def mswin64_23?
167
+ mswin64? && on_23?
168
+ end
169
+
142
170
  def mingw?
143
- Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu != 'x64'
171
+ Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu != "x64"
144
172
  end
145
173
 
146
174
  def mingw_18?
@@ -163,8 +191,12 @@ module Bundler
163
191
  mingw? && on_22?
164
192
  end
165
193
 
194
+ def mingw_23?
195
+ mingw? && on_23?
196
+ end
197
+
166
198
  def x64_mingw?
167
- Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu == 'x64'
199
+ Bundler::WINDOWS && Gem::Platform.local.os == "mingw32" && Gem::Platform.local.cpu == "x64"
168
200
  end
169
201
 
170
202
  def x64_mingw_20?
@@ -179,5 +211,8 @@ module Bundler
179
211
  x64_mingw? && on_22?
180
212
  end
181
213
 
214
+ def x64_mingw_23?
215
+ x64_mingw? && on_23?
216
+ end
182
217
  end
183
218
  end