shopify-bundler 1.10.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +16 -0
  3. data/.rspec +3 -0
  4. data/.rubocop.yml +96 -0
  5. data/.rubocop_todo.yml +177 -0
  6. data/.travis.yml +104 -0
  7. data/CHANGELOG.md +2131 -0
  8. data/CODE_OF_CONDUCT.md +42 -0
  9. data/CONTRIBUTING.md +32 -0
  10. data/DEVELOPMENT.md +118 -0
  11. data/ISSUES.md +96 -0
  12. data/LICENSE.md +23 -0
  13. data/README.md +40 -0
  14. data/Rakefile +309 -0
  15. data/bin/rake +14 -0
  16. data/bin/rspec +10 -0
  17. data/bin/rubocop +11 -0
  18. data/bundler.gemspec +34 -0
  19. data/exe/bundle +21 -0
  20. data/exe/bundle_ruby +60 -0
  21. data/exe/bundler +21 -0
  22. data/lib/bundler.rb +499 -0
  23. data/lib/bundler/capistrano.rb +16 -0
  24. data/lib/bundler/cli.rb +435 -0
  25. data/lib/bundler/cli/binstubs.rb +37 -0
  26. data/lib/bundler/cli/cache.rb +34 -0
  27. data/lib/bundler/cli/check.rb +37 -0
  28. data/lib/bundler/cli/clean.rb +25 -0
  29. data/lib/bundler/cli/common.rb +56 -0
  30. data/lib/bundler/cli/config.rb +88 -0
  31. data/lib/bundler/cli/console.rb +37 -0
  32. data/lib/bundler/cli/exec.rb +51 -0
  33. data/lib/bundler/cli/gem.rb +208 -0
  34. data/lib/bundler/cli/init.rb +32 -0
  35. data/lib/bundler/cli/inject.rb +32 -0
  36. data/lib/bundler/cli/install.rb +188 -0
  37. data/lib/bundler/cli/lock.rb +35 -0
  38. data/lib/bundler/cli/open.rb +22 -0
  39. data/lib/bundler/cli/outdated.rb +86 -0
  40. data/lib/bundler/cli/package.rb +45 -0
  41. data/lib/bundler/cli/platform.rb +42 -0
  42. data/lib/bundler/cli/show.rb +74 -0
  43. data/lib/bundler/cli/update.rb +72 -0
  44. data/lib/bundler/cli/viz.rb +26 -0
  45. data/lib/bundler/constants.rb +5 -0
  46. data/lib/bundler/current_ruby.rb +218 -0
  47. data/lib/bundler/definition.rb +675 -0
  48. data/lib/bundler/dep_proxy.rb +45 -0
  49. data/lib/bundler/dependency.rb +119 -0
  50. data/lib/bundler/deployment.rb +62 -0
  51. data/lib/bundler/deprecate.rb +17 -0
  52. data/lib/bundler/dsl.rb +478 -0
  53. data/lib/bundler/endpoint_specification.rb +100 -0
  54. data/lib/bundler/env.rb +82 -0
  55. data/lib/bundler/environment.rb +41 -0
  56. data/lib/bundler/fetcher.rb +288 -0
  57. data/lib/bundler/fetcher/base.rb +26 -0
  58. data/lib/bundler/fetcher/dependency.rb +88 -0
  59. data/lib/bundler/fetcher/downloader.rb +60 -0
  60. data/lib/bundler/fetcher/index.rb +32 -0
  61. data/lib/bundler/friendly_errors.rb +92 -0
  62. data/lib/bundler/gem_helper.rb +191 -0
  63. data/lib/bundler/gem_helpers.rb +26 -0
  64. data/lib/bundler/gem_installer.rb +9 -0
  65. data/lib/bundler/gem_path_manipulation.rb +8 -0
  66. data/lib/bundler/gem_tasks.rb +5 -0
  67. data/lib/bundler/graph.rb +173 -0
  68. data/lib/bundler/index.rb +199 -0
  69. data/lib/bundler/injector.rb +62 -0
  70. data/lib/bundler/inline.rb +58 -0
  71. data/lib/bundler/installer.rb +242 -0
  72. data/lib/bundler/installer/parallel_installer.rb +122 -0
  73. data/lib/bundler/installer/standalone.rb +48 -0
  74. data/lib/bundler/lazy_specification.rb +82 -0
  75. data/lib/bundler/lockfile_parser.rb +199 -0
  76. data/lib/bundler/match_platform.rb +13 -0
  77. data/lib/bundler/psyched_yaml.rb +26 -0
  78. data/lib/bundler/remote_specification.rb +82 -0
  79. data/lib/bundler/resolver.rb +350 -0
  80. data/lib/bundler/retry.rb +60 -0
  81. data/lib/bundler/ruby_dsl.rb +11 -0
  82. data/lib/bundler/ruby_version.rb +116 -0
  83. data/lib/bundler/rubygems_ext.rb +175 -0
  84. data/lib/bundler/rubygems_integration.rb +674 -0
  85. data/lib/bundler/runtime.rb +285 -0
  86. data/lib/bundler/settings.rb +263 -0
  87. data/lib/bundler/setup.rb +26 -0
  88. data/lib/bundler/shared_helpers.rb +176 -0
  89. data/lib/bundler/similarity_detector.rb +61 -0
  90. data/lib/bundler/source.rb +35 -0
  91. data/lib/bundler/source/git.rb +286 -0
  92. data/lib/bundler/source/git/git_proxy.rb +190 -0
  93. data/lib/bundler/source/path.rb +224 -0
  94. data/lib/bundler/source/path/installer.rb +43 -0
  95. data/lib/bundler/source/rubygems.rb +436 -0
  96. data/lib/bundler/source/rubygems/remote.rb +38 -0
  97. data/lib/bundler/source_list.rb +101 -0
  98. data/lib/bundler/spec_set.rb +156 -0
  99. data/lib/bundler/ssl_certs/.document +1 -0
  100. data/lib/bundler/ssl_certs/AddTrustExternalCARoot-2048.pem +25 -0
  101. data/lib/bundler/ssl_certs/AddTrustExternalCARoot.pem +32 -0
  102. data/lib/bundler/ssl_certs/Class3PublicPrimaryCertificationAuthority.pem +14 -0
  103. data/lib/bundler/ssl_certs/DigiCertHighAssuranceEVRootCA.pem +23 -0
  104. data/lib/bundler/ssl_certs/EntrustnetSecureServerCertificationAuthority.pem +28 -0
  105. data/lib/bundler/ssl_certs/GeoTrustGlobalCA.pem +20 -0
  106. data/lib/bundler/ssl_certs/certificate_manager.rb +64 -0
  107. data/lib/bundler/stub_specification.rb +23 -0
  108. data/lib/bundler/templates/Executable +16 -0
  109. data/lib/bundler/templates/Executable.standalone +12 -0
  110. data/lib/bundler/templates/Gemfile +4 -0
  111. data/lib/bundler/templates/newgem/.travis.yml.tt +4 -0
  112. data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +22 -0
  113. data/lib/bundler/templates/newgem/Gemfile.tt +4 -0
  114. data/lib/bundler/templates/newgem/LICENSE.txt.tt +21 -0
  115. data/lib/bundler/templates/newgem/README.md.tt +41 -0
  116. data/lib/bundler/templates/newgem/Rakefile.tt +29 -0
  117. data/lib/bundler/templates/newgem/bin/console.tt +14 -0
  118. data/lib/bundler/templates/newgem/bin/setup.tt +8 -0
  119. data/lib/bundler/templates/newgem/exe/newgem.tt +3 -0
  120. data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +3 -0
  121. data/lib/bundler/templates/newgem/ext/newgem/newgem.c.tt +9 -0
  122. data/lib/bundler/templates/newgem/ext/newgem/newgem.h.tt +6 -0
  123. data/lib/bundler/templates/newgem/gitignore.tt +16 -0
  124. data/lib/bundler/templates/newgem/lib/newgem.rb.tt +12 -0
  125. data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +7 -0
  126. data/lib/bundler/templates/newgem/newgem.gemspec.tt +43 -0
  127. data/lib/bundler/templates/newgem/rspec.tt +2 -0
  128. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +11 -0
  129. data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
  130. data/lib/bundler/templates/newgem/test/newgem_test.rb.tt +11 -0
  131. data/lib/bundler/templates/newgem/test/test_helper.rb.tt +4 -0
  132. data/lib/bundler/ui.rb +7 -0
  133. data/lib/bundler/ui/rg_proxy.rb +17 -0
  134. data/lib/bundler/ui/shell.rb +108 -0
  135. data/lib/bundler/ui/silent.rb +44 -0
  136. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +5 -0
  137. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +277 -0
  138. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -0
  139. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +3 -0
  140. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +99 -0
  141. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +63 -0
  142. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +434 -0
  143. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +43 -0
  144. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +51 -0
  145. data/lib/bundler/vendor/net/http/faster.rb +26 -0
  146. data/lib/bundler/vendor/net/http/persistent.rb +1230 -0
  147. data/lib/bundler/vendor/net/http/persistent/ssl_reuse.rb +128 -0
  148. data/lib/bundler/vendor/thor/lib/thor.rb +484 -0
  149. data/lib/bundler/vendor/thor/lib/thor/actions.rb +319 -0
  150. data/lib/bundler/vendor/thor/lib/thor/actions/create_file.rb +103 -0
  151. data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +59 -0
  152. data/lib/bundler/vendor/thor/lib/thor/actions/directory.rb +118 -0
  153. data/lib/bundler/vendor/thor/lib/thor/actions/empty_directory.rb +135 -0
  154. data/lib/bundler/vendor/thor/lib/thor/actions/file_manipulation.rb +316 -0
  155. data/lib/bundler/vendor/thor/lib/thor/actions/inject_into_file.rb +107 -0
  156. data/lib/bundler/vendor/thor/lib/thor/base.rb +656 -0
  157. data/lib/bundler/vendor/thor/lib/thor/command.rb +133 -0
  158. data/lib/bundler/vendor/thor/lib/thor/core_ext/hash_with_indifferent_access.rb +77 -0
  159. data/lib/bundler/vendor/thor/lib/thor/core_ext/io_binary_read.rb +10 -0
  160. data/lib/bundler/vendor/thor/lib/thor/core_ext/ordered_hash.rb +98 -0
  161. data/lib/bundler/vendor/thor/lib/thor/error.rb +32 -0
  162. data/lib/bundler/vendor/thor/lib/thor/group.rb +281 -0
  163. data/lib/bundler/vendor/thor/lib/thor/invocation.rb +178 -0
  164. data/lib/bundler/vendor/thor/lib/thor/line_editor.rb +17 -0
  165. data/lib/bundler/vendor/thor/lib/thor/line_editor/basic.rb +35 -0
  166. data/lib/bundler/vendor/thor/lib/thor/line_editor/readline.rb +88 -0
  167. data/lib/bundler/vendor/thor/lib/thor/parser.rb +4 -0
  168. data/lib/bundler/vendor/thor/lib/thor/parser/argument.rb +73 -0
  169. data/lib/bundler/vendor/thor/lib/thor/parser/arguments.rb +175 -0
  170. data/lib/bundler/vendor/thor/lib/thor/parser/option.rb +125 -0
  171. data/lib/bundler/vendor/thor/lib/thor/parser/options.rb +218 -0
  172. data/lib/bundler/vendor/thor/lib/thor/rake_compat.rb +71 -0
  173. data/lib/bundler/vendor/thor/lib/thor/runner.rb +322 -0
  174. data/lib/bundler/vendor/thor/lib/thor/shell.rb +81 -0
  175. data/lib/bundler/vendor/thor/lib/thor/shell/basic.rb +421 -0
  176. data/lib/bundler/vendor/thor/lib/thor/shell/color.rb +149 -0
  177. data/lib/bundler/vendor/thor/lib/thor/shell/html.rb +126 -0
  178. data/lib/bundler/vendor/thor/lib/thor/util.rb +267 -0
  179. data/lib/bundler/vendor/thor/lib/thor/version.rb +3 -0
  180. data/lib/bundler/vendored_molinillo.rb +2 -0
  181. data/lib/bundler/vendored_persistent.rb +11 -0
  182. data/lib/bundler/vendored_thor.rb +3 -0
  183. data/lib/bundler/version.rb +6 -0
  184. data/lib/bundler/vlad.rb +11 -0
  185. data/lib/bundler/worker.rb +72 -0
  186. data/man/bundle-config.ronn +187 -0
  187. data/man/bundle-exec.ronn +136 -0
  188. data/man/bundle-gem.ronn +77 -0
  189. data/man/bundle-install.ronn +398 -0
  190. data/man/bundle-package.ronn +66 -0
  191. data/man/bundle-platform.ronn +42 -0
  192. data/man/bundle-update.ronn +188 -0
  193. data/man/bundle.ronn +98 -0
  194. data/man/gemfile.5.ronn +495 -0
  195. data/man/index.txt +8 -0
  196. metadata +346 -0
@@ -0,0 +1,3 @@
1
+ class Bundler::Thor
2
+ VERSION = "0.19.1"
3
+ end
@@ -0,0 +1,2 @@
1
+ module Bundler; end
2
+ require "bundler/vendor/molinillo/lib/molinillo"
@@ -0,0 +1,11 @@
1
+ # We forcibly require OpenSSL, because net/http/persistent will only autoload
2
+ # it. On some Rubies, autoload fails but explicit require succeeds.
3
+ begin
4
+ require "openssl"
5
+ rescue LoadError
6
+ # some Ruby builds don't have OpenSSL
7
+ end
8
+
9
+ vendor = File.expand_path("../vendor", __FILE__)
10
+ $:.unshift(vendor) unless $:.include?(vendor)
11
+ require "net/http/persistent"
@@ -0,0 +1,3 @@
1
+ module Bundler; end
2
+ require "bundler/vendor/thor/lib/thor"
3
+ require "bundler/vendor/thor/lib/thor/actions"
@@ -0,0 +1,6 @@
1
+ module Bundler
2
+ # We're doing this because we might write tests that deal
3
+ # with other versions of bundler and we are unsure how to
4
+ # handle this better.
5
+ VERSION = "1.10.7" unless defined?(::Bundler::VERSION)
6
+ end
@@ -0,0 +1,11 @@
1
+ # Vlad task for Bundler.
2
+ #
3
+ # Just add "require 'bundler/vlad'" in your Vlad deploy.rb, and
4
+ # include the vlad:bundle:install task in your vlad:deploy task.
5
+ require "bundler/deployment"
6
+
7
+ include Rake::DSL if defined? Rake::DSL
8
+
9
+ namespace :vlad do
10
+ Bundler::Deployment.define_task(Rake::RemoteTask, :remote_task, :roles => :app)
11
+ end
@@ -0,0 +1,72 @@
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(&:join)
65
+ end
66
+
67
+ def abort_threads
68
+ @threads.each(&:exit)
69
+ exit 1
70
+ end
71
+ end
72
+ end
@@ -0,0 +1,187 @@
1
+ bundle-config(1) -- Set bundler configuration options
2
+ =====================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bundle config` [<name> [<value>]]
7
+
8
+ ## DESCRIPTION
9
+
10
+ This command allows you to interact with bundler's configuration system.
11
+ Bundler retrieves its configuration from the local application (`app/.bundle/config`),
12
+ environment variables, and the user's home directory (`~/.bundle/config`),
13
+ in that order of priority.
14
+
15
+ Executing `bundle config` with no parameters will print a list of all
16
+ bundler configuration for the current bundle, and where that configuration
17
+ was set.
18
+
19
+ Executing `bundle config <name>` will print the value of that configuration
20
+ setting, and where it was set.
21
+
22
+ Executing `bundle config <name> <value>` will set that configuration to the
23
+ value specified for all bundles executed as the current user. The configuration
24
+ will be stored in `~/.bundle/config`. If <name> already is set, <name> will be
25
+ overridden and user will be warned.
26
+
27
+ Executing `bundle config --global <name> <value>` works the same as above.
28
+
29
+ Executing `bundle config --local <name> <value>` will set that configuration to
30
+ the local application. The configuration will be stored in `app/.bundle/config`.
31
+
32
+ Executing `bundle config --delete <name>` will delete the configuration in both
33
+ local and global sources. Not compatible with --global or --local flag.
34
+
35
+ Executing bundle with the `BUNDLE_IGNORE_CONFIG` environment variable set will
36
+ cause it to ignore all configuration.
37
+
38
+ Executing `bundle config disable_multisource true` upgrades the warning about
39
+ the Gemfile containing multiple primary sources to an error. Executing `bundle
40
+ config --delete disable_multisource` downgrades this error to a warning.
41
+
42
+ ## BUILD OPTIONS
43
+
44
+ You can use `bundle config` to give bundler the flags to pass to the gem
45
+ installer every time bundler tries to install a particular gem.
46
+
47
+ A very common example, the `mysql` gem, requires Snow Leopard users to
48
+ pass configuration flags to `gem install` to specify where to find the
49
+ `mysql_config` executable.
50
+
51
+ gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
52
+
53
+ Since the specific location of that executable can change from machine
54
+ to machine, you can specify these flags on a per-machine basis.
55
+
56
+ bundle config build.mysql --with-mysql-config=/usr/local/mysql/bin/mysql_config
57
+
58
+ After running this command, every time bundler needs to install the
59
+ `mysql` gem, it will pass along the flags you specified.
60
+
61
+ ## CONFIGURATION KEYS
62
+
63
+ Configuration keys in bundler have two forms: the canonical form and the
64
+ environment variable form.
65
+
66
+ For instance, passing the `--without` flag to [bundle install(1)][bundle-install]
67
+ prevents Bundler from installing certain groups specified in the Gemfile(5). Bundler
68
+ persists this value in `app/.bundle/config` so that calls to `Bundler.setup`
69
+ do not try to find gems from the `Gemfile` that you didn't install. Additionally,
70
+ subsequent calls to [bundle install(1)][bundle-install] remember this setting and skip those
71
+ groups.
72
+
73
+ The canonical form of this configuration is `"without"`. To convert the canonical
74
+ form to the environment variable form, capitalize it, and prepend `BUNDLE_`. The
75
+ environment variable form of `"without"` is `BUNDLE_WITHOUT`.
76
+
77
+ Any periods in the configuration keys must be replaced with two underscores when
78
+ setting it via environment variables. The configuration key `local.rack` becomes
79
+ the environment variable `BUNDLE_LOCAL__RACK`.
80
+
81
+ ## LIST OF AVAILABLE KEYS
82
+
83
+ The following is a list of all configuration keys and their purpose. You can
84
+ learn more about their operation in [bundle install(1)][bundle-install].
85
+
86
+ * `path` (`BUNDLE_PATH`):
87
+ The location on disk where all gems in your bundle will be located regardless
88
+ of `$GEM_HOME` or `$GEM_PATH` values. Bundle gems not found in this location
89
+ will be installed by `bundle install`. Defaults to `Gem.dir`. When --deployment is
90
+ used, defaults to vendor/bundle.
91
+ * `frozen` (`BUNDLE_FROZEN`):
92
+ Disallow changes to the `Gemfile`. Defaults to `true` when `--deployment`
93
+ is used.
94
+ * `without` (`BUNDLE_WITHOUT`):
95
+ A `:`-separated list of groups whose gems bundler should not install
96
+ * `bin` (`BUNDLE_BIN`):
97
+ Install executables from gems in the bundle to the specified directory.
98
+ Defaults to `false`.
99
+ * `gemfile` (`BUNDLE_GEMFILE`):
100
+ The name of the file that bundler should use as the `Gemfile`. This location
101
+ of this file also sets the root of the project, which is used to resolve
102
+ relative paths in the `Gemfile`, among other things. By default, bundler
103
+ will search up from the current working directory until it finds a
104
+ `Gemfile`.
105
+ * `ssl_ca_cert` (`BUNDLE_SSL_CA_CERT`):
106
+ Path to a designated CA certificate file or folder containing multiple
107
+ certificates for trusted CAs in PEM format.
108
+ * `ssl_client_cert` (`BUNDLE_SSL_CLIENT_CERT`):
109
+ Path to a designated file containing a X.509 client certificate
110
+ and key in PEM format.
111
+ * `cache_path` (`BUNDLE_CACHE_PATH`): The directory that bundler will place
112
+ cached gems in when running <code>bundle package</code>, and that bundler
113
+ will look in when installing gems.
114
+ * `disable_multisource` (`BUNDLE_DISABLE_MULTISOURCE`): When set, Gemfiles
115
+ containing multiple sources will produce errors instead of warnings. Use
116
+ `bundle config --delete disable_multisource` to unset.
117
+ * `ignore_messages` (`BUNDLE_IGNORE_MESSAGES`): When set, no post install
118
+ messages will be printed. To silence a single gem, use dot notation like
119
+ `ignore_messages.httparty true`.
120
+
121
+ In general, you should set these settings per-application by using the applicable
122
+ flag to the [bundle install(1)][bundle-install] or [bundle package(1)][bundle-package] command.
123
+
124
+ You can set them globally either via environment variables or `bundle config`,
125
+ whichever is preferable for your setup. If you use both, environment variables
126
+ will take preference over global settings.
127
+
128
+ ## LOCAL GIT REPOS
129
+
130
+ Bundler also allows you to work against a git repository locally
131
+ instead of using the remote version. This can be achieved by setting
132
+ up a local override:
133
+
134
+ bundle config local.GEM_NAME /path/to/local/git/repository
135
+
136
+ For example, in order to use a local Rack repository, a developer could call:
137
+
138
+ bundle config local.rack ~/Work/git/rack
139
+
140
+ Now instead of checking out the remote git repository, the local
141
+ override will be used. Similar to a path source, every time the local
142
+ git repository change, changes will be automatically picked up by
143
+ Bundler. This means a commit in the local git repo will update the
144
+ revision in the `Gemfile.lock` to the local git repo revision. This
145
+ requires the same attention as git submodules. Before pushing to
146
+ the remote, you need to ensure the local override was pushed, otherwise
147
+ you may point to a commit that only exists in your local machine.
148
+
149
+ Bundler does many checks to ensure a developer won't work with
150
+ invalid references. Particularly, we force a developer to specify
151
+ a branch in the `Gemfile` in order to use this feature. If the branch
152
+ specified in the `Gemfile` and the current branch in the local git
153
+ repository do not match, Bundler will abort. This ensures that
154
+ a developer is always working against the correct branches, and prevents
155
+ accidental locking to a different branch.
156
+
157
+ Finally, Bundler also ensures that the current revision in the
158
+ `Gemfile.lock` exists in the local git repository. By doing this, Bundler
159
+ forces you to fetch the latest changes in the remotes.
160
+
161
+ ## MIRRORS OF GEM SOURCES
162
+
163
+ Bundler supports overriding gem sources with mirrors. This allows you to
164
+ configure rubygems.org as the gem source in your Gemfile while still using your
165
+ mirror to fetch gems.
166
+
167
+ bundle config mirror.SOURCE_URL MIRROR_URL
168
+
169
+ For example, to use a mirror of rubygems.org hosted at
170
+
171
+ bundle config mirror.http://rubygems.org http://rubygems-mirror.org
172
+
173
+ ## CREDENTIALS FOR GEM SOURCES
174
+
175
+ Bundler allows you to configure credentials for any gem source, which allows
176
+ you to avoid putting secrets into your Gemfile.
177
+
178
+ bundle config SOURCE_HOSTNAME USERNAME:PASSWORD
179
+
180
+ For example, to save the credentials of user `claudette` for the gem source at
181
+ `gems.longerous.com`, you would run:
182
+
183
+ bundle config gems.longerous.com claudette:s00pers3krit
184
+
185
+ Or you can set the credentials as an environment variable like this:
186
+
187
+ export BUNDLE_GEMS__LONGEROUS__COM="claudette:s00pers3krit"
@@ -0,0 +1,136 @@
1
+ bundle-exec(1) -- Execute a command in the context of the bundle
2
+ ================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bundle exec` [--keep-file-descriptors] <command>
7
+
8
+ ## DESCRIPTION
9
+
10
+ This command executes the command, making all gems specified in the
11
+ `Gemfile(5)` available to `require` in Ruby programs.
12
+
13
+ Essentially, if you would normally have run something like
14
+ `rspec spec/my_spec.rb`, and you want to use the gems specified
15
+ in the `Gemfile(5)` and installed via [bundle install(1)][bundle-install], you
16
+ should run `bundle exec rspec spec/my_spec.rb`.
17
+
18
+ Note that `bundle exec` does not require that an executable is
19
+ available on your shell's `$PATH`.
20
+
21
+ ## OPTIONS
22
+
23
+ * `--keep-file-descriptors`:
24
+ Exec in Ruby 2.0 began discarding non-standard file descriptors. When this
25
+ flag is passed, exec will revert to the 1.9 behaviour of passing all file
26
+ descriptors to the new process.
27
+
28
+ ## BUNDLE INSTALL --BINSTUBS
29
+
30
+ If you use the `--binstubs` flag in [bundle install(1)][bundle-install], Bundler will
31
+ automatically create a directory (which defaults to `app_root/bin`)
32
+ containing all of the executables available from gems in the bundle.
33
+
34
+ After using `--binstubs`, `bin/rspec spec/my_spec.rb` is identical
35
+ to `bundle exec rspec spec/my_spec.rb`.
36
+
37
+ ## ENVIRONMENT MODIFICATIONS
38
+
39
+ `bundle exec` makes a number of changes to the shell environment,
40
+ then executes the command you specify in full.
41
+
42
+ * make sure that it's still possible to shell out to `bundle`
43
+ from inside a command invoked by `bundle exec` (using
44
+ `$BUNDLE_BIN_PATH`)
45
+ * put the directory containing executables (like `rails`, `rspec`,
46
+ `rackup`) for your bundle on `$PATH`
47
+ * make sure that if bundler is invoked in the subshell, it uses
48
+ the same `Gemfile` (by setting `BUNDLE_GEMFILE`)
49
+ * add `-rbundler/setup` to `$RUBYOPT`, which makes sure that
50
+ Ruby programs invoked in the subshell can see the gems in
51
+ the bundle
52
+
53
+ It also modifies Rubygems:
54
+
55
+ * disallow loading additional gems not in the bundle
56
+ * modify the `gem` method to be a no-op if a gem matching
57
+ the requirements is in the bundle, and to raise a
58
+ `Gem::LoadError` if it's not
59
+ * Define `Gem.refresh` to be a no-op, since the source
60
+ index is always frozen when using bundler, and to
61
+ prevent gems from the system leaking into the environment
62
+ * Override `Gem.bin_path` to use the gems in the bundle,
63
+ making system executables work
64
+ * Add all gems in the bundle into Gem.loaded_specs
65
+
66
+ ### Shelling out
67
+
68
+ Any Ruby code that opens a subshell (like `system`, backticks, or `%x{}`) will
69
+ automatically use the current Bundler environment. If you need to shell out to
70
+ a Ruby command that is not part of your current bundle, use the
71
+ `with_clean_env` method with a block. Any subshells created inside the block
72
+ will be given the environment present before Bundler was activated. For
73
+ example, Homebrew commands run Ruby, but don't work inside a bundle:
74
+
75
+ Bundler.with_clean_env do
76
+ `brew install wget`
77
+ end
78
+
79
+ Using `with_clean_env` is also necessary if you are shelling out to a different
80
+ bundle. Any Bundler commands run in a subshell will inherit the current
81
+ Gemfile, so commands that need to run in the context of a different bundle also
82
+ need to use `with_clean_env`.
83
+
84
+ Bundler.with_clean_env do
85
+ Dir.chdir "/other/bundler/project" do
86
+ `bundle exec ./script`
87
+ end
88
+ end
89
+
90
+ Bundler provides convenience helpers that wrap `system` and `exec`, and they
91
+ can be used like this:
92
+
93
+ Bundler.clean_system('brew install wget')
94
+ Bundler.clean_exec('brew install wget')
95
+
96
+
97
+ ## RUBYGEMS PLUGINS
98
+
99
+ At present, the Rubygems plugin system requires all files
100
+ named `rubygems_plugin.rb` on the load path of _any_ installed
101
+ gem when any Ruby code requires `rubygems.rb`. This includes
102
+ executables installed into the system, like `rails`, `rackup`,
103
+ and `rspec`.
104
+
105
+ Since Rubygems plugins can contain arbitrary Ruby code, they
106
+ commonly end up activating themselves or their dependencies.
107
+
108
+ For instance, the `gemcutter 0.5` gem depended on `json_pure`.
109
+ If you had that version of gemcutter installed (even if
110
+ you _also_ had a newer version without this problem), Rubygems
111
+ would activate `gemcutter 0.5` and `json_pure <latest>`.
112
+
113
+ If your Gemfile(5) also contained `json_pure` (or a gem
114
+ with a dependency on `json_pure`), the latest version on
115
+ your system might conflict with the version in your
116
+ Gemfile(5), or the snapshot version in your `Gemfile.lock`.
117
+
118
+ If this happens, bundler will say:
119
+
120
+ You have already activated json_pure 1.4.6 but your Gemfile
121
+ requires json_pure 1.4.3. Consider using bundle exec.
122
+
123
+ In this situation, you almost certainly want to remove the
124
+ underlying gem with the problematic gem plugin. In general,
125
+ the authors of these plugins (in this case, the `gemcutter`
126
+ gem) have released newer versions that are more careful in
127
+ their plugins.
128
+
129
+ You can find a list of all the gems containing gem plugins
130
+ by running
131
+
132
+ ruby -rubygems -e "puts Gem.find_files('rubygems_plugin.rb')"
133
+
134
+ At the very least, you should remove all but the newest
135
+ version of each gem plugin, and also remove all gem plugins
136
+ that you aren't using (`gem uninstall gem_name`).
@@ -0,0 +1,77 @@
1
+ bundle-gem(1) -- Generate a project skeleton for creating a rubygem
2
+ ====================================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `bundle gem` <GEM_NAME> [OPTIONS]
7
+
8
+ ## DESCRIPTION
9
+
10
+ Generates a directory named `GEM_NAME` with a `Rakefile`, `GEM_NAME.gemspec`,
11
+ and other supporting files and directories that can be used to develop a
12
+ rubygem with that name.
13
+
14
+ Run `rake -T` in the resulting project for a list of Rake tasks that can used
15
+ to test and publish the gem to rubygems.org.
16
+
17
+ The generated project skeleton can be customized with OPTIONS, as explained
18
+ below. Note that these options can also be specified via Bundler's global
19
+ configuration file using the following names:
20
+
21
+ * `gem.coc`
22
+ * `gem.mit`
23
+ * `gem.test`
24
+
25
+ ## OPTIONS
26
+
27
+ * `-b` or `--bin`:
28
+ Specify that Bundler should create a binary (as `exe/GEM_NAME`) in the
29
+ generated rubygem project. This binary will also be added to the
30
+ `GEM_NAME.gemspec` manifest. This behavior is disabled by default.
31
+
32
+ * `--no-bin`:
33
+ Do not create a binary (overrides `--bin` specified in the global config).
34
+
35
+ * `--coc`:
36
+ Add a `CODE_OF_CONDUCT.md` file to the root of the generated project. If
37
+ this option is unspecified, an interactive prompt will be displayed and the
38
+ answer will be saved in Bundler's global config for future `bundle gem` use.
39
+
40
+ * `--no-coc`:
41
+ Do not create a `CODE_OF_CONDUCT.md` (overrides `--coc` specified in the
42
+ global config).
43
+
44
+ * `--ext`:
45
+ Add boilerplate for C extension code to the generated project. This behavior
46
+ is disabled by default.
47
+
48
+ * `--no-ext`:
49
+ Do not add C extension code (overrides `--ext` specified in the global
50
+ config).
51
+
52
+ * `--mit`:
53
+ Add an MIT license to a `LICENSE.txt` file in the root of the generated
54
+ project. Your name from the global git config is used for the copyright
55
+ statement. If this option is unspecified, an interactive prompt will be
56
+ displayed and the answer will be saved in Bundler's global config for future
57
+ `bundle gem` use.
58
+
59
+ * `--no-mit`:
60
+ Do not create a `LICENSE.txt` (overrides `--mit` specified in the global
61
+ config).
62
+
63
+ * `-t`, `--test=minitest`, `--test=rspec`:
64
+ Specify the test framework that Bundler should use when generating the
65
+ project. Acceptable values are `minitest` and `rspec`. The `GEM_NAME.gemspec`
66
+ will be configured and a skeleton test/spec directory will be created based
67
+ on this option. If this option is unspecified, an interactive prompt will be
68
+ displayed and the answer will be saved in Bundler's global config for future
69
+ `bundle gem` use.
70
+
71
+ * `-e`, `--edit[=EDITOR]`:
72
+ Open the resulting GEM_NAME.gemspec in EDITOR, or the default editor if not
73
+ specified. The default is `$BUNDLER_EDITOR`, `$VISUAL`, or `$EDITOR`.
74
+
75
+ ## SEE ALSO
76
+
77
+ * bundle-config(1)