Skip to content

Commit 6d2cf95

Browse files
bundle add --glob continued- quote glob value invocation in specs, add banner text for CLI recommending single quotes
1 parent 91052e5 commit 6d2cf95

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

bundler/lib/bundler/cli.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ def binstubs(*gems)
347347
method_option "github", type: :string
348348
method_option "branch", type: :string
349349
method_option "ref", type: :string
350-
method_option "glob", type: :string
350+
method_option "glob", type: :string, banner: "The location of a dependency's .gemspec, expanded within Ruby (single quotes recommended)"
351351
method_option "skip-install", type: :boolean, banner: "Adds gem to the Gemfile but does not install it"
352352
method_option "optimistic", type: :boolean, banner: "Adds optimistic declaration of version to gem"
353353
method_option "strict", type: :boolean, banner: "Adds strict declaration of version to gem"

bundler/spec/commands/add_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@
177177

178178
describe "with --git and --glob" do
179179
it "adds dependency with specified git source" do
180-
bundle "add foo --git=#{lib_path("foo-2.0")} --glob=./*.gemspec"
180+
bundle "add foo --git=#{lib_path("foo-2.0")} --glob='./*.gemspec'"
181181

182182
expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}", :glob => "\./\*\.gemspec"})
183183
expect(the_bundle).to include_gems "foo 2.0"
@@ -190,7 +190,7 @@
190190
end
191191

192192
it "adds dependency with specified git source and branch" do
193-
bundle "add foo --git=#{lib_path("foo-2.0")} --branch=test --glob=./*.gemspec"
193+
bundle "add foo --git=#{lib_path("foo-2.0")} --branch=test --glob='./*.gemspec'"
194194

195195
expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}", :branch => "test", :glob => "\./\*\.gemspec"})
196196
expect(the_bundle).to include_gems "foo 2.0"
@@ -199,7 +199,7 @@
199199

200200
describe "with --git and --ref and --glob" do
201201
it "adds dependency with specified git source and branch" do
202-
bundle "add foo --git=#{lib_path("foo-2.0")} --ref=#{revision_for(lib_path("foo-2.0"))} --glob=./*.gemspec"
202+
bundle "add foo --git=#{lib_path("foo-2.0")} --ref=#{revision_for(lib_path("foo-2.0"))} --glob='./*.gemspec'"
203203

204204
expect(bundled_app_gemfile.read).to match(%r{gem "foo", "~> 2\.0", :git => "#{lib_path("foo-2.0")}", :ref => "#{revision_for(lib_path("foo-2.0"))}", :glob => "\./\*\.gemspec"})
205205
expect(the_bundle).to include_gems "foo 2.0"
@@ -208,23 +208,23 @@
208208

209209
describe "with --github and --glob" do
210210
it "adds dependency with specified github source", :realworld do
211-
bundle "add rake --github=ruby/rake --glob=./*.gemspec"
211+
bundle "add rake --github=ruby/rake --glob='./*.gemspec'"
212212

213213
expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :glob => "\.\/\*\.gemspec"})
214214
end
215215
end
216216

217217
describe "with --github and --branch --and glob" do
218218
it "adds dependency with specified github source and branch", :realworld do
219-
bundle "add rake --github=ruby/rake --branch=master --glob=./*.gemspec"
219+
bundle "add rake --github=ruby/rake --branch=master --glob='./*.gemspec'"
220220

221221
expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :branch => "master", :glob => "\.\/\*\.gemspec"})
222222
end
223223
end
224224

225225
describe "with --github and --ref and --glob" do
226226
it "adds dependency with specified github source and ref", :realworld do
227-
bundle "add rake --github=ruby/rake --ref=5c60da8 --glob=./*.gemspec"
227+
bundle "add rake --github=ruby/rake --ref=5c60da8 --glob='./*.gemspec'"
228228

229229
expect(bundled_app_gemfile.read).to match(%r{gem "rake", "~> 13\.\d+", :github => "ruby\/rake", :ref => "5c60da8", :glob => "\.\/\*\.gemspec"})
230230
end

0 commit comments

Comments
 (0)