Skip to content

Commit 71e3408

Browse files
cllnshsbt
authored andcommitted
[rubygems/rubygems] Switch inject to use shorthand hash syntax
ruby/rubygems@ba5a62fd04
1 parent 8acf0d7 commit 71e3408

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/bundler/cli/inject.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def run
3535
Bundler.ui.confirm(added.map do |d|
3636
name = "'#{d.name}'"
3737
requirement = ", '#{d.requirement}'"
38-
group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
39-
source = ", :source => '#{d.source}'" unless d.source.nil?
38+
group = ", group: #{d.groups.inspect}" if d.groups != Array(:default)
39+
source = ", source: '#{d.source}'" unless d.source.nil?
4040
%(gem #{name}#{requirement}#{group}#{source})
4141
end.join("\n"))
4242
else

spec/bundler/commands/inject_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
it "add gem with source option in gemfile" do
5656
bundle "inject 'foo' '>0' --source https://gem.repo1"
5757
gemfile = bundled_app_gemfile.read
58-
str = "gem \"foo\", \"> 0\", :source => \"https://gem.repo1\""
58+
str = "gem \"foo\", \"> 0\", source: \"https://gem.repo1\""
5959
expect(gemfile).to include str
6060
end
6161
end
@@ -64,14 +64,14 @@
6464
it "add gem with group option in gemfile" do
6565
bundle "inject 'myrack-obama' '>0' --group=development"
6666
gemfile = bundled_app_gemfile.read
67-
str = "gem \"myrack-obama\", \"> 0\", :group => :development"
67+
str = "gem \"myrack-obama\", \"> 0\", group: :development"
6868
expect(gemfile).to include str
6969
end
7070

7171
it "add gem with multiple groups in gemfile" do
7272
bundle "inject 'myrack-obama' '>0' --group=development,test"
7373
gemfile = bundled_app_gemfile.read
74-
str = "gem \"myrack-obama\", \"> 0\", :groups => [:development, :test]"
74+
str = "gem \"myrack-obama\", \"> 0\", groups: [:development, :test]"
7575
expect(gemfile).to include str
7676
end
7777
end

0 commit comments

Comments
 (0)