bundler 1.15.4 → 1.16.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 (251) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +43 -0
  3. data/README.md +12 -7
  4. data/exe/bundle +1 -1
  5. data/exe/bundle_ruby +4 -3
  6. data/lib/bundler.rb +47 -37
  7. data/lib/bundler/build_metadata.rb +38 -0
  8. data/lib/bundler/capistrano.rb +5 -0
  9. data/lib/bundler/cli.rb +155 -67
  10. data/lib/bundler/cli/add.rb +0 -1
  11. data/lib/bundler/cli/binstubs.rb +9 -7
  12. data/lib/bundler/cli/cache.rb +5 -4
  13. data/lib/bundler/cli/check.rb +3 -5
  14. data/lib/bundler/cli/clean.rb +5 -6
  15. data/lib/bundler/cli/common.rb +11 -2
  16. data/lib/bundler/cli/config.rb +2 -1
  17. data/lib/bundler/cli/console.rb +2 -1
  18. data/lib/bundler/cli/doctor.rb +1 -0
  19. data/lib/bundler/cli/exec.rb +2 -1
  20. data/lib/bundler/cli/gem.rb +3 -2
  21. data/lib/bundler/cli/info.rb +0 -1
  22. data/lib/bundler/cli/init.rb +17 -6
  23. data/lib/bundler/cli/inject.rb +1 -0
  24. data/lib/bundler/cli/install.rb +61 -61
  25. data/lib/bundler/cli/issue.rb +1 -1
  26. data/lib/bundler/cli/list.rb +22 -0
  27. data/lib/bundler/cli/lock.rb +0 -1
  28. data/lib/bundler/cli/open.rb +2 -2
  29. data/lib/bundler/cli/outdated.rb +13 -8
  30. data/lib/bundler/cli/package.rb +9 -6
  31. data/lib/bundler/cli/platform.rb +1 -0
  32. data/lib/bundler/cli/plugin.rb +1 -0
  33. data/lib/bundler/cli/pristine.rb +9 -2
  34. data/lib/bundler/cli/show.rb +0 -1
  35. data/lib/bundler/cli/update.rb +31 -5
  36. data/lib/bundler/cli/viz.rb +1 -0
  37. data/lib/bundler/compact_index_client.rb +1 -0
  38. data/lib/bundler/compact_index_client/cache.rb +1 -0
  39. data/lib/bundler/compact_index_client/updater.rb +3 -2
  40. data/lib/bundler/compatibility_guard.rb +14 -0
  41. data/lib/bundler/constants.rb +1 -0
  42. data/lib/bundler/current_ruby.rb +5 -4
  43. data/lib/bundler/definition.rb +140 -95
  44. data/lib/bundler/dep_proxy.rb +2 -0
  45. data/lib/bundler/dependency.rb +6 -7
  46. data/lib/bundler/deployment.rb +1 -1
  47. data/lib/bundler/deprecate.rb +1 -0
  48. data/lib/bundler/dsl.rb +97 -62
  49. data/lib/bundler/endpoint_specification.rb +9 -0
  50. data/lib/bundler/env.rb +63 -27
  51. data/lib/bundler/environment_preserver.rb +26 -6
  52. data/lib/bundler/errors.rb +1 -0
  53. data/lib/bundler/feature_flag.rb +39 -4
  54. data/lib/bundler/fetcher.rb +15 -8
  55. data/lib/bundler/fetcher/base.rb +1 -0
  56. data/lib/bundler/fetcher/compact_index.rb +2 -11
  57. data/lib/bundler/fetcher/dependency.rb +1 -0
  58. data/lib/bundler/fetcher/downloader.rb +1 -0
  59. data/lib/bundler/fetcher/index.rb +1 -0
  60. data/lib/bundler/friendly_errors.rb +2 -1
  61. data/lib/bundler/gem_helper.rb +14 -9
  62. data/lib/bundler/gem_helpers.rb +1 -0
  63. data/lib/bundler/gem_remote_fetcher.rb +1 -0
  64. data/lib/bundler/gem_tasks.rb +1 -0
  65. data/lib/bundler/gem_version_promoter.rb +1 -0
  66. data/lib/bundler/gemdeps.rb +1 -0
  67. data/lib/bundler/graph.rb +1 -0
  68. data/lib/bundler/index.rb +15 -8
  69. data/lib/bundler/injector.rb +25 -22
  70. data/lib/bundler/inline.rb +5 -7
  71. data/lib/bundler/installer.rb +93 -45
  72. data/lib/bundler/installer/gem_installer.rb +2 -0
  73. data/lib/bundler/installer/parallel_installer.rb +73 -42
  74. data/lib/bundler/installer/standalone.rb +1 -0
  75. data/lib/bundler/lazy_specification.rb +2 -1
  76. data/lib/bundler/lockfile_generator.rb +95 -0
  77. data/lib/bundler/lockfile_parser.rb +10 -4
  78. data/lib/bundler/match_platform.rb +1 -0
  79. data/lib/bundler/mirror.rb +6 -3
  80. data/lib/bundler/plugin.rb +1 -0
  81. data/lib/bundler/plugin/api/source.rb +8 -0
  82. data/lib/bundler/plugin/installer.rb +7 -6
  83. data/lib/bundler/plugin/source_list.rb +7 -8
  84. data/lib/bundler/process_lock.rb +24 -0
  85. data/lib/bundler/psyched_yaml.rb +1 -0
  86. data/lib/bundler/remote_specification.rb +1 -0
  87. data/lib/bundler/resolver.rb +138 -191
  88. data/lib/bundler/resolver/spec_group.rb +111 -0
  89. data/lib/bundler/retry.rb +1 -0
  90. data/lib/bundler/ruby_dsl.rb +1 -0
  91. data/lib/bundler/ruby_version.rb +1 -0
  92. data/lib/bundler/rubygems_ext.rb +5 -4
  93. data/lib/bundler/rubygems_gem_installer.rb +23 -0
  94. data/lib/bundler/rubygems_integration.rb +56 -27
  95. data/lib/bundler/runtime.rb +3 -5
  96. data/lib/bundler/settings.rb +177 -76
  97. data/lib/bundler/settings/validator.rb +79 -0
  98. data/lib/bundler/setup.rb +1 -0
  99. data/lib/bundler/shared_helpers.rb +86 -26
  100. data/lib/bundler/similarity_detector.rb +1 -0
  101. data/lib/bundler/source.rb +32 -0
  102. data/lib/bundler/source/gemspec.rb +1 -0
  103. data/lib/bundler/source/git.rb +21 -16
  104. data/lib/bundler/source/git/git_proxy.rb +14 -10
  105. data/lib/bundler/source/metadata.rb +63 -0
  106. data/lib/bundler/source/path.rb +8 -8
  107. data/lib/bundler/source/path/installer.rb +2 -0
  108. data/lib/bundler/source/rubygems.rb +131 -84
  109. data/lib/bundler/source/rubygems/remote.rb +3 -0
  110. data/lib/bundler/source_list.rb +75 -15
  111. data/lib/bundler/spec_set.rb +2 -1
  112. data/lib/bundler/ssl_certs/certificate_manager.rb +2 -1
  113. data/lib/bundler/stub_specification.rb +1 -0
  114. data/lib/bundler/templates/Executable +4 -0
  115. data/lib/bundler/templates/Executable.bundler +105 -0
  116. data/lib/bundler/templates/Gemfile +1 -0
  117. data/lib/bundler/templates/gems.rb +8 -0
  118. data/lib/bundler/templates/newgem/README.md.tt +1 -1
  119. data/lib/bundler/templates/newgem/gitignore.tt +0 -1
  120. data/lib/bundler/templates/newgem/newgem.gemspec.tt +4 -1
  121. data/lib/bundler/templates/newgem/rspec.tt +1 -0
  122. data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +0 -2
  123. data/lib/bundler/ui.rb +1 -0
  124. data/lib/bundler/ui/rg_proxy.rb +1 -0
  125. data/lib/bundler/ui/shell.rb +15 -4
  126. data/lib/bundler/ui/silent.rb +1 -0
  127. data/lib/bundler/uri_credentials_filter.rb +1 -0
  128. data/lib/bundler/vendor/fileutils/lib/fileutils.rb +1638 -0
  129. data/lib/bundler/vendor/molinillo/lib/molinillo.rb +2 -0
  130. data/lib/bundler/vendor/molinillo/lib/molinillo/compatibility.rb +26 -0
  131. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/resolution_state.rb +7 -0
  132. data/lib/bundler/vendor/molinillo/lib/molinillo/delegates/specification_provider.rb +1 -0
  133. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph.rb +3 -2
  134. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/action.rb +1 -0
  135. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_edge_no_circular.rb +1 -0
  136. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/add_vertex.rb +1 -0
  137. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/delete_edge.rb +1 -0
  138. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/detach_vertex_named.rb +1 -0
  139. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/log.rb +1 -0
  140. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/set_payload.rb +1 -0
  141. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/tag.rb +1 -0
  142. data/lib/bundler/vendor/molinillo/lib/molinillo/dependency_graph/vertex.rb +3 -2
  143. data/lib/bundler/vendor/molinillo/lib/molinillo/errors.rb +69 -6
  144. data/lib/bundler/vendor/molinillo/lib/molinillo/gem_metadata.rb +2 -1
  145. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/specification_provider.rb +1 -0
  146. data/lib/bundler/vendor/molinillo/lib/molinillo/modules/ui.rb +3 -1
  147. data/lib/bundler/vendor/molinillo/lib/molinillo/resolution.rb +487 -148
  148. data/lib/bundler/vendor/molinillo/lib/molinillo/resolver.rb +1 -0
  149. data/lib/bundler/vendor/molinillo/lib/molinillo/state.rb +8 -4
  150. data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +1 -1
  151. data/lib/bundler/vendored_fileutils.rb +9 -0
  152. data/lib/bundler/vendored_molinillo.rb +1 -0
  153. data/lib/bundler/vendored_persistent.rb +34 -0
  154. data/lib/bundler/vendored_thor.rb +1 -0
  155. data/lib/bundler/version.rb +6 -2
  156. data/lib/bundler/version_ranges.rb +1 -0
  157. data/lib/bundler/vlad.rb +5 -0
  158. data/lib/bundler/worker.rb +1 -0
  159. data/lib/bundler/yaml_serializer.rb +3 -3
  160. data/man/bundle-add.1 +43 -0
  161. data/man/bundle-add.1.txt +40 -0
  162. data/man/bundle-binstubs.1 +40 -0
  163. data/man/bundle-binstubs.1.txt +48 -0
  164. data/man/bundle-binstubs.ronn +14 -0
  165. data/man/bundle-check.1 +31 -0
  166. data/man/bundle-check.1.txt +32 -0
  167. data/man/bundle-clean.1 +24 -0
  168. data/man/bundle-clean.1.txt +26 -0
  169. data/man/bundle-config.1 +455 -0
  170. data/man/bundle-config.1.txt +491 -0
  171. data/man/bundle-config.ronn +133 -79
  172. data/man/bundle-exec.1 +165 -0
  173. data/man/bundle-exec.1.txt +178 -0
  174. data/man/bundle-exec.ronn +7 -0
  175. data/man/bundle-gem.1 +80 -0
  176. data/man/bundle-gem.1.txt +91 -0
  177. data/man/bundle-gem.ronn +2 -1
  178. data/man/bundle-info.1 +20 -0
  179. data/man/bundle-info.1.txt +21 -0
  180. data/man/bundle-init.1 +20 -0
  181. data/man/bundle-init.1.txt +24 -0
  182. data/man/bundle-inject.1 +33 -0
  183. data/man/bundle-inject.1.txt +32 -0
  184. data/man/bundle-install.1 +305 -0
  185. data/man/bundle-install.1.txt +385 -0
  186. data/man/bundle-install.ronn +32 -32
  187. data/man/bundle-list.1 +20 -0
  188. data/man/bundle-list.1.txt +21 -0
  189. data/man/bundle-list.ronn +15 -0
  190. data/man/bundle-lock.1 +84 -0
  191. data/man/bundle-lock.1.txt +93 -0
  192. data/man/bundle-open.1 +32 -0
  193. data/man/bundle-open.1.txt +29 -0
  194. data/man/bundle-outdated.1 +151 -0
  195. data/man/bundle-outdated.1.txt +127 -0
  196. data/man/bundle-outdated.ronn +1 -1
  197. data/man/bundle-package.1 +55 -0
  198. data/man/bundle-package.1.txt +79 -0
  199. data/man/bundle-package.ronn +5 -0
  200. data/man/bundle-platform.1 +61 -0
  201. data/man/bundle-platform.1.txt +57 -0
  202. data/man/bundle-pristine.1 +34 -0
  203. data/man/bundle-pristine.1.txt +44 -0
  204. data/man/bundle-pristine.ronn +24 -3
  205. data/man/bundle-show.1 +23 -0
  206. data/man/bundle-show.1.txt +25 -0
  207. data/man/bundle-update.1 +390 -0
  208. data/man/bundle-update.1.txt +386 -0
  209. data/man/bundle-update.ronn +2 -2
  210. data/man/bundle-viz.1 +39 -0
  211. data/man/bundle-viz.1.txt +38 -0
  212. data/man/bundle-viz.ronn +5 -5
  213. data/man/bundle.1 +132 -0
  214. data/man/bundle.1.txt +113 -0
  215. data/man/bundle.ronn +5 -2
  216. data/man/gemfile.5 +679 -0
  217. data/man/gemfile.5.ronn +31 -0
  218. data/man/gemfile.5.txt +636 -0
  219. data/man/index.txt +23 -0
  220. metadata +21 -36
  221. data/.codeclimate.yml +0 -25
  222. data/.gitignore +0 -18
  223. data/.rspec +0 -3
  224. data/.rubocop.yml +0 -131
  225. data/.rubocop_todo.yml +0 -418
  226. data/.travis.yml +0 -122
  227. data/CODE_OF_CONDUCT.md +0 -42
  228. data/CONTRIBUTING.md +0 -17
  229. data/Rakefile +0 -338
  230. data/bin/rake +0 -19
  231. data/bin/rspec +0 -15
  232. data/bin/rubocop +0 -17
  233. data/bin/with_rubygems +0 -39
  234. data/bundler.gemspec +0 -48
  235. data/doc/README.md +0 -30
  236. data/doc/TROUBLESHOOTING.md +0 -64
  237. data/doc/contributing/BUG_TRIAGE.md +0 -36
  238. data/doc/contributing/COMMUNITY.md +0 -13
  239. data/doc/contributing/GETTING_HELP.md +0 -11
  240. data/doc/contributing/HOW_YOU_CAN_HELP.md +0 -27
  241. data/doc/contributing/ISSUES.md +0 -51
  242. data/doc/contributing/README.md +0 -38
  243. data/doc/development/NEW_FEATURES.md +0 -10
  244. data/doc/development/PULL_REQUESTS.md +0 -40
  245. data/doc/development/README.md +0 -19
  246. data/doc/development/RELEASING.md +0 -9
  247. data/doc/development/SETUP.md +0 -27
  248. data/doc/documentation/README.md +0 -29
  249. data/doc/documentation/VISION.md +0 -26
  250. data/doc/documentation/WRITING.md +0 -54
  251. data/task/release.rake +0 -116
@@ -69,6 +69,22 @@ the Ruby version that the engine is compatible with.
69
69
  Each application _may_ specify a Ruby engine. If an engine is specified, an
70
70
  engine version _must_ also be specified.
71
71
 
72
+ What exactly is an Engine?
73
+ - A Ruby engine is an implementation of the Ruby language.
74
+
75
+ - For background: the reference or original implementation of the Ruby
76
+ programming language is called
77
+ [Matz's Ruby Interpreter](https://en.wikipedia.org/wiki/Ruby_MRI), or MRI
78
+ for short. This is named after Ruby creator Yukihiro Matsumoto,
79
+ also known as Matz. MRI is also known as CRuby, because it is written in C.
80
+ MRI is the most widely used Ruby engine.
81
+
82
+ - [Other implementations](https://www.ruby-lang.org/en/about/) of Ruby exist.
83
+ Some of the more well-known implementations include
84
+ [Rubinius](https://rubinius.com/), and [JRuby](http://jruby.org/).
85
+ Rubinius is an alternative implementation of Ruby written in Ruby.
86
+ JRuby is an implementation of Ruby on the JVM, short for Java Virtual Machine.
87
+
72
88
  ### ENGINE VERSION
73
89
 
74
90
  Each application _may_ specify a Ruby engine version. If an engine version is
@@ -287,7 +303,17 @@ Git repositories support a number of additional options.
287
303
  * `branch`, `tag`, and `ref`:
288
304
  You `MUST` only specify at most one of these options. The default
289
305
  is `:branch => "master"`
306
+ * For example:
307
+
308
+ git "https://github.com/rails/rails.git", :branch => "5-0-stable" do
309
+
310
+ git "https://github.com/rails/rails.git", :tag => "v5.0.0" do
311
+
312
+ git "https://github.com/rails/rails.git", :ref => "4aded" do
313
+
290
314
  * `submodules`:
315
+ For reference, a [git submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules)
316
+ lets you have another git repository within a subfolder of your repository.
291
317
  Specify `:submodules => true` to cause bundler to expand any
292
318
  submodules included in the git repository
293
319
 
@@ -439,6 +465,11 @@ software is installed or some other conditions are met.
439
465
 
440
466
  ## GEMSPEC
441
467
 
468
+ The [.gemspec](http://guides.rubygems.org/specification-reference/) file is where
469
+ you provide metadata about your gem to Rubygems. Some required Gemspec
470
+ attributes include the name, description, and homepage of your gem. This is
471
+ also where you specify the dependencies your gem needs to run.
472
+
442
473
  If you wish to use Bundler to help install dependencies for a gem while it is
443
474
  being developed, use the `gemspec` method to pull in the dependencies listed in
444
475
  the `.gemspec` file.
@@ -0,0 +1,636 @@
1
+ GEMFILE(5) GEMFILE(5)
2
+
3
+
4
+
5
+ 1mNAME0m
6
+ 1mGemfile 22m- A format for describing gem dependencies for Ruby programs
7
+
8
+ 1mSYNOPSIS0m
9
+ A 1mGemfile 22mdescribes the gem dependencies required to execute associated
10
+ Ruby code.
11
+
12
+ Place the 1mGemfile 22min the root of the directory containing the associ-
13
+ ated code. For instance, in a Rails application, place the 1mGemfile 22min
14
+ the same directory as the 1mRakefile22m.
15
+
16
+ 1mSYNTAX0m
17
+ A 1mGemfile 22mis evaluated as Ruby code, in a context which makes available
18
+ a number of methods used to describe the gem requirements.
19
+
20
+ 1mGLOBAL SOURCES0m
21
+ At the top of the 1mGemfile22m, add a line for the 1mRubygems 22msource that con-
22
+ tains the gems listed in the 1mGemfile22m.
23
+
24
+
25
+
26
+ source "https://rubygems.org"
27
+
28
+
29
+
30
+ It is possible, but not recommended as of Bundler 1.7, to add multiple
31
+ global 1msource 22mlines. Each of these 1msource22ms 1mMUST 22mbe a valid Rubygems
32
+ repository.
33
+
34
+ Sources are checked for gems following the heuristics described in
35
+ 4mSOURCE24m 4mPRIORITY24m. If a gem is found in more than one global source,
36
+ Bundler will print a warning after installing the gem indicating which
37
+ source was used, and listing the other sources where the gem is avail-
38
+ able. A specific source can be selected for gems that need to use a
39
+ non-standard repository, suppressing this warning, by using the 1m:source0m
40
+ option or a 1msource 22mblock.
41
+
42
+ 1mCREDENTIALS0m
43
+ Some gem sources require a username and password. Use [bundle con-
44
+ fig(1)][bundle-config] to set the username and password for any of the
45
+ sources that need it. The command must be run once on each computer
46
+ that will install the Gemfile, but this keeps the credentials from
47
+ being stored in plain text in version control.
48
+
49
+
50
+
51
+ bundle config gems.example.com user:password
52
+
53
+
54
+
55
+ For some sources, like a company Gemfury account, it may be easier to
56
+ include the credentials in the Gemfile as part of the source URL.
57
+
58
+
59
+
60
+ source "https://user:password@gems.example.com"
61
+
62
+
63
+
64
+ Credentials in the source URL will take precedence over credentials set
65
+ using 1mconfig22m.
66
+
67
+ 1mRUBY0m
68
+ If your application requires a specific Ruby version or engine, specify
69
+ your requirements using the 1mruby 22mmethod, with the following arguments.
70
+ All parameters are 1mOPTIONAL 22munless otherwise specified.
71
+
72
+ 1mVERSION (required)0m
73
+ The version of Ruby that your application requires. If your application
74
+ requires an alternate Ruby engine, such as JRuby or Rubinius, this
75
+ should be the Ruby version that the engine is compatible with.
76
+
77
+
78
+
79
+ ruby "1.9.3"
80
+
81
+
82
+
83
+ 1mENGINE0m
84
+ Each application 4mmay24m specify a Ruby engine. If an engine is specified,
85
+ an engine version 4mmust24m also be specified.
86
+
87
+ What exactly is an Engine? - A Ruby engine is an implementation of the
88
+ Ruby language.
89
+
90
+ o For background: the reference or original implementation of the
91
+ Ruby programming language is called Matz's Ruby Interpreter
92
+ 4mhttps://en.wikipedia.org/wiki/Ruby_MRI24m, or MRI for short. This is
93
+ named after Ruby creator Yukihiro Matsumoto, also known as Matz.
94
+ MRI is also known as CRuby, because it is written in C. MRI is the
95
+ most widely used Ruby engine.
96
+
97
+ o Other implementations 4mhttps://www.ruby-lang.org/en/about/24m of Ruby
98
+ exist. Some of the more well-known implementations include Rubinius
99
+ 4mhttps://rubinius.com/24m, and JRuby 4mhttp://jruby.org/24m. Rubinius is an
100
+ alternative implementation of Ruby written in Ruby. JRuby is an
101
+ implementation of Ruby on the JVM, short for Java Virtual Machine.
102
+
103
+
104
+
105
+ 1mENGINE VERSION0m
106
+ Each application 4mmay24m specify a Ruby engine version. If an engine ver-
107
+ sion is specified, an engine 4mmust24m also be specified. If the engine is
108
+ "ruby" the engine version specified 4mmust24m match the Ruby version.
109
+
110
+
111
+
112
+ ruby "1.8.7", :engine => "jruby", :engine_version => "1.6.7"
113
+
114
+
115
+
116
+ 1mPATCHLEVEL0m
117
+ Each application 4mmay24m specify a Ruby patchlevel.
118
+
119
+
120
+
121
+ ruby "2.0.0", :patchlevel => "247"
122
+
123
+
124
+
125
+ 1mGEMS0m
126
+ Specify gem requirements using the 1mgem 22mmethod, with the following argu-
127
+ ments. All parameters are 1mOPTIONAL 22munless otherwise specified.
128
+
129
+ 1mNAME (required)0m
130
+ For each gem requirement, list a single 4mgem24m line.
131
+
132
+
133
+
134
+ gem "nokogiri"
135
+
136
+
137
+
138
+ 1mVERSION0m
139
+ Each 4mgem24m 1mMAY 22mhave one or more version specifiers.
140
+
141
+
142
+
143
+ gem "nokogiri", ">= 1.4.2"
144
+ gem "RedCloth", ">= 4.1.0", "< 4.2.0"
145
+
146
+
147
+
148
+ 1mREQUIRE AS0m
149
+ Each 4mgem24m 1mMAY 22mspecify files that should be used when autorequiring via
150
+ 1mBundler.require22m. You may pass an array with multiple files or 1mtrue 22mif
151
+ file you want 1mrequired 22mhas same name as 4mgem24m or 1mfalse 22mto prevent any
152
+ file from being autorequired.
153
+
154
+
155
+
156
+ gem "redis", :require => ["redis/connection/hiredis", "redis"]
157
+ gem "webmock", :require => false
158
+ gem "debugger", :require => true
159
+
160
+
161
+
162
+ The argument defaults to the name of the gem. For example, these are
163
+ identical:
164
+
165
+
166
+
167
+ gem "nokogiri"
168
+ gem "nokogiri", :require => "nokogiri"
169
+ gem "nokogiri", :require => true
170
+
171
+
172
+
173
+ 1mGROUPS0m
174
+ Each 4mgem24m 1mMAY 22mspecify membership in one or more groups. Any 4mgem24m that
175
+ does not specify membership in any group is placed in the 1mdefault0m
176
+ group.
177
+
178
+
179
+
180
+ gem "rspec", :group => :test
181
+ gem "wirble", :groups => [:development, :test]
182
+
183
+
184
+
185
+ The Bundler runtime allows its two main methods, 1mBundler.setup 22mand
186
+ 1mBundler.require22m, to limit their impact to particular groups.
187
+
188
+
189
+
190
+ # setup adds gems to Ruby's load path
191
+ Bundler.setup # defaults to all groups
192
+ require "bundler/setup" # same as Bundler.setup
193
+ Bundler.setup(:default) # only set up the _default_ group
194
+ Bundler.setup(:test) # only set up the _test_ group (but `not` _default_)
195
+ Bundler.setup(:default, :test) # set up the _default_ and _test_ groups, but no others
196
+
197
+ # require requires all of the gems in the specified groups
198
+ Bundler.require # defaults to the _default_ group
199
+ Bundler.require(:default) # identical
200
+ Bundler.require(:default, :test) # requires the _default_ and _test_ groups
201
+ Bundler.require(:test) # requires the _test_ group
202
+
203
+
204
+
205
+ The Bundler CLI allows you to specify a list of groups whose gems 1mbun-0m
206
+ 1mdle install 22mshould not install with the 1m--without 22moption. To specify
207
+ multiple groups to ignore, specify a list of groups separated by spa-
208
+ ces.
209
+
210
+
211
+
212
+ bundle install --without test
213
+ bundle install --without development test
214
+
215
+
216
+
217
+ After running 1mbundle install --without test22m, bundler will remember that
218
+ you excluded the test group in the last installation. The next time you
219
+ run 1mbundle install22m, without any 1m--without option22m, bundler will recall
220
+ it.
221
+
222
+ Also, calling 1mBundler.setup 22mwith no parameters, or calling 1mrequire0m
223
+ 1m"bundler/setup" 22mwill setup all groups except for the ones you excluded
224
+ via 1m--without 22m(since they are not available).
225
+
226
+ Note that on 1mbundle install22m, bundler downloads and evaluates all gems,
227
+ in order to create a single canonical list of all of the required gems
228
+ and their dependencies. This means that you cannot list different ver-
229
+ sions of the same gems in different groups. For more details, see
230
+ Understanding Bundler 4mhttp://bundler.io/rationale.html24m.
231
+
232
+ 1mPLATFORMS0m
233
+ If a gem should only be used in a particular platform or set of plat-
234
+ forms, you can specify them. Platforms are essentially identical to
235
+ groups, except that you do not need to use the 1m--without 22minstall-time
236
+ flag to exclude groups of gems for other platforms.
237
+
238
+ There are a number of 1mGemfile 22mplatforms:
239
+
240
+ 1mruby 22mC Ruby (MRI) or Rubinius, but 1mNOT 22mWindows
241
+
242
+ 1mmri 22mSame as 4mruby24m, but not Rubinius
243
+
244
+ 1mmingw 22mWindows 32 bit 'mingw32' platform (aka RubyInstaller)
245
+
246
+ 1mx64_mingw0m
247
+ Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
248
+
249
+ 1mrbx 22mSame as 4mruby24m, but only Rubinius (not MRI)
250
+
251
+ 1mjruby 22mJRuby
252
+
253
+ 1mmswin 22mWindows
254
+
255
+ You can restrict further by platform and version for all platforms
256
+ 4mexcept24m for 1mrbx22m, 1mjruby22m, and 1mmswin22m.
257
+
258
+ To specify a version in addition to a platform, append the version num-
259
+ ber without the delimiter to the platform. For example, to specify that
260
+ a gem should only be used on platforms with Ruby 2.3, use:
261
+
262
+
263
+
264
+ ruby_23
265
+
266
+
267
+
268
+ The full list of platforms and supported versions includes:
269
+
270
+ 1mruby 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
271
+
272
+ 1mmri 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
273
+
274
+ 1mmingw 22m1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
275
+
276
+ 1mx64_mingw0m
277
+ 2.0, 2.1, 2.2, 2.3, 2.4, 2.5
278
+
279
+ As with groups, you can specify one or more platforms:
280
+
281
+
282
+
283
+ gem "weakling", :platforms => :jruby
284
+ gem "ruby-debug", :platforms => :mri_18
285
+ gem "nokogiri", :platforms => [:mri_18, :jruby]
286
+
287
+
288
+
289
+ All operations involving groups (1mbundle install22m, 1mBundler.setup22m,
290
+ 1mBundler.require22m) behave exactly the same as if any groups not matching
291
+ the current platform were explicitly excluded.
292
+
293
+ 1mSOURCE0m
294
+ You can select an alternate Rubygems repository for a gem using the
295
+ ':source' option.
296
+
297
+
298
+
299
+ gem "some_internal_gem", :source => "https://gems.example.com"
300
+
301
+
302
+
303
+ This forces the gem to be loaded from this source and ignores any
304
+ global sources declared at the top level of the file. If the gem does
305
+ not exist in this source, it will not be installed.
306
+
307
+ Bundler will search for child dependencies of this gem by first looking
308
+ in the source selected for the parent, but if they are not found there,
309
+ it will fall back on global sources using the ordering described in
310
+ 4mSOURCE24m 4mPRIORITY24m.
311
+
312
+ Selecting a specific source repository this way also suppresses the
313
+ ambiguous gem warning described above in 4mGLOBAL24m 4mSOURCES24m 4m(#source)24m.
314
+
315
+ 1mGIT0m
316
+ If necessary, you can specify that a gem is located at a particular git
317
+ repository using the 1m:git 22mparameter. The repository can be accessed via
318
+ several protocols:
319
+
320
+ 1mHTTP(S)0m
321
+ gem "rails", :git => "https://github.com/rails/rails.git"
322
+
323
+ 1mSSH 22mgem "rails", :git => "git@github.com:rails/rails.git"
324
+
325
+ 1mgit 22mgem "rails", :git => "git://github.com/rails/rails.git"
326
+
327
+ If using SSH, the user that you use to run 1mbundle install MUST 22mhave the
328
+ appropriate keys available in their 1m$HOME/.ssh22m.
329
+
330
+ 1mNOTE22m: 1mhttp:// 22mand 1mgit:// 22mURLs should be avoided if at all possible.
331
+ These protocols are unauthenticated, so a man-in-the-middle attacker
332
+ can deliver malicious code and compromise your system. HTTPS and SSH
333
+ are strongly preferred.
334
+
335
+ The 1mgroup22m, 1mplatforms22m, and 1mrequire 22moptions are available and behave
336
+ exactly the same as they would for a normal gem.
337
+
338
+ A git repository 1mSHOULD 22mhave at least one file, at the root of the
339
+ directory containing the gem, with the extension 1m.gemspec22m. This file
340
+ 1mMUST 22mcontain a valid gem specification, as expected by the 1mgem build0m
341
+ command.
342
+
343
+ If a git repository does not have a 1m.gemspec22m, bundler will attempt to
344
+ create one, but it will not contain any dependencies, executables, or C
345
+ extension compilation instructions. As a result, it may fail to prop-
346
+ erly integrate into your application.
347
+
348
+ If a git repository does have a 1m.gemspec 22mfor the gem you attached it
349
+ to, a version specifier, if provided, means that the git repository is
350
+ only valid if the 1m.gemspec 22mspecifies a version matching the version
351
+ specifier. If not, bundler will print a warning.
352
+
353
+
354
+
355
+ gem "rails", "2.3.8", :git => "https://github.com/rails/rails.git"
356
+ # bundle install will fail, because the .gemspec in the rails
357
+ # repository's master branch specifies version 3.0.0
358
+
359
+
360
+
361
+ If a git repository does 1mnot 22mhave a 1m.gemspec 22mfor the gem you attached
362
+ it to, a version specifier 1mMUST 22mbe provided. Bundler will use this ver-
363
+ sion in the simple 1m.gemspec 22mit creates.
364
+
365
+ Git repositories support a number of additional options.
366
+
367
+ 1mbranch22m, 1mtag22m, and 1mref0m
368
+ You 1mMUST 22monly specify at most one of these options. The default
369
+ is 1m:branch => "master"0m
370
+
371
+ For example:
372
+
373
+ git "https://github.com/rails/rails.git", :branch => "5-0-sta-
374
+ ble" do
375
+
376
+ git "https://github.com/rails/rails.git", :tag => "v5.0.0" do
377
+
378
+ git "https://github.com/rails/rails.git", :ref => "4aded" do
379
+
380
+ 1msubmodules0m
381
+ For reference, a git submodule
382
+ 4mhttps://git-scm.com/book/en/v2/Git-Tools-Submodules24m lets you
383
+ have another git repository within a subfolder of your reposi-
384
+ tory. Specify 1m:submodules => true 22mto cause bundler to expand any
385
+ submodules included in the git repository
386
+
387
+ If a git repository contains multiple 1m.gemspecs22m, each 1m.gemspec 22mrepre-
388
+ sents a gem located at the same place in the file system as the 1m.gem-0m
389
+ 1mspec22m.
390
+
391
+
392
+
393
+ |~rails [git root]
394
+ | |-rails.gemspec [rails gem located here]
395
+ |~actionpack
396
+ | |-actionpack.gemspec [actionpack gem located here]
397
+ |~activesupport
398
+ | |-activesupport.gemspec [activesupport gem located here]
399
+ |...
400
+
401
+
402
+
403
+ To install a gem located in a git repository, bundler changes to the
404
+ directory containing the gemspec, runs 1mgem build name.gemspec 22mand then
405
+ installs the resulting gem. The 1mgem build 22mcommand, which comes standard
406
+ with Rubygems, evaluates the 1m.gemspec 22min the context of the directory
407
+ in which it is located.
408
+
409
+ 1mGIT SOURCE0m
410
+ A custom git source can be defined via the 1mgit_source 22mmethod. Provide
411
+ the source's name as an argument, and a block which receives a single
412
+ argument and interpolates it into a string to return the full repo
413
+ address:
414
+
415
+
416
+
417
+ git_source(:stash){ |repo_name| "https://stash.corp.acme.pl/#{repo_name}.git" }
418
+ gem 'rails', :stash => 'forks/rails'
419
+
420
+
421
+
422
+ In addition, if you wish to choose a specific branch:
423
+
424
+
425
+
426
+ gem "rails", :stash => "forks/rails", :branch => "branch_name"
427
+
428
+
429
+
430
+ 1mGITHUB0m
431
+ 1mNOTE22m: This shorthand should be avoided until Bundler 2.0, since it cur-
432
+ rently expands to an insecure 1mgit:// 22mURL. This allows a man-in-the-mid-
433
+ dle attacker to compromise your system.
434
+
435
+ If the git repository you want to use is hosted on GitHub and is pub-
436
+ lic, you can use the :github shorthand to specify the github username
437
+ and repository name (without the trailing ".git"), separated by a
438
+ slash. If both the username and repository name are the same, you can
439
+ omit one.
440
+
441
+
442
+
443
+ gem "rails", :github => "rails/rails"
444
+ gem "rails", :github => "rails"
445
+
446
+
447
+
448
+ Are both equivalent to
449
+
450
+
451
+
452
+ gem "rails", :git => "git://github.com/rails/rails.git"
453
+
454
+
455
+
456
+ Since the 1mgithub 22mmethod is a specialization of 1mgit_source22m, it accepts a
457
+ 1m:branch 22mnamed argument.
458
+
459
+ 1mGIST0m
460
+ If the git repository you want to use is hosted as a Github Gist and is
461
+ public, you can use the :gist shorthand to specify the gist identifier
462
+ (without the trailing ".git").
463
+
464
+
465
+
466
+ gem "the_hatch", :gist => "4815162342"
467
+
468
+
469
+
470
+ Is equivalent to:
471
+
472
+
473
+
474
+ gem "the_hatch", :git => "https://gist.github.com/4815162342.git"
475
+
476
+
477
+
478
+ Since the 1mgist 22mmethod is a specialization of 1mgit_source22m, it accepts a
479
+ 1m:branch 22mnamed argument.
480
+
481
+ 1mBITBUCKET0m
482
+ If the git repository you want to use is hosted on Bitbucket and is
483
+ public, you can use the :bitbucket shorthand to specify the bitbucket
484
+ username and repository name (without the trailing ".git"), separated
485
+ by a slash. If both the username and repository name are the same, you
486
+ can omit one.
487
+
488
+
489
+
490
+ gem "rails", :bitbucket => "rails/rails"
491
+ gem "rails", :bitbucket => "rails"
492
+
493
+
494
+
495
+ Are both equivalent to
496
+
497
+
498
+
499
+ gem "rails", :git => "https://rails@bitbucket.org/rails/rails.git"
500
+
501
+
502
+
503
+ Since the 1mbitbucket 22mmethod is a specialization of 1mgit_source22m, it
504
+ accepts a 1m:branch 22mnamed argument.
505
+
506
+ 1mPATH0m
507
+ You can specify that a gem is located in a particular location on the
508
+ file system. Relative paths are resolved relative to the directory con-
509
+ taining the 1mGemfile22m.
510
+
511
+ Similar to the semantics of the 1m:git 22moption, the 1m:path 22moption requires
512
+ that the directory in question either contains a 1m.gemspec 22mfor the gem,
513
+ or that you specify an explicit version that bundler should use.
514
+
515
+ Unlike 1m:git22m, bundler does not compile C extensions for gems specified
516
+ as paths.
517
+
518
+
519
+
520
+ gem "rails", :path => "vendor/rails"
521
+
522
+
523
+
524
+ If you would like to use multiple local gems directly from the filesys-
525
+ tem, you can set a global 1mpath 22moption to the path containing the gem's
526
+ files. This will automatically load gemspec files from subdirectories.
527
+
528
+
529
+
530
+ path 'components' do
531
+ gem 'admin_ui'
532
+ gem 'public_ui'
533
+ end
534
+
535
+
536
+
537
+ 1mBLOCK FORM OF SOURCE, GIT, PATH, GROUP and PLATFORMS0m
538
+ The 1m:source22m, 1m:git22m, 1m:path22m, 1m:group22m, and 1m:platforms 22moptions may be applied
539
+ to a group of gems by using block form.
540
+
541
+
542
+
543
+ source "https://gems.example.com" do
544
+ gem "some_internal_gem"
545
+ gem "another_internal_gem"
546
+ end
547
+
548
+ git "https://github.com/rails/rails.git" do
549
+ gem "activesupport"
550
+ gem "actionpack"
551
+ end
552
+
553
+ platforms :ruby do
554
+ gem "ruby-debug"
555
+ gem "sqlite3"
556
+ end
557
+
558
+ group :development, :optional => true do
559
+ gem "wirble"
560
+ gem "faker"
561
+ end
562
+
563
+
564
+
565
+ In the case of the group block form the :optional option can be given
566
+ to prevent a group from being installed unless listed in the 1m--with0m
567
+ option given to the 1mbundle install 22mcommand.
568
+
569
+ In the case of the 1mgit 22mblock form, the 1m:ref22m, 1m:branch22m, 1m:tag22m, and 1m:sub-0m
570
+ 1mmodules 22moptions may be passed to the 1mgit 22mmethod, and all gems in the
571
+ block will inherit those options.
572
+
573
+ 1mINSTALL_IF0m
574
+ The 1minstall_if 22mmethod allows gems to be installed based on a proc or
575
+ lambda. This is especially useful for optional gems that can only be
576
+ used if certain software is installed or some other conditions are met.
577
+
578
+
579
+
580
+ install_if -> { RUBY_PLATFORM =~ /darwin/ } do
581
+ gem "pasteboard"
582
+ end
583
+
584
+
585
+
586
+ 1mGEMSPEC0m
587
+ The .gemspec 4mhttp://guides.rubygems.org/specification-reference/24m file
588
+ is where you provide metadata about your gem to Rubygems. Some required
589
+ Gemspec attributes include the name, description, and homepage of your
590
+ gem. This is also where you specify the dependencies your gem needs to
591
+ run.
592
+
593
+ If you wish to use Bundler to help install dependencies for a gem while
594
+ it is being developed, use the 1mgemspec 22mmethod to pull in the dependen-
595
+ cies listed in the 1m.gemspec 22mfile.
596
+
597
+ The 1mgemspec 22mmethod adds any runtime dependencies as gem requirements in
598
+ the default group. It also adds development dependencies as gem
599
+ requirements in the 1mdevelopment 22mgroup. Finally, it adds a gem require-
600
+ ment on your project (1m:path => '.'22m). In conjunction with 1mBundler.setup22m,
601
+ this allows you to require project files in your test code as you would
602
+ if the project were installed as a gem; you need not manipulate the
603
+ load path manually or require project files via relative paths.
604
+
605
+ The 1mgemspec 22mmethod supports optional 1m:path22m, 1m:glob22m, 1m:name22m, and 1m:develop-0m
606
+ 1mment_group 22moptions, which control where bundler looks for the 1m.gemspec22m,
607
+ the glob it uses to look for the gemspec (defaults to: "{,4m,24m/*}.gem-
608
+ spec"), what named 1m.gemspec 22mit uses (if more than one is present), and
609
+ which group development dependencies are included in.
610
+
611
+ When a 1mgemspec 22mdependency encounters version conflicts during resolu-
612
+ tion, the local version under development will always be selected --
613
+ even if there are remote versions that better match other requirements
614
+ for the 1mgemspec 22mgem.
615
+
616
+ 1mSOURCE PRIORITY0m
617
+ When attempting to locate a gem to satisfy a gem requirement, bundler
618
+ uses the following priority order:
619
+
620
+ 1. The source explicitly attached to the gem (using 1m:source22m, 1m:path22m, or
621
+ 1m:git22m)
622
+
623
+ 2. For implicit gems (dependencies of explicit gems), any source, git,
624
+ or path repository declared on the parent. This results in bundler
625
+ prioritizing the ActiveSupport gem from the Rails git repository
626
+ over ones from 1mrubygems.org0m
627
+
628
+ 3. The sources specified via global 1msource 22mlines, searching each
629
+ source in your 1mGemfile 22mfrom last added to first added.
630
+
631
+
632
+
633
+
634
+
635
+
636
+ August 2017 GEMFILE(5)