summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Collins <[email protected]>2025-03-03 20:52:13 -0700
committerHiroshi SHIBATA <[email protected]>2025-03-10 12:43:36 +0900
commit71e340881f1aca4911a35ddafd519fb0e29e6544 (patch)
treece9e679fd2a0c51191fb8a03aec04d05b3fa747e
parent8acf0d7bcc2a55299bed00caee9679446f04e0d0 (diff)
[rubygems/rubygems] Switch inject to use shorthand hash syntax
https://github.com/rubygems/rubygems/commit/ba5a62fd04
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12890
-rw-r--r--lib/bundler/cli/inject.rb4
-rw-r--r--spec/bundler/commands/inject_spec.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/bundler/cli/inject.rb b/lib/bundler/cli/inject.rb
index 4838aba671..a09d5c6bda 100644
--- a/lib/bundler/cli/inject.rb
+++ b/lib/bundler/cli/inject.rb
@@ -35,8 +35,8 @@ module Bundler
Bundler.ui.confirm(added.map do |d|
name = "'#{d.name}'"
requirement = ", '#{d.requirement}'"
- group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
- source = ", :source => '#{d.source}'" unless d.source.nil?
+ group = ", group: #{d.groups.inspect}" if d.groups != Array(:default)
+ source = ", source: '#{d.source}'" unless d.source.nil?
%(gem #{name}#{requirement}#{group}#{source})
end.join("\n"))
else
diff --git a/spec/bundler/commands/inject_spec.rb b/spec/bundler/commands/inject_spec.rb
index 193806a02a..4998b6e89d 100644
--- a/spec/bundler/commands/inject_spec.rb
+++ b/spec/bundler/commands/inject_spec.rb
@@ -55,7 +55,7 @@ Usage: "bundle inject GEM VERSION"
it "add gem with source option in gemfile" do
bundle "inject 'foo' '>0' --source https://gem.repo1"
gemfile = bundled_app_gemfile.read
- str = "gem \"foo\", \"> 0\", :source => \"https://gem.repo1\""
+ str = "gem \"foo\", \"> 0\", source: \"https://gem.repo1\""
expect(gemfile).to include str
end
end
@@ -64,14 +64,14 @@ Usage: "bundle inject GEM VERSION"
it "add gem with group option in gemfile" do
bundle "inject 'myrack-obama' '>0' --group=development"
gemfile = bundled_app_gemfile.read
- str = "gem \"myrack-obama\", \"> 0\", :group => :development"
+ str = "gem \"myrack-obama\", \"> 0\", group: :development"
expect(gemfile).to include str
end
it "add gem with multiple groups in gemfile" do
bundle "inject 'myrack-obama' '>0' --group=development,test"
gemfile = bundled_app_gemfile.read
- str = "gem \"myrack-obama\", \"> 0\", :groups => [:development, :test]"
+ str = "gem \"myrack-obama\", \"> 0\", groups: [:development, :test]"
expect(gemfile).to include str
end
end