[rubygems/rubygems] Switch inject to use shorthand hash syntax
https://github.com/rubygems/rubygems/commit/ba5a62fd04
This commit is contained in:
parent
8acf0d7bcc
commit
71e340881f
Notes:
git
2025-03-10 03:43:59 +00:00
@ -35,8 +35,8 @@ module Bundler
|
|||||||
Bundler.ui.confirm(added.map do |d|
|
Bundler.ui.confirm(added.map do |d|
|
||||||
name = "'#{d.name}'"
|
name = "'#{d.name}'"
|
||||||
requirement = ", '#{d.requirement}'"
|
requirement = ", '#{d.requirement}'"
|
||||||
group = ", :group => #{d.groups.inspect}" if d.groups != Array(:default)
|
group = ", group: #{d.groups.inspect}" if d.groups != Array(:default)
|
||||||
source = ", :source => '#{d.source}'" unless d.source.nil?
|
source = ", source: '#{d.source}'" unless d.source.nil?
|
||||||
%(gem #{name}#{requirement}#{group}#{source})
|
%(gem #{name}#{requirement}#{group}#{source})
|
||||||
end.join("\n"))
|
end.join("\n"))
|
||||||
else
|
else
|
||||||
|
@ -55,7 +55,7 @@ Usage: "bundle inject GEM VERSION"
|
|||||||
it "add gem with source option in gemfile" do
|
it "add gem with source option in gemfile" do
|
||||||
bundle "inject 'foo' '>0' --source https://gem.repo1"
|
bundle "inject 'foo' '>0' --source https://gem.repo1"
|
||||||
gemfile = bundled_app_gemfile.read
|
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
|
expect(gemfile).to include str
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -64,14 +64,14 @@ Usage: "bundle inject GEM VERSION"
|
|||||||
it "add gem with group option in gemfile" do
|
it "add gem with group option in gemfile" do
|
||||||
bundle "inject 'myrack-obama' '>0' --group=development"
|
bundle "inject 'myrack-obama' '>0' --group=development"
|
||||||
gemfile = bundled_app_gemfile.read
|
gemfile = bundled_app_gemfile.read
|
||||||
str = "gem \"myrack-obama\", \"> 0\", :group => :development"
|
str = "gem \"myrack-obama\", \"> 0\", group: :development"
|
||||||
expect(gemfile).to include str
|
expect(gemfile).to include str
|
||||||
end
|
end
|
||||||
|
|
||||||
it "add gem with multiple groups in gemfile" do
|
it "add gem with multiple groups in gemfile" do
|
||||||
bundle "inject 'myrack-obama' '>0' --group=development,test"
|
bundle "inject 'myrack-obama' '>0' --group=development,test"
|
||||||
gemfile = bundled_app_gemfile.read
|
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
|
expect(gemfile).to include str
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user