bundler 1.7.15 → 1.8.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 (191) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +5 -14
  3. data/.rspec +1 -0
  4. data/.travis.yml +22 -15
  5. data/CHANGELOG.md +43 -13
  6. data/CODE_OF_CONDUCT.md +40 -0
  7. data/CONTRIBUTING.md +14 -12
  8. data/DEVELOPMENT.md +4 -2
  9. data/ISSUES.md +1 -1
  10. data/README.md +10 -14
  11. data/Rakefile +10 -10
  12. data/bin/bundle +1 -1
  13. data/bundler.gemspec +5 -4
  14. data/lib/bundler.rb +22 -3
  15. data/lib/bundler/anonymizable_uri.rb +24 -8
  16. data/lib/bundler/cli.rb +103 -66
  17. data/lib/bundler/cli/cache.rb +1 -0
  18. data/lib/bundler/cli/clean.rb +11 -4
  19. data/lib/bundler/cli/common.rb +2 -0
  20. data/lib/bundler/cli/console.rb +22 -26
  21. data/lib/bundler/cli/exec.rb +29 -22
  22. data/lib/bundler/cli/gem.rb +125 -37
  23. data/lib/bundler/cli/install.rb +22 -9
  24. data/lib/bundler/cli/outdated.rb +1 -1
  25. data/lib/bundler/cli/package.rb +8 -1
  26. data/lib/bundler/cli/show.rb +29 -3
  27. data/lib/bundler/cli/update.rb +2 -2
  28. data/lib/bundler/cli/viz.rb +1 -1
  29. data/lib/bundler/definition.rb +14 -22
  30. data/lib/bundler/dependency.rb +8 -1
  31. data/lib/bundler/dsl.rb +17 -4
  32. data/lib/bundler/endpoint_specification.rb +1 -1
  33. data/lib/bundler/env.rb +44 -25
  34. data/lib/bundler/fetcher.rb +33 -25
  35. data/lib/bundler/friendly_errors.rb +38 -5
  36. data/lib/bundler/gem_helper.rb +16 -10
  37. data/lib/bundler/gem_helpers.rb +1 -0
  38. data/lib/bundler/graph.rb +4 -1
  39. data/lib/bundler/index.rb +15 -25
  40. data/lib/bundler/installer.rb +6 -6
  41. data/lib/bundler/lockfile_parser.rb +7 -7
  42. data/lib/bundler/resolver.rb +2 -1
  43. data/lib/bundler/ruby_version.rb +1 -1
  44. data/lib/bundler/rubygems_ext.rb +1 -0
  45. data/lib/bundler/rubygems_integration.rb +1 -1
  46. data/lib/bundler/runtime.rb +22 -40
  47. data/lib/bundler/settings.rb +14 -5
  48. data/lib/bundler/setup.rb +2 -1
  49. data/lib/bundler/shared_helpers.rb +56 -4
  50. data/lib/bundler/source.rb +8 -9
  51. data/lib/bundler/source/git.rb +5 -1
  52. data/lib/bundler/source/git/git_proxy.rb +4 -0
  53. data/lib/bundler/source/path.rb +8 -11
  54. data/lib/bundler/source/path/installer.rb +0 -2
  55. data/lib/bundler/source/rubygems.rb +58 -72
  56. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +13 -0
  57. data/lib/bundler/templates/newgem/LICENSE.txt.tt +17 -18
  58. data/lib/bundler/templates/newgem/README.md.tt +9 -1
  59. data/lib/bundler/templates/newgem/Rakefile.tt +2 -0
  60. data/lib/bundler/templates/newgem/bin/console.tt +14 -0
  61. data/lib/bundler/templates/newgem/bin/setup.tt +7 -0
  62. data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  63. data/lib/bundler/templates/newgem/gitignore.tt +2 -0
  64. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +1 -1
  65. data/lib/bundler/templates/newgem/newgem.gemspec.tt +17 -13
  66. data/lib/bundler/templates/newgem/test/test_newgem.rb.tt +1 -1
  67. data/lib/bundler/ui/shell.rb +1 -1
  68. data/lib/bundler/version.rb +1 -1
  69. data/lib/bundler/worker.rb +73 -0
  70. data/man/bundle-config.ronn +17 -15
  71. data/man/bundle-install.ronn +102 -93
  72. data/man/bundle-update.ronn +39 -30
  73. data/man/bundle.ronn +6 -0
  74. data/man/gemfile.5.ronn +74 -13
  75. metadata +10 -231
  76. data/lib/bundler/parallel_workers.rb +0 -18
  77. data/lib/bundler/parallel_workers/thread_worker.rb +0 -30
  78. data/lib/bundler/parallel_workers/unix_worker.rb +0 -101
  79. data/lib/bundler/parallel_workers/worker.rb +0 -69
  80. data/lib/bundler/templates/newgem/bin/newgem.tt +0 -3
  81. data/spec/bundler/anonymizable_uri_spec.rb +0 -32
  82. data/spec/bundler/bundler_spec.rb +0 -72
  83. data/spec/bundler/cli_spec.rb +0 -16
  84. data/spec/bundler/definition_spec.rb +0 -22
  85. data/spec/bundler/dsl_spec.rb +0 -82
  86. data/spec/bundler/friendly_errors_spec.rb +0 -13
  87. data/spec/bundler/gem_helper_spec.rb +0 -226
  88. data/spec/bundler/psyched_yaml_spec.rb +0 -8
  89. data/spec/bundler/retry_spec.rb +0 -59
  90. data/spec/bundler/settings_spec.rb +0 -13
  91. data/spec/bundler/source/rubygems_spec.rb +0 -25
  92. data/spec/bundler/source_list_spec.rb +0 -361
  93. data/spec/cache/gems_spec.rb +0 -284
  94. data/spec/cache/git_spec.rb +0 -188
  95. data/spec/cache/path_spec.rb +0 -121
  96. data/spec/cache/platform_spec.rb +0 -57
  97. data/spec/commands/binstubs_spec.rb +0 -219
  98. data/spec/commands/check_spec.rb +0 -278
  99. data/spec/commands/clean_spec.rb +0 -592
  100. data/spec/commands/config_spec.rb +0 -263
  101. data/spec/commands/console_spec.rb +0 -76
  102. data/spec/commands/exec_spec.rb +0 -309
  103. data/spec/commands/help_spec.rb +0 -39
  104. data/spec/commands/init_spec.rb +0 -39
  105. data/spec/commands/inject_spec.rb +0 -78
  106. data/spec/commands/licenses_spec.rb +0 -18
  107. data/spec/commands/newgem_spec.rb +0 -428
  108. data/spec/commands/open_spec.rb +0 -68
  109. data/spec/commands/outdated_spec.rb +0 -156
  110. data/spec/commands/package_spec.rb +0 -114
  111. data/spec/commands/show_spec.rb +0 -125
  112. data/spec/install/binstubs_spec.rb +0 -24
  113. data/spec/install/bundler_spec.rb +0 -146
  114. data/spec/install/deploy_spec.rb +0 -250
  115. data/spec/install/gemfile/gemspec_spec.rb +0 -170
  116. data/spec/install/gemfile/git_spec.rb +0 -967
  117. data/spec/install/gemfile/path_spec.rb +0 -500
  118. data/spec/install/gemfile_spec.rb +0 -44
  119. data/spec/install/gems/c_ext_spec.rb +0 -48
  120. data/spec/install/gems/dependency_api_spec.rb +0 -652
  121. data/spec/install/gems/env_spec.rb +0 -107
  122. data/spec/install/gems/flex_spec.rb +0 -314
  123. data/spec/install/gems/groups_spec.rb +0 -308
  124. data/spec/install/gems/mirror_spec.rb +0 -39
  125. data/spec/install/gems/platform_spec.rb +0 -195
  126. data/spec/install/gems/post_install_spec.rb +0 -121
  127. data/spec/install/gems/resolving_spec.rb +0 -124
  128. data/spec/install/gems/simple_case_spec.rb +0 -377
  129. data/spec/install/gems/sources_spec.rb +0 -386
  130. data/spec/install/gems/standalone_spec.rb +0 -260
  131. data/spec/install/gems/sudo_spec.rb +0 -136
  132. data/spec/install/gems/win32_spec.rb +0 -26
  133. data/spec/install/gemspecs_spec.rb +0 -50
  134. data/spec/install/path_spec.rb +0 -150
  135. data/spec/install/post_bundle_message_spec.rb +0 -142
  136. data/spec/install/prereleases_spec.rb +0 -43
  137. data/spec/install/security_policy_spec.rb +0 -77
  138. data/spec/install/upgrade_spec.rb +0 -26
  139. data/spec/lock/git_spec.rb +0 -34
  140. data/spec/lock/lockfile_spec.rb +0 -924
  141. data/spec/other/bundle_ruby_spec.rb +0 -142
  142. data/spec/other/cli_dispatch_spec.rb +0 -21
  143. data/spec/other/ext_spec.rb +0 -60
  144. data/spec/other/platform_spec.rb +0 -1285
  145. data/spec/other/ssl_cert_spec.rb +0 -23
  146. data/spec/quality_spec.rb +0 -88
  147. data/spec/realworld/dependency_api_spec.rb +0 -60
  148. data/spec/realworld/edgecases_spec.rb +0 -212
  149. data/spec/realworld/parallel_spec.rb +0 -71
  150. data/spec/resolver/basic_spec.rb +0 -66
  151. data/spec/resolver/platform_spec.rb +0 -88
  152. data/spec/runtime/executable_spec.rb +0 -149
  153. data/spec/runtime/load_spec.rb +0 -107
  154. data/spec/runtime/platform_spec.rb +0 -90
  155. data/spec/runtime/require_spec.rb +0 -332
  156. data/spec/runtime/setup_spec.rb +0 -853
  157. data/spec/runtime/with_clean_env_spec.rb +0 -91
  158. data/spec/spec_helper.rb +0 -123
  159. data/spec/support/artifice/endopint_marshal_fail_basic_authentication.rb +0 -13
  160. data/spec/support/artifice/endpoint.rb +0 -71
  161. data/spec/support/artifice/endpoint_500.rb +0 -37
  162. data/spec/support/artifice/endpoint_api_forbidden.rb +0 -11
  163. data/spec/support/artifice/endpoint_api_missing.rb +0 -16
  164. data/spec/support/artifice/endpoint_basic_authentication.rb +0 -13
  165. data/spec/support/artifice/endpoint_creds_diff_host.rb +0 -38
  166. data/spec/support/artifice/endpoint_extra.rb +0 -31
  167. data/spec/support/artifice/endpoint_extra_api.rb +0 -32
  168. data/spec/support/artifice/endpoint_extra_missing.rb +0 -15
  169. data/spec/support/artifice/endpoint_fallback.rb +0 -17
  170. data/spec/support/artifice/endpoint_host_redirect.rb +0 -15
  171. data/spec/support/artifice/endpoint_marshal_fail.rb +0 -11
  172. data/spec/support/artifice/endpoint_redirect.rb +0 -15
  173. data/spec/support/artifice/endpoint_strict_basic_authentication.rb +0 -18
  174. data/spec/support/artifice/endpoint_timeout.rb +0 -13
  175. data/spec/support/builders.rb +0 -693
  176. data/spec/support/fakeweb/rack-1.0.0.marshal +0 -2
  177. data/spec/support/fakeweb/windows.rb +0 -23
  178. data/spec/support/hax.rb +0 -22
  179. data/spec/support/helpers.rb +0 -361
  180. data/spec/support/indexes.rb +0 -280
  181. data/spec/support/matchers.rb +0 -77
  182. data/spec/support/path.rb +0 -85
  183. data/spec/support/permissions.rb +0 -10
  184. data/spec/support/platforms.rb +0 -94
  185. data/spec/support/ruby_ext.rb +0 -20
  186. data/spec/support/rubygems_ext.rb +0 -39
  187. data/spec/support/streams.rb +0 -13
  188. data/spec/support/sudo.rb +0 -16
  189. data/spec/update/gems_spec.rb +0 -201
  190. data/spec/update/git_spec.rb +0 -283
  191. data/spec/update/path_spec.rb +0 -18
@@ -0,0 +1,13 @@
1
+ # Contributor Code of Conduct
2
+
3
+ As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
4
+
5
+ We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, age, or religion.
6
+
7
+ Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
8
+
9
+ Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
10
+
11
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
12
+
13
+ This Code of Conduct is adapted from the [Contributor Covenant](http:contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
@@ -1,22 +1,21 @@
1
- Copyright (c) <%=Time.now.year%> <%=config[:author]%>
1
+ The MIT License (MIT)
2
2
 
3
- MIT License
3
+ Copyright (c) <%=Time.now.year%> <%=config[:author]%>
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
15
14
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -1,6 +1,8 @@
1
1
  # <%=config[:constant_name]%>
2
2
 
3
- TODO: Write a gem description
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/<%=config[:namespaced_path]%>`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
4
6
 
5
7
  ## Installation
6
8
 
@@ -22,6 +24,12 @@ Or install it yourself as:
22
24
 
23
25
  TODO: Write usage instructions here
24
26
 
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment. <% if config[:bin] %>Run `bundle exec <%= config[:name] %>` to use the code located in this directory, ignoring other installed copies of this gem.<% end %>
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
25
33
  ## Contributing
26
34
 
27
35
  1. Fork it ( https://github.com/[my-github-username]/<%=config[:name]%>/fork )
@@ -18,6 +18,8 @@ task :default => :spec
18
18
  <% if config[:ext] -%>
19
19
  require "rake/extensiontask"
20
20
 
21
+ task :build => :compile
22
+
21
23
  Rake::ExtensionTask.new("<%=config[:underscored_name]%>") do |ext|
22
24
  ext.lib_dir = "lib/<%=config[:namespaced_path]%>"
23
25
  end
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "<%= config[:namespaced_path] %>"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "<%= config[:namespaced_path] %>"
@@ -7,8 +7,10 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ <%- if config[:ext] -%>
10
11
  *.bundle
11
12
  *.so
12
13
  *.o
13
14
  *.a
14
15
  mkmf.log
16
+ <%- end -%>
@@ -1,7 +1,7 @@
1
1
  <%- config[:constant_array].each_with_index do |c,i| -%>
2
2
  <%= ' '*i %>module <%= c %>
3
3
  <%- end -%>
4
- <%= ' '*config[:constant_array].size %>VERSION = "0.0.1"
4
+ <%= ' '*config[:constant_array].size %>VERSION = "0.1.0"
5
5
  <%- (config[:constant_array].size-1).downto(0) do |i| -%>
6
6
  <%= ' '*i %>end
7
7
  <%- end -%>
@@ -8,25 +8,29 @@ Gem::Specification.new do |spec|
8
8
  spec.version = <%=config[:constant_name]%>::VERSION
9
9
  spec.authors = [<%=config[:author].inspect%>]
10
10
  spec.email = [<%=config[:email].inspect%>]
11
- <% if config[:ext] -%>
12
- spec.extensions = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
13
- <% end -%>
14
- spec.summary = %q{TODO: Write a short summary. Required.}
15
- spec.description = %q{TODO: Write a longer description. Optional.}
16
- spec.homepage = ""
11
+
12
+ if spec.respond_to?(:metadata)
13
+ spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com' to prevent pushes to rubygems.org, or delete to allow pushes to any server."
14
+ end
15
+
16
+ spec.summary = %q{TODO: Write a short summary, because Rubygems requires one.}
17
+ spec.description = %q{TODO: Write a longer description or delete this line.}
18
+ spec.homepage = "TODO: Put your gem's website or public repo URL here."
17
19
  spec.license = "MIT"
18
20
 
19
- spec.files = `git ls-files -z`.split("\x0")
20
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
22
23
  spec.require_paths = ["lib"]
24
+ <%- if config[:ext] -%>
25
+ spec.extensions = ["ext/<%=config[:underscored_name]%>/extconf.rb"]
26
+ <%- end -%>
23
27
 
24
28
  spec.add_development_dependency "bundler", "~> <%= Bundler::VERSION.split(".")[0..1].join(".") %>"
25
29
  spec.add_development_dependency "rake", "~> 10.0"
26
- <% if config[:ext] -%>
30
+ <%- if config[:ext] -%>
27
31
  spec.add_development_dependency "rake-compiler"
28
- <% end -%>
29
- <% if config[:test] -%>
32
+ <%- end -%>
33
+ <%- if config[:test] && config[:test] != "false" -%>
30
34
  spec.add_development_dependency "<%=config[:test]%>"
31
- <% end -%>
35
+ <%- end -%>
32
36
  end
@@ -1,6 +1,6 @@
1
1
  require 'minitest_helper'
2
2
 
3
- class Test<%= config[:constant_name] %> < MiniTest::Unit::TestCase
3
+ class Test<%= config[:constant_name] %> < Minitest::Test
4
4
  def test_that_it_has_a_version_number
5
5
  refute_nil ::<%= config[:constant_name] %>::VERSION
6
6
  end
@@ -57,7 +57,7 @@ module Bundler
57
57
 
58
58
  def trace(e, newline = nil)
59
59
  return unless debug?
60
- msg = ["#{e.class}: #{e.message}", *e.backtrace].join("\n")
60
+ msg = "#{e.class}: #{e.message}\n#{e.backtrace.join("\n ")}"
61
61
  tell_me(msg, nil, newline)
62
62
  end
63
63
 
@@ -2,5 +2,5 @@ module Bundler
2
2
  # We're doing this because we might write tests that deal
3
3
  # with other versions of bundler and we are unsure how to
4
4
  # handle this better.
5
- VERSION = "1.7.15" unless defined?(::Bundler::VERSION)
5
+ VERSION = "1.8.0.pre" unless defined?(::Bundler::VERSION)
6
6
  end
@@ -0,0 +1,73 @@
1
+ require 'thread'
2
+
3
+ module Bundler
4
+ class Worker
5
+ POISON = Object.new
6
+
7
+ class WrappedException < StandardError
8
+ attr_reader :exception
9
+ def initialize(exn)
10
+ @exception = exn
11
+ end
12
+ end
13
+
14
+ # Creates a worker pool of specified size
15
+ #
16
+ # @param size [Integer] Size of pool
17
+ # @param func [Proc] job to run in inside the worker pool
18
+ def initialize(size, func)
19
+ @request_queue = Queue.new
20
+ @response_queue = Queue.new
21
+ @func = func
22
+ @threads = size.times.map { |i| Thread.start { process_queue(i) } }
23
+ trap("INT") { abort_threads }
24
+ end
25
+
26
+ # Enqueue a request to be executed in the worker pool
27
+ #
28
+ # @param obj [String] mostly it is name of spec that should be downloaded
29
+ def enq(obj)
30
+ @request_queue.enq obj
31
+ end
32
+
33
+ # Retrieves results of job function being executed in worker pool
34
+ def deq
35
+ result = @response_queue.deq
36
+ raise result.exception if result.is_a?(WrappedException)
37
+ result
38
+ end
39
+
40
+ def stop
41
+ stop_threads
42
+ end
43
+
44
+ private
45
+
46
+ def process_queue(i)
47
+ loop do
48
+ obj = @request_queue.deq
49
+ break if obj.equal? POISON
50
+ @response_queue.enq apply_func(obj, i)
51
+ end
52
+ end
53
+
54
+ def apply_func(obj, i)
55
+ @func.call(obj, i)
56
+ rescue Exception => e
57
+ WrappedException.new(e)
58
+ end
59
+
60
+ # Stop the worker threads by sending a poison object down the request queue
61
+ # so as worker threads after retrieving it, shut themselves down
62
+ def stop_threads
63
+ @threads.each { @request_queue.enq POISON }
64
+ @threads.each { |thread| thread.join }
65
+ end
66
+
67
+ def abort_threads
68
+ @threads.each {|i| i.exit }
69
+ exit 1
70
+ end
71
+
72
+ end
73
+ end
@@ -70,6 +70,10 @@ The canonical form of this configuration is `"without"`. To convert the canonica
70
70
  form to the environment variable form, capitalize it, and prepend `BUNDLE_`. The
71
71
  environment variable form of `"without"` is `BUNDLE_WITHOUT`.
72
72
 
73
+ Any periods in the configuration keys must be replaced with two underscores when
74
+ setting it via environment variables. The configuration key `local.rack` becomes
75
+ the environment variable `BUNDLE_LOCAL__RACK`.
76
+
73
77
  ## LIST OF AVAILABLE KEYS
74
78
 
75
79
  The following is a list of all configuration keys and their purpose. You can
@@ -77,7 +81,7 @@ learn more about their operation in [bundle install(1)][bundle-install].
77
81
 
78
82
  * `path` (`BUNDLE_PATH`):
79
83
  The location on disk to install gems. Defaults to `$GEM_HOME` in development
80
- and `vendor/bundler` when `--deployment` is used
84
+ and `vendor/bundle` when `--deployment` is used
81
85
  * `frozen` (`BUNDLE_FROZEN`):
82
86
  Disallow changes to the `Gemfile`. Defaults to `true` when `--deployment`
83
87
  is used.
@@ -86,6 +90,12 @@ learn more about their operation in [bundle install(1)][bundle-install].
86
90
  * `bin` (`BUNDLE_BIN`):
87
91
  Install executables from gems in the bundle to the specified directory.
88
92
  Defaults to `false`.
93
+ * `gemfile` (`BUNDLE_GEMFILE`):
94
+ The name of the file that bundler should use as the `Gemfile`. This location
95
+ of this file also sets the root of the project, which is used to resolve
96
+ relative paths in the `Gemfile`, among other things. By default, bundler
97
+ will search up from the current working directory until it finds a
98
+ `Gemfile`.
89
99
  * `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
90
100
  Path to a designated CA certificate file or folder containing multiple
91
101
  certificates for trusted CAs in PEM format.
@@ -100,18 +110,6 @@ You can set them globally either via environment variables or `bundle config`,
100
110
  whichever is preferable for your setup. If you use both, environment variables
101
111
  will take preference over global settings.
102
112
 
103
- An additional setting is available only as an environment variable:
104
-
105
- * `BUNDLE_GEMFILE`:
106
- The name of the file that bundler should use as the `Gemfile`. This location
107
- of this file also sets the root of the project, which is used to resolve
108
- relative paths in the `Gemfile`, among other things. By default, bundler
109
- will search up from the current working directory until it finds a
110
- `Gemfile`.
111
-
112
- Bundler will ignore any `BUNDLE_GEMFILE` entries in local or global
113
- configuration files.
114
-
115
113
  ## LOCAL GIT REPOS
116
114
 
117
115
  Bundler also allows you to work against a git repository locally
@@ -162,9 +160,13 @@ For example, to use a mirror of rubygems.org hosted at
162
160
  Bundler allows you to configure credentials for any gem source, which allows
163
161
  you to avoid putting secrets into your Gemfile.
164
162
 
165
- bundle config SOURCE_URL USERNAME:PASSWORD
163
+ bundle config SOURCE_HOSTNAME USERNAME:PASSWORD
166
164
 
167
165
  For example, to save the credentials of user `claudette` for the gem source at
168
166
  `gems.longerous.com`, you would run:
169
167
 
170
- bundle config https://gems.longerous.com/ claudette:s00pers3krit
168
+ bundle config gems.longerous.com claudette:s00pers3krit
169
+
170
+ Or you can set the credentials as an environment variable like this:
171
+
172
+ export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
@@ -3,128 +3,137 @@ bundle-install(1) -- Install the dependencies specified in your Gemfile
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `bundle install` [--gemfile=GEMFILE]
7
- [--path PATH] [--system]
8
- [--without=GROUP1[ GROUP2...]]
9
- [--local] [--deployment]
10
- [--binstubs[=DIRECTORY]]
11
- [--standalone[=GROUP1[ GROUP2...]]]
12
- [--trust-policy=POLICY]
13
- [--jobs=SIZE]
14
- [--retry=TRIES]
15
- [--no-cache]
16
- [--quiet]
6
+ `bundle install` [--binstubs[=DIRECTORY]]
17
7
  [--clean]
18
8
  [--full-index]
9
+ [--gemfile=GEMFILE]
10
+ [--jobs=NUMBER]
11
+ [--local] [--deployment]
12
+ [--no-cache]
19
13
  [--no-prune]
14
+ [--path PATH] [--system]
15
+ [--quiet]
16
+ [--retry=NUMBER]
20
17
  [--shebang]
18
+ [--standalone[=GROUP[ GROUP...]]]
19
+ [--trust-policy=POLICY]
20
+ [--without=GROUP[ GROUP...]]
21
21
 
22
22
  ## DESCRIPTION
23
23
 
24
24
  Install the gems specified in your Gemfile(5). If this is the first
25
25
  time you run bundle install (and a `Gemfile.lock` does not exist),
26
- bundler will fetch all remote sources, resolve dependencies and
26
+ Bundler will fetch all remote sources, resolve dependencies and
27
27
  install all needed gems.
28
28
 
29
29
  If a `Gemfile.lock` does exist, and you have not updated your Gemfile(5),
30
- bundler will fetch all remote sources, but use the dependencies
30
+ Bundler will fetch all remote sources, but use the dependencies
31
31
  specified in the `Gemfile.lock` instead of resolving dependencies.
32
32
 
33
33
  If a `Gemfile.lock` does exist, and you have updated your Gemfile(5),
34
- bundler will use the dependencies in the `Gemfile.lock` for all gems
34
+ Bundler will use the dependencies in the `Gemfile.lock` for all gems
35
35
  that you did not update, but will re-resolve the dependencies of
36
36
  gems that you did update. You can find more information about this
37
37
  update process below under [CONSERVATIVE UPDATING][].
38
38
 
39
39
  ## OPTIONS
40
40
 
41
- * `--gemfile=<gemfile>`:
42
- The location of the Gemfile(5) that bundler should use. This defaults
43
- to a gemfile in the current working directory. In general, bundler
44
- will assume that the location of the Gemfile(5) is also the project
45
- root, and will look for the `Gemfile.lock` and `vendor/cache` relative
46
- to it.
41
+ * `--binstubs[=<directory>]`:
42
+ Creates a directory (defaults to `~/bin`) and place any executables from the
43
+ gem there. These executables run in Bundler's context. If used, you might add
44
+ this directory to your environment's `PATH` variable. For instance, if the
45
+ `rails` gem comes with a `rails` executable, this flag will create a
46
+ `bin/rails` executable that ensures that all referred dependencies will be
47
+ resolved using the bundled gems.
47
48
 
48
- * `--path=<path>`:
49
- The location to install the gems in the bundle to. This defaults to
50
- Rubygems' gem home, which is also the default location where `gem
51
- install` installs gems. This means that, by default, gems installed
52
- without a `--path` setting will show up in `gem list`. This setting is
53
- a [remembered option][REMEMBERED OPTIONS].
49
+ * `--clean`:
50
+ On finishing the installation Bundler is going to remove any gems not present
51
+ in the current Gemfile(5). Don't worry, gems currently in use will not be
52
+ removed.
54
53
 
55
- * `--system`:
56
- Installs the gems in the bundle to the system location. This
57
- overrides any previous [remembered][REMEMBERED OPTIONS] use of
58
- `--path`.
54
+ * `--full-index`:
55
+ Bundler will not call Rubygems' API endpoint (default) but download and cache
56
+ a (currently big) index file of all gems. Performance can be improved for
57
+ large bundles that seldomly change by enabling this option.
59
58
 
60
- * `--without=<list>`:
61
- A space-separated list of groups to skip installing. This is a
62
- [remembered option][REMEMBERED OPTIONS].
59
+ * `--gemfile=<gemfile>`:
60
+ The location of the Gemfile(5) which Bundler should use. This defaults
61
+ to a Gemfile(5) in the current working directory. In general, Bundler
62
+ will assume that the location of the Gemfile(5) is also the project's
63
+ root and will try to find `Gemfile.lock` and `vendor/cache` relative
64
+ to this location.
65
+
66
+ * `--jobs=[<number>]`:
67
+ Install gems by starting <number> of workers parallely.
63
68
 
64
69
  * `--local`:
65
- Do not attempt to connect to `rubygems.org`, instead using just
66
- the gems already present in Rubygems' cache or in `vendor/cache`.
67
- Note that if a more appropriate platform-specific gem exists on
68
- `rubygems.org`, it will not be found.
70
+ Do not attempt to connect to `rubygems.org`. Instead, Bundler will use the
71
+ gems already present in Rubygems' cache or in `vendor/cache`. Note that if a
72
+ appropriate platform-specific gem exists on `rubygems.org` it will not be
73
+ found.
69
74
 
70
75
  * `--deployment`:
71
- Switches bundler's defaults into [deployment mode][DEPLOYMENT MODE].
72
- Do not use this flag on development machines.
76
+ In [deployment mode][DEPLOYMENT MODE], Bundler will 'roll-out' the bundle for
77
+ `production` use. Please check carefully if you want to have this option
78
+ enabled in `development` or `test` environments.
73
79
 
74
- * `--binstubs[=<directory>]`:
75
- Create a directory (defaults to `bin`) containing an executable
76
- that runs in the context of the bundle. For instance, if the
77
- `rails` gem comes with a `rails` executable, this flag will create
78
- a `bin/rails` executable that ensures that all dependencies used
79
- come from the bundled gems.
80
+ * `--system`:
81
+ Installs the gems specified in the bundle to the system's Rubygems location.
82
+ This overrides any previous [remembered][REMEMBERED OPTIONS] use of `--path`.
80
83
 
81
- * `--shebang ruby-install-name`:
82
- Uses the ruby executable (usually `ruby`) provided to execute the scripts created
83
- with --binstubs. For instance, if you use --binstubs with `--shebang jruby`,
84
- all executables will be created to use jruby instead.
84
+ * `--no-cache`:
85
+ Do not update the cache in `vendor/cache` with the newly bundled gems. This
86
+ does not remove any gems in the cache but keeps the newly bundled gems from
87
+ being cached during the install.
85
88
 
86
- * `--standalone[=<list>]`:
87
- Make a bundle that can work without Ruby Gems or Bundler at runtime.
88
- It takes a space separated list of groups to install. It creates a
89
- `bundle` directory and installs the bundle there. It also generates
90
- a `bundle/bundler/setup.rb` file to replace Bundler's own setup.
89
+ * `--no-prune`:
90
+ Don't remove stale gems from the cache when the installation finishes.
91
91
 
92
- * `--trust-policy=[<policy>]`:
93
- Apply the Rubygems security policy named <policy>, where policy is one of
94
- HighSecurity, MediumSecurity, LowSecurity, AlmostNoSecurity, or NoSecurity.
95
- For more detail, see the Rubygems signing documentation, linked below in
96
- [SEE ALSO][].
92
+ * `--path=<path>`:
93
+ The location to install the specified gems to. This defaults to Rubygems'
94
+ setting. Bundler shares this location with Rubygems, `gem install ...` will
95
+ have gem installed there, too. Therefore, gems installed without a
96
+ `--path ...` setting will show up by calling `gem list`. Accodingly, gems
97
+ installed to other locations will not get listed. This setting is a
98
+ [remembered option][REMEMBERED OPTIONS].
97
99
 
98
- * `--jobs=[<size>]`:
99
- Install gems parallely by starting <size> number of parallel workers.
100
+ * `--quiet`:
101
+ Do not print progress information to the standard output. Instead, Bundler
102
+ will exit using a status code (`$?`).
100
103
 
101
- * `--retry[<tries]`:
102
- Retries failed network or git requests <tries> times.
104
+ * `--retry=[<number>]`:
105
+ Retry failed network or git requests for <number> times.
103
106
 
104
- * `--no-cache`:
105
- Do not update the cache in `vendor/cache` with the newly bundled gems. This
106
- does not remove any existing cached gems, only stops the newly bundled gems
107
- from being cached during the install.
107
+ * `--shebang=<ruby-executable>`:
108
+ Uses the specified ruby executable (usually `ruby`) to execute the scripts
109
+ created with `--binstubs`. In addition, if you use `--binstubs` together with
110
+ `--shebang jruby` these executables will be changed to execute `jruby`
111
+ instead.
108
112
 
109
- * `--quiet`:
110
- Do not print progress information to stdout. Instead, communicate the
111
- success of the install operation via exit status code.
113
+ * `--standalone[=<list>]`:
114
+ Makes a bundle that can work without depending on Rubygems or Bundler at
115
+ runtime. A space separated list of groups to install has to be specified.
116
+ Bundler creates a directory named `bundle` and installs the bundle there. It
117
+ also generates a `bundle/bundler/setup.rb` file to replace Bundler's own setup
118
+ in the manner required.
112
119
 
113
- * `--clean`:
114
- Run bundle clean automatically after install.
120
+ * `--trust-policy=[<policy>]`:
121
+ Apply the Rubygems security policy <policy>, where policy is one of
122
+ `HighSecurity`, `MediumSecurity`, `LowSecurity`, `AlmostNoSecurity`, or
123
+ `NoSecurity`. For more details, please see the Rubygems signing documentation
124
+ linked below in [SEE ALSO][].
115
125
 
116
- * `--full-index`:
117
- Use the rubygems modern index instead of the API endpoint.
126
+ * `--without=<list>`:
127
+ A space-separated list of groups referencing gems to skip during installation.
128
+ This is a [remembered option][REMEMBERED OPTIONS].
118
129
 
119
- * `--no-prune`:
120
- Don't remove stale gems from the cache.
121
130
 
122
131
  ## DEPLOYMENT MODE
123
132
 
124
133
  Bundler's defaults are optimized for development. To switch to
125
134
  defaults optimized for deployment, use the `--deployment` flag.
126
135
  Do not activate deployment mode on development machines, as it
127
- will cause in an error when the Gemfile is modified.
136
+ will cause an error when the Gemfile(5) is modified.
128
137
 
129
138
  1. A `Gemfile.lock` is required.
130
139
 
@@ -161,10 +170,10 @@ will cause in an error when the Gemfile is modified.
161
170
 
162
171
  ## SUDO USAGE
163
172
 
164
- By default, bundler installs gems to the same location as `gem install`.
173
+ By default, Bundler installs gems to the same location as `gem install`.
165
174
 
166
175
  In some cases, that location may not be writable by your Unix user. In
167
- that case, bundler will stage everything in a temporary directory,
176
+ that case, Bundler will stage everything in a temporary directory,
168
177
  then ask you for your `sudo` password in order to copy the gems into
169
178
  their system location.
170
179
 
@@ -185,7 +194,7 @@ the current user. Therefore, git gems are downloaded and installed
185
194
  into `~/.bundle` rather than $GEM_HOME or $BUNDLE_PATH.
186
195
 
187
196
  As a result, you should run `bundle install` as the current user,
188
- and bundler will ask for your password if it is needed to put the
197
+ and Bundler will ask for your password if it is needed to put the
189
198
  gems into their final location.
190
199
 
191
200
  ## INSTALLING GROUPS
@@ -193,7 +202,7 @@ gems into their final location.
193
202
  By default, `bundle install` will install all gems in all groups
194
203
  in your Gemfile(5), except those declared for a different platform.
195
204
 
196
- However, you can explicitly tell bundler to skip installing
205
+ However, you can explicitly tell Bundler to skip installing
197
206
  certain groups with the `--without` option. This option takes
198
207
  a space-separated list of groups.
199
208
 
@@ -214,21 +223,21 @@ third-party code being used in different environments.`
214
223
 
215
224
  For a simple illustration, consider the following Gemfile(5):
216
225
 
217
- source "https://rubygems.org"
226
+ source 'https://rubygems.org'
218
227
 
219
- gem "sinatra"
228
+ gem 'sinatra'
220
229
 
221
230
  group :production do
222
- gem "rack-perftools-profiler"
231
+ gem 'rack-perftools-profiler'
223
232
  end
224
233
 
225
- In this case, `sinatra` depends on any version of Rack (`>= 1.0`, while
234
+ In this case, `sinatra` depends on any version of Rack (`>= 1.0`), while
226
235
  `rack-perftools-profiler` depends on 1.x (`~> 1.0`).
227
236
 
228
237
  When you run `bundle install --without production` in development, we
229
238
  look at the dependencies of `rack-perftools-profiler` as well. That way,
230
239
  you do not spend all your time developing against Rack 2.0, using new
231
- APIs unavailable in Rack 1.x, only to have bundler switch to Rack 1.2
240
+ APIs unavailable in Rack 1.x, only to have Bundler switch to Rack 1.2
232
241
  when the `production` group _is_ used.
233
242
 
234
243
  This should not cause any problems in practice, because we do not
@@ -310,10 +319,10 @@ same versions of all dependencies as it used before the update.
310
319
 
311
320
  Let's take a look at an example. Here's your original Gemfile(5):
312
321
 
313
- source "https://rubygems.org"
322
+ source 'https://rubygems.org'
314
323
 
315
- gem "actionpack", "2.3.8"
316
- gem "activemerchant"
324
+ gem 'actionpack', '2.3.8'
325
+ gem 'activemerchant'
317
326
 
318
327
  In this case, both `actionpack` and `activemerchant` depend on
319
328
  `activesupport`. The `actionpack` gem depends on `activesupport 2.3.8`
@@ -326,10 +335,10 @@ gems in your Gemfile(5).
326
335
 
327
336
  Next, you modify your Gemfile(5) to:
328
337
 
329
- source "https://rubygems.org"
338
+ source 'https://rubygems.org'
330
339
 
331
- gem "actionpack", "3.0.0.rc"
332
- gem "activemerchant"
340
+ gem 'actionpack', '3.0.0.rc'
341
+ gem 'activemerchant'
333
342
 
334
343
  The `actionpack 3.0.0.rc` gem has a number of new dependencies,
335
344
  and updates the `activesupport` dependency to `= 3.0.0.rc` and
@@ -351,7 +360,7 @@ you would not expect it to suddenly stop working after updating
351
360
  dependency of actionpack requires updating one of its dependencies.
352
361
 
353
362
  Even though `activemerchant` declares a very loose dependency
354
- that theoretically matches `activesupport 3.0.0.rc`, bundler treats
363
+ that theoretically matches `activesupport 3.0.0.rc`, Bundler treats
355
364
  gems in your Gemfile(5) that have not changed as an atomic unit
356
365
  together with their dependencies. In this case, the `activemerchant`
357
366
  dependency is treated as `activemerchant 1.7.1 + activesupport 2.3.8`,