bundler 2.1.0 → 2.2.0.rc.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +832 -738
- data/README.md +6 -8
- data/bundler.gemspec +3 -3
- data/exe/bundle +3 -0
- data/lib/bundler.rb +15 -4
- data/lib/bundler/build_metadata.rb +2 -2
- data/lib/bundler/cli.rb +32 -11
- data/lib/bundler/cli/console.rb +1 -1
- data/lib/bundler/cli/exec.rb +3 -12
- data/lib/bundler/cli/gem.rb +83 -10
- data/lib/bundler/cli/info.rb +13 -3
- data/lib/bundler/cli/init.rb +1 -1
- data/lib/bundler/cli/install.rb +8 -16
- data/lib/bundler/cli/issue.rb +2 -2
- data/lib/bundler/cli/list.rb +11 -9
- data/lib/bundler/cli/outdated.rb +88 -65
- data/lib/bundler/cli/plugin.rb +10 -0
- data/lib/bundler/cli/pristine.rb +5 -0
- data/lib/bundler/definition.rb +32 -32
- data/lib/bundler/dependency.rb +0 -9
- data/lib/bundler/dsl.rb +1 -5
- data/lib/bundler/environment_preserver.rb +26 -2
- data/lib/bundler/errors.rb +1 -0
- data/lib/bundler/feature_flag.rb +0 -2
- data/lib/bundler/fetcher.rb +1 -0
- data/lib/bundler/friendly_errors.rb +4 -10
- data/lib/bundler/gem_helper.rb +18 -12
- data/lib/bundler/gem_version_promoter.rb +1 -1
- data/lib/bundler/injector.rb +14 -3
- data/lib/bundler/inline.rb +2 -2
- data/lib/bundler/installer.rb +29 -28
- data/lib/bundler/installer/gem_installer.rb +2 -2
- data/lib/bundler/installer/parallel_installer.rb +9 -9
- data/lib/bundler/lazy_specification.rb +16 -3
- data/lib/bundler/plugin.rb +26 -0
- data/lib/bundler/plugin/index.rb +9 -0
- data/lib/bundler/psyched_yaml.rb +0 -15
- data/lib/bundler/remote_specification.rb +4 -1
- data/lib/bundler/resolver.rb +31 -8
- data/lib/bundler/resolver/spec_group.rb +26 -5
- data/lib/bundler/rubygems_ext.rb +7 -8
- data/lib/bundler/rubygems_gem_installer.rb +1 -7
- data/lib/bundler/rubygems_integration.rb +13 -48
- data/lib/bundler/runtime.rb +2 -12
- data/lib/bundler/settings.rb +0 -3
- data/lib/bundler/setup.rb +5 -0
- data/lib/bundler/shared_helpers.rb +1 -1
- data/lib/bundler/source/git.rb +4 -4
- data/lib/bundler/source/git/git_proxy.rb +53 -58
- data/lib/bundler/source/path.rb +5 -1
- data/lib/bundler/source/path/installer.rb +7 -9
- data/lib/bundler/source/rubygems.rb +11 -14
- data/lib/bundler/stub_specification.rb +16 -4
- data/lib/bundler/templates/newgem/CODE_OF_CONDUCT.md.tt +57 -47
- data/lib/bundler/templates/newgem/Gemfile.tt +9 -1
- data/lib/bundler/templates/newgem/Rakefile.tt +19 -5
- data/lib/bundler/templates/newgem/bin/console.tt +2 -0
- data/lib/bundler/templates/newgem/circleci/config.yml.tt +13 -0
- data/lib/bundler/templates/newgem/ext/newgem/extconf.rb.tt +2 -0
- data/lib/bundler/templates/newgem/github/workflows/main.yml.tt +18 -0
- data/lib/bundler/templates/newgem/gitlab-ci.yml.tt +9 -0
- data/lib/bundler/templates/newgem/lib/newgem.rb.tt +2 -0
- data/lib/bundler/templates/newgem/lib/newgem/version.rb.tt +2 -0
- data/lib/bundler/templates/newgem/newgem.gemspec.tt +6 -4
- data/lib/bundler/templates/newgem/rubocop.yml.tt +10 -0
- data/lib/bundler/templates/newgem/spec/newgem_spec.rb.tt +2 -0
- data/lib/bundler/templates/newgem/spec/spec_helper.rb.tt +2 -0
- data/lib/bundler/templates/newgem/test/{newgem_test.rb.tt → minitest/newgem_test.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/{test_helper.rb.tt → minitest/test_helper.rb.tt} +2 -0
- data/lib/bundler/templates/newgem/test/test-unit/newgem_test.rb.tt +15 -0
- data/lib/bundler/templates/newgem/test/test-unit/test_helper.rb.tt +6 -0
- data/lib/bundler/vendor/net-http-persistent/lib/net/http/persistent.rb +72 -208
- data/lib/bundler/vendor/thor/lib/thor.rb +0 -7
- data/lib/bundler/vendor/thor/lib/thor/actions/create_link.rb +2 -1
- data/lib/bundler/vendor/thor/lib/thor/base.rb +9 -0
- data/lib/bundler/vendor/thor/lib/thor/version.rb +1 -1
- data/lib/bundler/version.rb +1 -1
- data/man/bundle-add.1 +1 -1
- data/man/bundle-add.1.txt +15 -15
- data/man/bundle-binstubs.1 +1 -1
- data/man/bundle-binstubs.1.txt +10 -10
- data/man/bundle-cache.1 +1 -1
- data/man/bundle-cache.1.txt +15 -15
- data/man/bundle-check.1 +1 -1
- data/man/bundle-check.1.txt +8 -8
- data/man/bundle-clean.1 +1 -1
- data/man/bundle-clean.1.txt +6 -6
- data/man/bundle-config.1 +3 -9
- data/man/bundle-config.1.txt +271 -272
- data/man/bundle-config.ronn +5 -9
- data/man/bundle-doctor.1 +1 -1
- data/man/bundle-doctor.1.txt +9 -9
- data/man/bundle-exec.1 +1 -1
- data/man/bundle-exec.1.txt +84 -81
- data/man/bundle-gem.1 +25 -3
- data/man/bundle-gem.1.txt +65 -39
- data/man/bundle-gem.ronn +30 -7
- data/man/bundle-info.1 +1 -1
- data/man/bundle-info.1.txt +2 -2
- data/man/bundle-init.1 +1 -1
- data/man/bundle-init.1.txt +9 -9
- data/man/bundle-inject.1 +1 -1
- data/man/bundle-inject.1.txt +4 -4
- data/man/bundle-install.1 +1 -1
- data/man/bundle-install.1.txt +169 -169
- data/man/bundle-list.1 +7 -7
- data/man/bundle-list.1.txt +12 -11
- data/man/bundle-list.ronn +6 -6
- data/man/bundle-lock.1 +1 -1
- data/man/bundle-lock.1.txt +28 -28
- data/man/bundle-open.1 +1 -1
- data/man/bundle-open.1.txt +3 -3
- data/man/bundle-outdated.1 +1 -1
- data/man/bundle-outdated.1.txt +34 -34
- data/man/bundle-platform.1 +1 -1
- data/man/bundle-platform.1.txt +16 -16
- data/man/bundle-pristine.1 +1 -1
- data/man/bundle-pristine.1.txt +8 -8
- data/man/bundle-remove.1 +1 -1
- data/man/bundle-remove.1.txt +9 -9
- data/man/bundle-show.1 +1 -1
- data/man/bundle-show.1.txt +8 -8
- data/man/bundle-update.1 +1 -1
- data/man/bundle-update.1.txt +149 -148
- data/man/bundle-viz.1 +1 -1
- data/man/bundle-viz.1.txt +11 -11
- data/man/bundle.1 +1 -1
- data/man/bundle.1.txt +31 -31
- data/man/gemfile.5 +1 -1
- data/man/gemfile.5.txt +218 -216
- metadata +14 -8
data/man/bundle-viz.1
CHANGED
data/man/bundle-viz.1.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
BUNDLE-VIZ(1)
|
1
|
+
BUNDLE-VIZ(1) BUNDLE-VIZ(1)
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -10,30 +10,30 @@ SYNOPSIS
|
|
10
10
|
[--without=GROUP GROUP]
|
11
11
|
|
12
12
|
DESCRIPTION
|
13
|
-
viz generates a PNG file of the
|
13
|
+
viz generates a PNG file of the current Gemfile(5) as a dependency
|
14
14
|
graph. viz requires the ruby-graphviz gem (and its dependencies).
|
15
15
|
|
16
|
-
The associated
|
17
|
-
|
16
|
+
The associated gems must also be installed via bundle install(1)
|
17
|
+
bundle-install.1.html.
|
18
18
|
|
19
19
|
OPTIONS
|
20
20
|
--file, -f
|
21
|
-
|
21
|
+
The name to use for the generated file. See --format option
|
22
22
|
|
23
23
|
--format, -F
|
24
|
-
|
25
|
-
|
24
|
+
This is output format option. Supported format is png, jpg, svg,
|
25
|
+
dot ...
|
26
26
|
|
27
27
|
--requirements, -R
|
28
|
-
|
28
|
+
Set to show the version of each required dependency.
|
29
29
|
|
30
30
|
--version, -v
|
31
|
-
|
31
|
+
Set to show each gem version.
|
32
32
|
|
33
33
|
--without, -W
|
34
|
-
|
34
|
+
Exclude gems that are part of the specified named group.
|
35
35
|
|
36
36
|
|
37
37
|
|
38
38
|
|
39
|
-
|
39
|
+
July 2020 BUNDLE-VIZ(1)
|
data/man/bundle.1
CHANGED
data/man/bundle.1.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
BUNDLE(1)
|
1
|
+
BUNDLE(1) BUNDLE(1)
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -9,7 +9,7 @@ SYNOPSIS
|
|
9
9
|
bundle COMMAND [--no-color] [--verbose] [ARGS]
|
10
10
|
|
11
11
|
DESCRIPTION
|
12
|
-
Bundler
|
12
|
+
Bundler manages an application's dependencies through its entire life
|
13
13
|
across many machines systematically and repeatably.
|
14
14
|
|
15
15
|
See the bundler website https://bundler.io for information on getting
|
@@ -17,87 +17,87 @@ DESCRIPTION
|
|
17
17
|
|
18
18
|
OPTIONS
|
19
19
|
--no-color
|
20
|
-
|
20
|
+
Print all output without color
|
21
21
|
|
22
22
|
--retry, -r
|
23
|
-
|
23
|
+
Specify the number of times you wish to attempt network commands
|
24
24
|
|
25
25
|
--verbose, -V
|
26
|
-
|
26
|
+
Print out additional logging information
|
27
27
|
|
28
28
|
BUNDLE COMMANDS
|
29
29
|
We divide bundle subcommands into primary commands and utilities:
|
30
30
|
|
31
31
|
PRIMARY COMMANDS
|
32
32
|
bundle install(1) bundle-install.1.html
|
33
|
-
|
33
|
+
Install the gems specified by the Gemfile or Gemfile.lock
|
34
34
|
|
35
35
|
bundle update(1) bundle-update.1.html
|
36
|
-
|
36
|
+
Update dependencies to their latest versions
|
37
37
|
|
38
38
|
bundle package(1) bundle-package.1.html
|
39
|
-
|
40
|
-
|
39
|
+
Package the .gem files required by your application into the
|
40
|
+
vendor/cache directory
|
41
41
|
|
42
42
|
bundle exec(1) bundle-exec.1.html
|
43
|
-
|
43
|
+
Execute a script in the current bundle
|
44
44
|
|
45
45
|
bundle config(1) bundle-config.1.html
|
46
|
-
|
46
|
+
Specify and read configuration options for Bundler
|
47
47
|
|
48
48
|
bundle help(1)
|
49
|
-
|
49
|
+
Display detailed help for each subcommand
|
50
50
|
|
51
51
|
UTILITIES
|
52
52
|
bundle add(1) bundle-add.1.html
|
53
|
-
|
53
|
+
Add the named gem to the Gemfile and run bundle install
|
54
54
|
|
55
55
|
bundle binstubs(1) bundle-binstubs.1.html
|
56
|
-
|
56
|
+
Generate binstubs for executables in a gem
|
57
57
|
|
58
58
|
bundle check(1) bundle-check.1.html
|
59
|
-
|
60
|
-
|
59
|
+
Determine whether the requirements for your application are
|
60
|
+
installed and available to Bundler
|
61
61
|
|
62
62
|
bundle show(1) bundle-show.1.html
|
63
|
-
|
63
|
+
Show the source location of a particular gem in the bundle
|
64
64
|
|
65
65
|
bundle outdated(1) bundle-outdated.1.html
|
66
|
-
|
66
|
+
Show all of the outdated gems in the current bundle
|
67
67
|
|
68
68
|
bundle console(1)
|
69
|
-
|
69
|
+
Start an IRB session in the current bundle
|
70
70
|
|
71
71
|
bundle open(1) bundle-open.1.html
|
72
|
-
|
72
|
+
Open an installed gem in the editor
|
73
73
|
|
74
74
|
bundle lock(1) bundle-lock.1.html
|
75
|
-
|
75
|
+
Generate a lockfile for your dependencies
|
76
76
|
|
77
77
|
bundle viz(1) bundle-viz.1.html
|
78
|
-
|
78
|
+
Generate a visual representation of your dependencies
|
79
79
|
|
80
80
|
bundle init(1) bundle-init.1.html
|
81
|
-
|
81
|
+
Generate a simple Gemfile, placed in the current directory
|
82
82
|
|
83
83
|
bundle gem(1) bundle-gem.1.html
|
84
|
-
|
84
|
+
Create a simple gem, suitable for development with Bundler
|
85
85
|
|
86
86
|
bundle platform(1) bundle-platform.1.html
|
87
|
-
|
87
|
+
Display platform compatibility information
|
88
88
|
|
89
89
|
bundle clean(1) bundle-clean.1.html
|
90
|
-
|
90
|
+
Clean up unused gems in your Bundler directory
|
91
91
|
|
92
92
|
bundle doctor(1) bundle-doctor.1.html
|
93
|
-
|
93
|
+
Display warnings about common problems
|
94
94
|
|
95
95
|
bundle remove(1) bundle-remove.1.html
|
96
|
-
|
96
|
+
Removes gems from the Gemfile
|
97
97
|
|
98
98
|
PLUGINS
|
99
|
-
When running
|
100
|
-
|
99
|
+
When running a command that isn't listed in PRIMARY COMMANDS or
|
100
|
+
UTILITIES, Bundler will try to find an executable on your path named
|
101
101
|
bundler-<command> and execute it, passing down any extra arguments to
|
102
102
|
it.
|
103
103
|
|
@@ -113,4 +113,4 @@ OBSOLETE
|
|
113
113
|
|
114
114
|
|
115
115
|
|
116
|
-
|
116
|
+
July 2020 BUNDLE(1)
|
data/man/gemfile.5
CHANGED
data/man/gemfile.5.txt
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
GEMFILE(5)
|
1
|
+
GEMFILE(5) GEMFILE(5)
|
2
2
|
|
3
3
|
|
4
4
|
|
@@ -9,21 +9,21 @@ SYNOPSIS
|
|
9
9
|
A Gemfile describes the gem dependencies required to execute associated
|
10
10
|
Ruby code.
|
11
11
|
|
12
|
-
Place
|
13
|
-
|
14
|
-
the same directory as the Rakefile.
|
12
|
+
Place the Gemfile in the root of the directory containing the
|
13
|
+
associated code. For instance, in a Rails application, place the
|
14
|
+
Gemfile in the same directory as the Rakefile.
|
15
15
|
|
16
16
|
SYNTAX
|
17
17
|
A Gemfile is evaluated as Ruby code, in a context which makes available
|
18
18
|
a number of methods used to describe the gem requirements.
|
19
19
|
|
20
20
|
GLOBAL SOURCES
|
21
|
-
At
|
22
|
-
|
21
|
+
At the top of the Gemfile, add a line for the Rubygems source that
|
22
|
+
contains the gems listed in the Gemfile.
|
23
23
|
|
24
24
|
|
25
25
|
|
26
|
-
|
26
|
+
source "https://rubygems.org"
|
27
27
|
|
28
28
|
|
29
29
|
|
@@ -31,24 +31,24 @@ GLOBAL SOURCES
|
|
31
31
|
global source lines. Each of these sources MUST be a valid Rubygems
|
32
32
|
repository.
|
33
33
|
|
34
|
-
Sources are checked for gems following
|
34
|
+
Sources are checked for gems following the heuristics described in
|
35
35
|
SOURCE PRIORITY. If a gem is found in more than one global source,
|
36
36
|
Bundler will print a warning after installing the gem indicating which
|
37
|
-
source was
|
38
|
-
|
39
|
-
non-standard
|
40
|
-
option or a source block.
|
37
|
+
source was used, and listing the other sources where the gem is
|
38
|
+
available. A specific source can be selected for gems that need to use
|
39
|
+
a non-standard repository, suppressing this warning, by using the
|
40
|
+
:source option or a source block.
|
41
41
|
|
42
42
|
CREDENTIALS
|
43
43
|
Some gem sources require a username and password. Use bundle config(1)
|
44
44
|
bundle-config.1.html to set the username and password for any of the
|
45
|
-
sources that need it. The command must be run once on
|
45
|
+
sources that need it. The command must be run once on each computer
|
46
46
|
that will install the Gemfile, but this keeps the credentials from
|
47
47
|
being stored in plain text in version control.
|
48
48
|
|
49
49
|
|
50
50
|
|
51
|
-
|
51
|
+
bundle config gems.example.com user:password
|
52
52
|
|
53
53
|
|
54
54
|
|
@@ -57,7 +57,7 @@ GLOBAL SOURCES
|
|
57
57
|
|
58
58
|
|
59
59
|
|
60
|
-
|
60
|
+
source "https://user:password@gems.example.com"
|
61
61
|
|
62
62
|
|
63
63
|
|
@@ -71,13 +71,13 @@ RUBY
|
|
71
71
|
|
72
72
|
VERSION (required)
|
73
73
|
The version of Ruby that your application requires. If your application
|
74
|
-
requires
|
75
|
-
|
76
|
-
with.
|
74
|
+
requires an alternate Ruby engine, such as JRuby, Rubinius or
|
75
|
+
TruffleRuby, this should be the Ruby version that the engine is
|
76
|
+
compatible with.
|
77
77
|
|
78
78
|
|
79
79
|
|
80
|
-
|
80
|
+
ruby "1.9.3"
|
81
81
|
|
82
82
|
|
83
83
|
|
@@ -88,29 +88,29 @@ RUBY
|
|
88
88
|
What exactly is an Engine? - A Ruby engine is an implementation of the
|
89
89
|
Ruby language.
|
90
90
|
|
91
|
-
o For
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
91
|
+
o For background: the reference or original implementation of the
|
92
|
+
Ruby programming language is called Matz's Ruby Interpreter
|
93
|
+
https://en.wikipedia.org/wiki/Ruby_MRI, or MRI for short. This is
|
94
|
+
named after Ruby creator Yukihiro Matsumoto, also known as Matz.
|
95
|
+
MRI is also known as CRuby, because it is written in C. MRI is the
|
96
|
+
most widely used Ruby engine.
|
97
97
|
|
98
98
|
o Other implementations https://www.ruby-lang.org/en/about/ of Ruby
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
99
|
+
exist. Some of the more well-known implementations include Rubinius
|
100
|
+
https://rubinius.com/, and JRuby http://jruby.org/. Rubinius is an
|
101
|
+
alternative implementation of Ruby written in Ruby. JRuby is an
|
102
|
+
implementation of Ruby on the JVM, short for Java Virtual Machine.
|
103
103
|
|
104
104
|
|
105
105
|
|
106
106
|
ENGINE VERSION
|
107
|
-
Each application may specify
|
108
|
-
|
109
|
-
"ruby" the engine version specified must match the Ruby version.
|
107
|
+
Each application may specify a Ruby engine version. If an engine
|
108
|
+
version is specified, an engine must also be specified. If the engine
|
109
|
+
is "ruby" the engine version specified must match the Ruby version.
|
110
110
|
|
111
111
|
|
112
112
|
|
113
|
-
|
113
|
+
ruby "1.8.7", :engine => "jruby", :engine_version => "1.6.7"
|
114
114
|
|
115
115
|
|
116
116
|
|
@@ -119,20 +119,20 @@ RUBY
|
|
119
119
|
|
120
120
|
|
121
121
|
|
122
|
-
|
122
|
+
ruby "2.0.0", :patchlevel => "247"
|
123
123
|
|
124
124
|
|
125
125
|
|
126
126
|
GEMS
|
127
|
-
Specify gem requirements using
|
128
|
-
|
127
|
+
Specify gem requirements using the gem method, with the following
|
128
|
+
arguments. All parameters are OPTIONAL unless otherwise specified.
|
129
129
|
|
130
130
|
NAME (required)
|
131
131
|
For each gem requirement, list a single gem line.
|
132
132
|
|
133
133
|
|
134
134
|
|
135
|
-
|
135
|
+
gem "nokogiri"
|
136
136
|
|
137
137
|
|
138
138
|
|
@@ -141,22 +141,22 @@ GEMS
|
|
141
141
|
|
142
142
|
|
143
143
|
|
144
|
-
|
145
|
-
|
144
|
+
gem "nokogiri", ">= 1.4.2"
|
145
|
+
gem "RedCloth", ">= 4.1.0", "< 4.2.0"
|
146
146
|
|
147
147
|
|
148
148
|
|
149
149
|
REQUIRE AS
|
150
150
|
Each gem MAY specify files that should be used when autorequiring via
|
151
151
|
Bundler.require. You may pass an array with multiple files or true if
|
152
|
-
file you want
|
152
|
+
file you want required has same name as gem or false to prevent any
|
153
153
|
file from being autorequired.
|
154
154
|
|
155
155
|
|
156
156
|
|
157
|
-
|
158
|
-
|
159
|
-
|
157
|
+
gem "redis", :require => ["redis/connection/hiredis", "redis"]
|
158
|
+
gem "webmock", :require => false
|
159
|
+
gem "byebug", :require => true
|
160
160
|
|
161
161
|
|
162
162
|
|
@@ -165,21 +165,21 @@ GEMS
|
|
165
165
|
|
166
166
|
|
167
167
|
|
168
|
-
|
169
|
-
|
170
|
-
|
168
|
+
gem "nokogiri"
|
169
|
+
gem "nokogiri", :require => "nokogiri"
|
170
|
+
gem "nokogiri", :require => true
|
171
171
|
|
172
172
|
|
173
173
|
|
174
174
|
GROUPS
|
175
|
-
Each gem MAY specify
|
175
|
+
Each gem MAY specify membership in one or more groups. Any gem that
|
176
176
|
does not specify membership in any group is placed in the default
|
177
177
|
group.
|
178
178
|
|
179
179
|
|
180
180
|
|
181
|
-
|
182
|
-
|
181
|
+
gem "rspec", :group => :test
|
182
|
+
gem "wirble", :groups => [:development, :test]
|
183
183
|
|
184
184
|
|
185
185
|
|
@@ -188,47 +188,47 @@ GEMS
|
|
188
188
|
|
189
189
|
|
190
190
|
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
191
|
+
# setup adds gems to Ruby's load path
|
192
|
+
Bundler.setup # defaults to all groups
|
193
|
+
require "bundler/setup" # same as Bundler.setup
|
194
|
+
Bundler.setup(:default) # only set up the _default_ group
|
195
|
+
Bundler.setup(:test) # only set up the _test_ group (but `not` _default_)
|
196
|
+
Bundler.setup(:default, :test) # set up the _default_ and _test_ groups, but no others
|
197
197
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
198
|
+
# require requires all of the gems in the specified groups
|
199
|
+
Bundler.require # defaults to the _default_ group
|
200
|
+
Bundler.require(:default) # identical
|
201
|
+
Bundler.require(:default, :test) # requires the _default_ and _test_ groups
|
202
|
+
Bundler.require(:test) # requires the _test_ group
|
203
203
|
|
204
204
|
|
205
205
|
|
206
|
-
The Bundler CLI allows you to specify
|
207
|
-
|
206
|
+
The Bundler CLI allows you to specify a list of groups whose gems
|
207
|
+
bundle install should not install with the without configuration.
|
208
208
|
|
209
|
-
To specify multiple groups
|
210
|
-
|
209
|
+
To specify multiple groups to ignore, specify a list of groups
|
210
|
+
separated by spaces.
|
211
211
|
|
212
212
|
|
213
213
|
|
214
|
-
|
215
|
-
|
214
|
+
bundle config set without test
|
215
|
+
bundle config set without development test
|
216
216
|
|
217
217
|
|
218
218
|
|
219
219
|
Also, calling Bundler.setup with no parameters, or calling require
|
220
|
-
"bundler/setup"
|
220
|
+
"bundler/setup" will setup all groups except for the ones you excluded
|
221
221
|
via --without (since they are not available).
|
222
222
|
|
223
223
|
Note that on bundle install, bundler downloads and evaluates all gems,
|
224
224
|
in order to create a single canonical list of all of the required gems
|
225
|
-
and their dependencies. This
|
226
|
-
|
225
|
+
and their dependencies. This means that you cannot list different
|
226
|
+
versions of the same gems in different groups. For more details, see
|
227
227
|
Understanding Bundler https://bundler.io/rationale.html.
|
228
228
|
|
229
229
|
PLATFORMS
|
230
|
-
If a gem should only be
|
231
|
-
|
230
|
+
If a gem should only be used in a particular platform or set of
|
231
|
+
platforms, you can specify them. Platforms are essentially identical to
|
232
232
|
groups, except that you do not need to use the --without install-time
|
233
233
|
flag to exclude groups of gems for other platforms.
|
234
234
|
|
@@ -241,27 +241,27 @@ GEMS
|
|
241
241
|
mingw Windows 32 bit 'mingw32' platform (aka RubyInstaller)
|
242
242
|
|
243
243
|
x64_mingw
|
244
|
-
|
244
|
+
Windows 64 bit 'mingw32' platform (aka RubyInstaller x64)
|
245
245
|
|
246
246
|
rbx Rubinius
|
247
247
|
|
248
248
|
jruby JRuby
|
249
249
|
|
250
250
|
truffleruby
|
251
|
-
|
251
|
+
TruffleRuby
|
252
252
|
|
253
253
|
mswin Windows
|
254
254
|
|
255
|
-
You can restrict further by
|
255
|
+
You can restrict further by platform and version for all platforms
|
256
256
|
except for rbx, jruby, truffleruby and mswin.
|
257
257
|
|
258
|
-
To specify a version in addition to
|
259
|
-
|
260
|
-
a gem should only be used on platforms with Ruby 2.3, use:
|
258
|
+
To specify a version in addition to a platform, append the version
|
259
|
+
number without the delimiter to the platform. For example, to specify
|
260
|
+
that a gem should only be used on platforms with Ruby 2.3, use:
|
261
261
|
|
262
262
|
|
263
263
|
|
264
|
-
|
264
|
+
ruby_23
|
265
265
|
|
266
266
|
|
267
267
|
|
@@ -274,19 +274,19 @@ GEMS
|
|
274
274
|
mingw 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
275
275
|
|
276
276
|
x64_mingw
|
277
|
-
|
277
|
+
2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6
|
278
278
|
|
279
279
|
As with groups, you can specify one or more platforms:
|
280
280
|
|
281
281
|
|
282
282
|
|
283
|
-
|
284
|
-
|
285
|
-
|
283
|
+
gem "weakling", :platforms => :jruby
|
284
|
+
gem "ruby-debug", :platforms => :mri_18
|
285
|
+
gem "nokogiri", :platforms => [:mri_18, :jruby]
|
286
286
|
|
287
287
|
|
288
288
|
|
289
|
-
All operations involving groups (bundle install
|
289
|
+
All operations involving groups (bundle install bundle-install.1.html,
|
290
290
|
Bundler.setup, Bundler.require) behave exactly the same as if any
|
291
291
|
groups not matching the current platform were explicitly excluded.
|
292
292
|
|
@@ -296,7 +296,7 @@ GEMS
|
|
296
296
|
|
297
297
|
|
298
298
|
|
299
|
-
|
299
|
+
gem "some_internal_gem", :source => "https://gems.example.com"
|
300
300
|
|
301
301
|
|
302
302
|
|
@@ -314,7 +314,7 @@ GEMS
|
|
314
314
|
|
315
315
|
Using the :source option for an individual gem will also make that
|
316
316
|
source available as a possible global source for any other gems which
|
317
|
-
do not
|
317
|
+
do not specify explicit sources. Thus, when adding gems with explicit
|
318
318
|
sources, it is recommended that you also ensure all other gems in the
|
319
319
|
Gemfile are using explicit sources.
|
320
320
|
|
@@ -324,7 +324,7 @@ GEMS
|
|
324
324
|
several protocols:
|
325
325
|
|
326
326
|
HTTP(S)
|
327
|
-
|
327
|
+
gem "rails", :git => "https://github.com/rails/rails.git"
|
328
328
|
|
329
329
|
SSH gem "rails", :git => "git@github.com:rails/rails.git"
|
330
330
|
|
@@ -333,95 +333,95 @@ GEMS
|
|
333
333
|
If using SSH, the user that you use to run bundle install MUST have the
|
334
334
|
appropriate keys available in their $HOME/.ssh.
|
335
335
|
|
336
|
-
NOTE: http:// and git:// URLs should be avoided
|
336
|
+
NOTE: http:// and git:// URLs should be avoided if at all possible.
|
337
337
|
These protocols are unauthenticated, so a man-in-the-middle attacker
|
338
338
|
can deliver malicious code and compromise your system. HTTPS and SSH
|
339
339
|
are strongly preferred.
|
340
340
|
|
341
|
-
The group, platforms,
|
341
|
+
The group, platforms, and require options are available and behave
|
342
342
|
exactly the same as they would for a normal gem.
|
343
343
|
|
344
|
-
A git repository SHOULD have at least one file,
|
344
|
+
A git repository SHOULD have at least one file, at the root of the
|
345
345
|
directory containing the gem, with the extension .gemspec. This file
|
346
346
|
MUST contain a valid gem specification, as expected by the gem build
|
347
347
|
command.
|
348
348
|
|
349
349
|
If a git repository does not have a .gemspec, bundler will attempt to
|
350
350
|
create one, but it will not contain any dependencies, executables, or C
|
351
|
-
extension compilation instructions.
|
352
|
-
|
351
|
+
extension compilation instructions. As a result, it may fail to
|
352
|
+
properly integrate into your application.
|
353
353
|
|
354
354
|
If a git repository does have a .gemspec for the gem you attached it
|
355
355
|
to, a version specifier, if provided, means that the git repository is
|
356
|
-
only valid if the .gemspec specifies a version
|
356
|
+
only valid if the .gemspec specifies a version matching the version
|
357
357
|
specifier. If not, bundler will print a warning.
|
358
358
|
|
359
359
|
|
360
360
|
|
361
|
-
|
362
|
-
|
363
|
-
|
361
|
+
gem "rails", "2.3.8", :git => "https://github.com/rails/rails.git"
|
362
|
+
# bundle install will fail, because the .gemspec in the rails
|
363
|
+
# repository's master branch specifies version 3.0.0
|
364
364
|
|
365
365
|
|
366
366
|
|
367
367
|
If a git repository does not have a .gemspec for the gem you attached
|
368
|
-
it to, a version specifier MUST be
|
369
|
-
|
368
|
+
it to, a version specifier MUST be provided. Bundler will use this
|
369
|
+
version in the simple .gemspec it creates.
|
370
370
|
|
371
371
|
Git repositories support a number of additional options.
|
372
372
|
|
373
373
|
branch, tag, and ref
|
374
|
-
|
375
|
-
|
374
|
+
You MUST only specify at most one of these options. The default
|
375
|
+
is :branch => "master". For example:
|
376
376
|
|
377
|
-
|
378
|
-
|
377
|
+
gem "rails", :git => "https://github.com/rails/rails.git",
|
378
|
+
:branch => "5-0-stable"
|
379
379
|
|
380
|
-
|
381
|
-
|
380
|
+
gem "rails", :git => "https://github.com/rails/rails.git", :tag
|
381
|
+
=> "v5.0.0"
|
382
382
|
|
383
|
-
|
384
|
-
|
383
|
+
gem "rails", :git => "https://github.com/rails/rails.git", :ref
|
384
|
+
=> "4aded"
|
385
385
|
|
386
386
|
submodules
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
387
|
+
For reference, a git submodule
|
388
|
+
https://git-scm.com/book/en/v2/Git-Tools-Submodules lets you
|
389
|
+
have another git repository within a subfolder of your
|
390
|
+
repository. Specify :submodules => true to cause bundler to
|
391
|
+
expand any submodules included in the git repository
|
392
392
|
|
393
|
-
If
|
394
|
-
|
395
|
-
|
393
|
+
If a git repository contains multiple .gemspecs, each .gemspec
|
394
|
+
represents a gem located at the same place in the file system as the
|
395
|
+
.gemspec.
|
396
396
|
|
397
397
|
|
398
398
|
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
399
|
+
|~rails [git root]
|
400
|
+
| |-rails.gemspec [rails gem located here]
|
401
|
+
|~actionpack
|
402
|
+
| |-actionpack.gemspec [actionpack gem located here]
|
403
|
+
|~activesupport
|
404
|
+
| |-activesupport.gemspec [activesupport gem located here]
|
405
|
+
|...
|
406
406
|
|
407
407
|
|
408
408
|
|
409
409
|
To install a gem located in a git repository, bundler changes to the
|
410
410
|
directory containing the gemspec, runs gem build name.gemspec and then
|
411
411
|
installs the resulting gem. The gem build command, which comes standard
|
412
|
-
with Rubygems, evaluates the .gemspec in the context of
|
412
|
+
with Rubygems, evaluates the .gemspec in the context of the directory
|
413
413
|
in which it is located.
|
414
414
|
|
415
415
|
GIT SOURCE
|
416
416
|
A custom git source can be defined via the git_source method. Provide
|
417
|
-
the source's name as an argument, and a block which receives a
|
418
|
-
argument and interpolates it
|
417
|
+
the source's name as an argument, and a block which receives a single
|
418
|
+
argument and interpolates it into a string to return the full repo
|
419
419
|
address:
|
420
420
|
|
421
421
|
|
422
422
|
|
423
|
-
|
424
|
-
|
423
|
+
git_source(:stash){ |repo_name| "https://stash.corp.acme.pl/#{repo_name}.git" }
|
424
|
+
gem 'rails', :stash => 'forks/rails'
|
425
425
|
|
426
426
|
|
427
427
|
|
@@ -429,25 +429,25 @@ GEMS
|
|
429
429
|
|
430
430
|
|
431
431
|
|
432
|
-
|
432
|
+
gem "rails", :stash => "forks/rails", :branch => "branch_name"
|
433
433
|
|
434
434
|
|
435
435
|
|
436
436
|
GITHUB
|
437
|
-
NOTE: This shorthand should be avoided
|
438
|
-
|
439
|
-
|
437
|
+
NOTE: This shorthand should be avoided until Bundler 2.0, since it
|
438
|
+
currently expands to an insecure git:// URL. This allows a
|
439
|
+
man-in-the-middle attacker to compromise your system.
|
440
440
|
|
441
|
-
If the git repository you want to
|
442
|
-
|
443
|
-
and repository name (without
|
444
|
-
slash.
|
445
|
-
omit one.
|
441
|
+
If the git repository you want to use is hosted on GitHub and is
|
442
|
+
public, you can use the :github shorthand to specify the github
|
443
|
+
username and repository name (without the trailing ".git"), separated
|
444
|
+
by a slash. If both the username and repository name are the same, you
|
445
|
+
can omit one.
|
446
446
|
|
447
447
|
|
448
448
|
|
449
|
-
|
450
|
-
|
449
|
+
gem "rails", :github => "rails/rails"
|
450
|
+
gem "rails", :github => "rails"
|
451
451
|
|
452
452
|
|
453
453
|
|
@@ -455,7 +455,7 @@ GEMS
|
|
455
455
|
|
456
456
|
|
457
457
|
|
458
|
-
|
458
|
+
gem "rails", :git => "git://github.com/rails/rails.git"
|
459
459
|
|
460
460
|
|
461
461
|
|
@@ -469,7 +469,7 @@ GEMS
|
|
469
469
|
|
470
470
|
|
471
471
|
|
472
|
-
|
472
|
+
gem "the_hatch", :gist => "4815162342"
|
473
473
|
|
474
474
|
|
475
475
|
|
@@ -477,7 +477,7 @@ GEMS
|
|
477
477
|
|
478
478
|
|
479
479
|
|
480
|
-
|
480
|
+
gem "the_hatch", :git => "https://gist.github.com/4815162342.git"
|
481
481
|
|
482
482
|
|
483
483
|
|
@@ -485,16 +485,16 @@ GEMS
|
|
485
485
|
:branch named argument.
|
486
486
|
|
487
487
|
BITBUCKET
|
488
|
-
If the git repository you want to use is hosted
|
489
|
-
public,
|
488
|
+
If the git repository you want to use is hosted on Bitbucket and is
|
489
|
+
public, you can use the :bitbucket shorthand to specify the bitbucket
|
490
490
|
username and repository name (without the trailing ".git"), separated
|
491
491
|
by a slash. If both the username and repository name are the same, you
|
492
492
|
can omit one.
|
493
493
|
|
494
494
|
|
495
495
|
|
496
|
-
|
497
|
-
|
496
|
+
gem "rails", :bitbucket => "rails/rails"
|
497
|
+
gem "rails", :bitbucket => "rails"
|
498
498
|
|
499
499
|
|
500
500
|
|
@@ -502,19 +502,19 @@ GEMS
|
|
502
502
|
|
503
503
|
|
504
504
|
|
505
|
-
|
505
|
+
gem "rails", :git => "https://rails@bitbucket.org/rails/rails.git"
|
506
506
|
|
507
507
|
|
508
508
|
|
509
|
-
Since the bitbucket method is
|
509
|
+
Since the bitbucket method is a specialization of git_source, it
|
510
510
|
accepts a :branch named argument.
|
511
511
|
|
512
512
|
PATH
|
513
513
|
You can specify that a gem is located in a particular location on the
|
514
|
-
file system. Relative paths are
|
515
|
-
|
514
|
+
file system. Relative paths are resolved relative to the directory
|
515
|
+
containing the Gemfile.
|
516
516
|
|
517
|
-
Similar
|
517
|
+
Similar to the semantics of the :git option, the :path option requires
|
518
518
|
that the directory in question either contains a .gemspec for the gem,
|
519
519
|
or that you specify an explicit version that bundler should use.
|
520
520
|
|
@@ -523,20 +523,21 @@ GEMS
|
|
523
523
|
|
524
524
|
|
525
525
|
|
526
|
-
|
526
|
+
gem "rails", :path => "vendor/rails"
|
527
527
|
|
528
528
|
|
529
529
|
|
530
|
-
If you would
|
531
|
-
|
532
|
-
files.
|
530
|
+
If you would like to use multiple local gems directly from the
|
531
|
+
filesystem, you can set a global path option to the path containing the
|
532
|
+
gem's files. This will automatically load gemspec files from
|
533
|
+
subdirectories.
|
533
534
|
|
534
535
|
|
535
536
|
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
537
|
+
path 'components' do
|
538
|
+
gem 'admin_ui'
|
539
|
+
gem 'public_ui'
|
540
|
+
end
|
540
541
|
|
541
542
|
|
542
543
|
|
@@ -546,104 +547,105 @@ BLOCK FORM OF SOURCE, GIT, PATH, GROUP and PLATFORMS
|
|
546
547
|
|
547
548
|
|
548
549
|
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
550
|
+
source "https://gems.example.com" do
|
551
|
+
gem "some_internal_gem"
|
552
|
+
gem "another_internal_gem"
|
553
|
+
end
|
553
554
|
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
555
|
+
git "https://github.com/rails/rails.git" do
|
556
|
+
gem "activesupport"
|
557
|
+
gem "actionpack"
|
558
|
+
end
|
558
559
|
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
560
|
+
platforms :ruby do
|
561
|
+
gem "ruby-debug"
|
562
|
+
gem "sqlite3"
|
563
|
+
end
|
563
564
|
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
565
|
+
group :development, :optional => true do
|
566
|
+
gem "wirble"
|
567
|
+
gem "faker"
|
568
|
+
end
|
568
569
|
|
569
570
|
|
570
571
|
|
571
|
-
In
|
572
|
-
to
|
572
|
+
In the case of the group block form the :optional option can be given
|
573
|
+
to prevent a group from being installed unless listed in the --with
|
573
574
|
option given to the bundle install command.
|
574
575
|
|
575
|
-
In
|
576
|
-
|
577
|
-
block will inherit those options.
|
576
|
+
In the case of the git block form, the :ref, :branch, :tag, and
|
577
|
+
:submodules options may be passed to the git method, and all gems in
|
578
|
+
the block will inherit those options.
|
578
579
|
|
579
|
-
The
|
580
|
-
available
|
581
|
-
specify explicit sources. Thus, when
|
582
|
-
|
583
|
-
explicit
|
584
|
-
individual gems.
|
580
|
+
The presence of a source block in a Gemfile also makes that source
|
581
|
+
available as a possible global source for any other gems which do not
|
582
|
+
specify explicit sources. Thus, when defining source blocks, it is
|
583
|
+
recommended that you also ensure all other gems in the Gemfile are
|
584
|
+
using explicit sources, either via source blocks or :source directives
|
585
|
+
on individual gems.
|
585
586
|
|
586
587
|
INSTALL_IF
|
587
|
-
The
|
588
|
-
lambda.
|
588
|
+
The install_if method allows gems to be installed based on a proc or
|
589
|
+
lambda. This is especially useful for optional gems that can only be
|
589
590
|
used if certain software is installed or some other conditions are met.
|
590
591
|
|
591
592
|
|
592
593
|
|
593
|
-
|
594
|
-
|
595
|
-
|
594
|
+
install_if -> { RUBY_PLATFORM =~ /darwin/ } do
|
595
|
+
gem "pasteboard"
|
596
|
+
end
|
596
597
|
|
597
598
|
|
598
599
|
|
599
600
|
GEMSPEC
|
600
|
-
The
|
601
|
+
The .gemspec http://guides.rubygems.org/specification-reference/ file
|
601
602
|
is where you provide metadata about your gem to Rubygems. Some required
|
602
|
-
Gemspec
|
603
|
-
gem.
|
603
|
+
Gemspec attributes include the name, description, and homepage of your
|
604
|
+
gem. This is also where you specify the dependencies your gem needs to
|
604
605
|
run.
|
605
606
|
|
606
607
|
If you wish to use Bundler to help install dependencies for a gem while
|
607
|
-
it is
|
608
|
-
|
608
|
+
it is being developed, use the gemspec method to pull in the
|
609
|
+
dependencies listed in the .gemspec file.
|
609
610
|
|
610
611
|
The gemspec method adds any runtime dependencies as gem requirements in
|
611
|
-
the
|
612
|
-
requirements
|
613
|
-
|
614
|
-
this
|
615
|
-
if
|
616
|
-
load path manually or require project files via relative
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
612
|
+
the default group. It also adds development dependencies as gem
|
613
|
+
requirements in the development group. Finally, it adds a gem
|
614
|
+
requirement on your project (:path => '.'). In conjunction with
|
615
|
+
Bundler.setup, this allows you to require project files in your test
|
616
|
+
code as you would if the project were installed as a gem; you need not
|
617
|
+
manipulate the load path manually or require project files via relative
|
618
|
+
paths.
|
619
|
+
|
620
|
+
The gemspec method supports optional :path, :glob, :name, and
|
621
|
+
:development_group options, which control where bundler looks for the
|
622
|
+
.gemspec, the glob it uses to look for the gemspec (defaults to:
|
623
|
+
"{,,/*}.gemspec"), what named .gemspec it uses (if more than one is
|
624
|
+
present), and which group development dependencies are included in.
|
625
|
+
|
626
|
+
When a gemspec dependency encounters version conflicts during
|
627
|
+
resolution, the local version under development will always be selected
|
628
|
+
-- even if there are remote versions that better match other
|
629
|
+
requirements for the gemspec gem.
|
628
630
|
|
629
631
|
SOURCE PRIORITY
|
630
632
|
When attempting to locate a gem to satisfy a gem requirement, bundler
|
631
633
|
uses the following priority order:
|
632
634
|
|
633
635
|
1. The source explicitly attached to the gem (using :source, :path, or
|
634
|
-
|
636
|
+
:git)
|
635
637
|
|
636
638
|
2. For implicit gems (dependencies of explicit gems), any source, git,
|
637
|
-
|
638
|
-
|
639
|
-
|
639
|
+
or path repository declared on the parent. This results in bundler
|
640
|
+
prioritizing the ActiveSupport gem from the Rails git repository
|
641
|
+
over ones from rubygems.org
|
640
642
|
|
641
643
|
3. The sources specified via global source lines, searching each
|
642
|
-
|
644
|
+
source in your Gemfile from last added to first added.
|
643
645
|
|
644
646
|
|
645
647
|
|
646
648
|
|
647
649
|
|
648
650
|
|
649
|
-
|
651
|
+
July 2020 GEMFILE(5)
|