diff options
author | Erick Sasse <esasse@gmail.com> | 2015-07-17 19:33:19 -0300 |
---|---|---|
committer | Erick Sasse <esasse@gmail.com> | 2015-07-17 19:33:19 -0300 |
commit | 01f76e52a073361dd56dbb9b5a4b71e81c88838d (patch) | |
tree | 889e687d30a72bf3322275876770baf735b1f31e | |
parent | 7515ea86066b0f81f93a212b22a2219605aa7e75 (diff) | |
download | bundler-01f76e52a073361dd56dbb9b5a4b71e81c88838d.tar.gz |
Fix Style/SpaceInsideHashLiteralBraces
-rw-r--r-- | .rubocop_todo.yml | 6 | ||||
-rw-r--r-- | lib/bundler/fetcher/dependency.rb | 2 | ||||
-rw-r--r-- | lib/bundler/graph.rb | 10 | ||||
-rw-r--r-- | lib/bundler/settings.rb | 2 | ||||
-rw-r--r-- | spec/bundler/fetcher_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/exec_spec.rb | 4 | ||||
-rw-r--r-- | spec/commands/open_spec.rb | 20 | ||||
-rw-r--r-- | spec/commands/viz_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/gemfile/git_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/gemfile/path_spec.rb | 2 | ||||
-rw-r--r-- | spec/install/gems/dependency_api_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/gems/resolving_spec.rb | 4 | ||||
-rw-r--r-- | spec/install/gems/sudo_spec.rb | 4 | ||||
-rw-r--r-- | spec/realworld/parallel_spec.rb | 4 | ||||
-rw-r--r-- | spec/runtime/setup_spec.rb | 6 |
15 files changed, 37 insertions, 43 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f36f1340..5fd5a0cd 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -470,12 +470,6 @@ Style/SpaceInsideBlockBraces: Style/SpaceInsideBrackets: Enabled: false -# Offense count: 72 -# Cop supports --auto-correct. -# Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SupportedStyles. -Style/SpaceInsideHashLiteralBraces: - Enabled: false - # Offense count: 4 # Cop supports --auto-correct. Style/SpaceInsideStringInterpolation: diff --git a/lib/bundler/fetcher/dependency.rb b/lib/bundler/fetcher/dependency.rb index 2f5d41da..c041ef23 100644 --- a/lib/bundler/fetcher/dependency.rb +++ b/lib/bundler/fetcher/dependency.rb @@ -27,7 +27,7 @@ module Bundler Bundler.ui.info ".", false end - return {remote_uri => last_spec_list} if query_list.empty? + return { remote_uri => last_spec_list } if query_list.empty? remote_specs = Bundler::Retry.new("dependency api", AUTH_ERRORS).attempts do dependency_specs(query_list) diff --git a/lib/bundler/graph.rb b/lib/bundler/graph.rb index a89cd1c7..8b1b36d3 100644 --- a/lib/bundler/graph.rb +++ b/lib/bundler/graph.rb @@ -124,7 +124,7 @@ module Bundler end def g - @g ||= ::GraphViz.digraph(@graph_name, {:concentrate => true, :normalize => true, :nodesep => 0.55}) do |g| + @g ||= ::GraphViz.digraph(@graph_name, { :concentrate => true, :normalize => true, :nodesep => 0.55 }) do |g| g.edge[:weight] = 2 g.edge[:fontname] = g.node[:fontname] = "Arial, Helvetica, SansSerif" g.edge[:fontsize] = 12 @@ -135,18 +135,18 @@ module Bundler @groups.each do |group| g.add_nodes( group, - {:style => "filled", + { :style => "filled", :fillcolor => "#B9B9D5", :shape => "box3d", - :fontsize => 16}.merge(@node_options[group]) + :fontsize => 16 }.merge(@node_options[group]) ) end @relations.each do |parent, children| children.each do |child| if @groups.include?(parent) - g.add_nodes(child, {:style => "filled", :fillcolor => "#B9B9D5"}.merge(@node_options[child])) - g.add_edges(parent, child, {:constraint => false}.merge(@edge_options["#{parent}_#{child}"])) + g.add_nodes(child, { :style => "filled", :fillcolor => "#B9B9D5" }.merge(@node_options[child])) + g.add_edges(parent, child, { :constraint => false }.merge(@edge_options["#{parent}_#{child}"])) else g.add_nodes(child, @node_options[child]) g.add_edges(parent, child, @edge_options["#{parent}_#{child}"]) diff --git a/lib/bundler/settings.rb b/lib/bundler/settings.rb index a4f2a9cf..981ba447 100644 --- a/lib/bundler/settings.rb +++ b/lib/bundler/settings.rb @@ -4,7 +4,7 @@ module Bundler class Settings BOOL_KEYS = %w(frozen cache_all no_prune disable_local_branch_check ignore_messages gem.mit gem.coc).freeze NUMBER_KEYS = %w(retry timeout redirect).freeze - DEFAULT_CONFIG = {:retry => 3, :timeout => 10, :redirect => 5} + DEFAULT_CONFIG = { :retry => 3, :timeout => 10, :redirect => 5 } def initialize(root = nil) @root = root diff --git a/spec/bundler/fetcher_spec.rb b/spec/bundler/fetcher_spec.rb index 4df9018d..f3125623 100644 --- a/spec/bundler/fetcher_spec.rb +++ b/spec/bundler/fetcher_spec.rb @@ -19,14 +19,14 @@ describe Bundler::Fetcher do describe "include CI information" do it "from one CI" do - with_env_vars({"JENKINS_URL" => "foo"}) do + with_env_vars({ "JENKINS_URL" => "foo" }) do ci_part = fetcher.user_agent.split(" ").find{|x| x.match(/\Aci\//)} expect(ci_part).to match("jenkins") end end it "from many CI" do - with_env_vars({"TRAVIS" => "foo", "CI_NAME" => "my_ci"}) do + with_env_vars({ "TRAVIS" => "foo", "CI_NAME" => "my_ci" }) do ci_part = fetcher.user_agent.split(" ").find{|x| x.match(/\Aci\//)} expect(ci_part).to match("travis") expect(ci_part).to match("my_ci") diff --git a/spec/commands/exec_spec.rb b/spec/commands/exec_spec.rb index dbaed9bc..e11b075a 100644 --- a/spec/commands/exec_spec.rb +++ b/spec/commands/exec_spec.rb @@ -164,7 +164,7 @@ describe "bundle exec" do bundle "exec 'echo $RUBYOPT'" expect(out).to have_rubyopts(rubyopt) - bundle "exec 'echo $RUBYOPT'", :env => {"RUBYOPT" => rubyopt} + bundle "exec 'echo $RUBYOPT'", :env => { "RUBYOPT" => rubyopt } expect(out).to have_rubyopts(rubyopt) end @@ -180,7 +180,7 @@ describe "bundle exec" do bundle "exec 'echo $RUBYLIB'" expect(out).to eq(rubylib) - bundle "exec 'echo $RUBYLIB'", :env => {"RUBYLIB" => rubylib} + bundle "exec 'echo $RUBYLIB'", :env => { "RUBYLIB" => rubylib } expect(out).to eq(rubylib) end diff --git a/spec/commands/open_spec.rb b/spec/commands/open_spec.rb index 1880ae30..b9d8274e 100644 --- a/spec/commands/open_spec.rb +++ b/spec/commands/open_spec.rb @@ -9,27 +9,27 @@ describe "bundle open" do end it "opens the gem with BUNDLER_EDITOR as highest priority" do - bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"} + bundle "open rails", :env => { "EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor" } expect(out).to eq("bundler_editor #{default_bundle_path("gems", "rails-2.3.2")}") end it "opens the gem with VISUAL as 2nd highest priority" do - bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => ""} + bundle "open rails", :env => { "EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "" } expect(out).to eq("visual #{default_bundle_path("gems", "rails-2.3.2")}") end it "opens the gem with EDITOR as 3rd highest priority" do - bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""} + bundle "open rails", :env => { "EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => "" } expect(out).to eq("editor #{default_bundle_path("gems", "rails-2.3.2")}") end it "complains if no EDITOR is set" do - bundle "open rails", :env => {"EDITOR" => "", "VISUAL" => "", "BUNDLER_EDITOR" => ""} + bundle "open rails", :env => { "EDITOR" => "", "VISUAL" => "", "BUNDLER_EDITOR" => "" } expect(out).to eq("To open a bundled gem, set $EDITOR or $BUNDLER_EDITOR") end it "complains if gem not in bundle" do - bundle "open missing", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""} + bundle "open missing", :env => { "EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => "" } expect(out).to match(/could not find gem 'missing'/i) end @@ -42,23 +42,23 @@ describe "bundle open" do gem 'foo', :git => "#{lib_path("foo-1.0")}" G - bundle "open foo", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""} + bundle "open foo", :env => { "EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => "" } expect(out).to match("editor #{default_bundle_path.join("bundler/gems/foo-1.0-#{ref}")}") end it "suggests alternatives for similar-sounding gems" do - bundle "open Rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""} + bundle "open Rails", :env => { "EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => "" } expect(out).to match(/did you mean rails\?/i) end it "opens the gem with short words" do - bundle "open rec" , :env => {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"} + bundle "open rec" , :env => { "EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor" } expect(out).to eq("bundler_editor #{default_bundle_path("gems", "activerecord-2.3.2")}") end it "select the gem from many match gems" do - env = {"EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor"} + env = { "EDITOR" => "echo editor", "VISUAL" => "echo visual", "BUNDLER_EDITOR" => "echo bundler_editor" } bundle "open active" , :env => env do |input| input.puts "2" end @@ -74,7 +74,7 @@ describe "bundle open" do G bundle "config auto_install 1" - bundle "open rails", :env => {"EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => ""} + bundle "open rails", :env => { "EDITOR" => "echo editor", "VISUAL" => "", "BUNDLER_EDITOR" => "" } expect(out).to include("Installing foo 1.0") end end diff --git a/spec/commands/viz_spec.rb b/spec/commands/viz_spec.rb index cd77efc1..2052fd27 100644 --- a/spec/commands/viz_spec.rb +++ b/spec/commands/viz_spec.rb @@ -13,7 +13,7 @@ describe "bundle viz", :ruby => "1.9.3", :if => Bundler.which("dot") do gem "rack-obama" G - bundle "viz", :env => {"RUBYOPT" => "-I #{graphviz_lib}"} + bundle "viz", :env => { "RUBYOPT" => "-I #{graphviz_lib}" } expect(out).to include("gem_graph.png") end @@ -28,7 +28,7 @@ describe "bundle viz", :ruby => "1.9.3", :if => Bundler.which("dot") do gem "rack-obama" G - bundle "viz", :env => {"RUBYOPT" => "-I #{graphviz_lib}"} + bundle "viz", :env => { "RUBYOPT" => "-I #{graphviz_lib}" } expect(out).to include("gem_graph.png") end end diff --git a/spec/install/gemfile/git_spec.rb b/spec/install/gemfile/git_spec.rb index 6baaf5f3..6a77768f 100644 --- a/spec/install/gemfile/git_spec.rb +++ b/spec/install/gemfile/git_spec.rb @@ -959,7 +959,7 @@ describe "bundle install with git sources" do end G - bundle "update", :env => {"PATH" => ""} + bundle "update", :env => { "PATH" => "" } expect(out).to include("You need to install git to be able to use gems from git repositories. For help installing git, please refer to GitHub's tutorial at https://help.github.com/articles/set-up-git") end @@ -974,7 +974,7 @@ describe "bundle install with git sources" do bundle "package --all" simulate_new_machine - bundle "install", :env => {"PATH" => ""} + bundle "install", :env => { "PATH" => "" } expect(out).to_not include("You need to install git to be able to use gems from git repositories.") expect(exitstatus).to be_zero if exitstatus end diff --git a/spec/install/gemfile/path_spec.rb b/spec/install/gemfile/path_spec.rb index 837a3d47..486ff85b 100644 --- a/spec/install/gemfile/path_spec.rb +++ b/spec/install/gemfile/path_spec.rb @@ -468,7 +468,7 @@ describe "bundle install with explicit source paths" do File.open(lib_path("private_lib/Gemfile"), "w") {|f| f.puts gemfile } Dir.chdir(lib_path("private_lib")) do - bundle :install, :env => {"DEBUG" => 1}, :artifice => "endpoint" + bundle :install, :env => { "DEBUG" => 1 }, :artifice => "endpoint" expect(out).to match(/^HTTP GET http:\/\/localgemserver\.test\/api\/v1\/dependencies\?gems=rack$/) expect(out).not_to match(/^HTTP GET.*private_lib/) should_be_installed "private_lib 2.2" diff --git a/spec/install/gems/dependency_api_spec.rb b/spec/install/gems/dependency_api_spec.rb index 30746416..2d68bc25 100644 --- a/spec/install/gems/dependency_api_spec.rb +++ b/spec/install/gems/dependency_api_spec.rb @@ -618,7 +618,7 @@ describe "gemcutter's dependency API" do gem "rack" G - bundle :install, :env => {"RUBYOPT" => "-I#{bundled_app("broken_ssl")}"} + bundle :install, :env => { "RUBYOPT" => "-I#{bundled_app("broken_ssl")}" } expect(out).to include("OpenSSL") end end @@ -646,7 +646,7 @@ describe "gemcutter's dependency API" do context ".gemrc with sources is present" do before do File.open(home(".gemrc"), "w") do |file| - file.puts({:sources => ["https://rubygems.org"]}.to_yaml) + file.puts({ :sources => ["https://rubygems.org"] }.to_yaml) end end diff --git a/spec/install/gems/resolving_spec.rb b/spec/install/gems/resolving_spec.rb index d458fc9a..7ef2535e 100644 --- a/spec/install/gems/resolving_spec.rb +++ b/spec/install/gems/resolving_spec.rb @@ -77,7 +77,7 @@ describe "bundle install with gem sources" do G resolve_output = capture(:stdout) do - bundle :install, :env => {"DEBUG_RESOLVER" => "1"} + bundle :install, :env => { "DEBUG_RESOLVER" => "1" } end expect(resolve_output).to include("Creating possibility state for net_c") @@ -93,7 +93,7 @@ describe "bundle install with gem sources" do G resolve_output = capture(:stdout) do - bundle :install, :env => {"DEBUG_RESOLVER_TREE" => "1"} + bundle :install, :env => { "DEBUG_RESOLVER_TREE" => "1" } end expect(resolve_output).to include(" net_b (>= 0) ruby") diff --git a/spec/install/gems/sudo_spec.rb b/spec/install/gems/sudo_spec.rb index 009b63b4..640572ed 100644 --- a/spec/install/gems/sudo_spec.rb +++ b/spec/install/gems/sudo_spec.rb @@ -136,9 +136,9 @@ describe "when using sudo", :sudo => true do gem "rack", '1.0' G - bundle :install, :env => {"GEM_HOME" => gem_home.to_s, "GEM_PATH" => nil} + bundle :install, :env => { "GEM_HOME" => gem_home.to_s, "GEM_PATH" => nil } expect(gem_home.join("bin/rackup")).to exist - should_be_installed "rack 1.0", :env => {"GEM_HOME" => gem_home.to_s, "GEM_PATH" => nil} + should_be_installed "rack 1.0", :env => { "GEM_HOME" => gem_home.to_s, "GEM_PATH" => nil } end end diff --git a/spec/realworld/parallel_spec.rb b/spec/realworld/parallel_spec.rb index 86312250..f168a065 100644 --- a/spec/realworld/parallel_spec.rb +++ b/spec/realworld/parallel_spec.rb @@ -9,7 +9,7 @@ describe "parallel", :realworld => true do gem 'i18n', '~> 0.6.0' # Because 0.7+ requires Ruby 1.9.3+ G - bundle :install, :jobs => 4, :env => {"DEBUG" => "1"} + bundle :install, :jobs => 4, :env => { "DEBUG" => "1" } if Bundler.rubygems.provides?(">= 2.1.0") expect(out).to match(/[1-3]: /) @@ -41,7 +41,7 @@ describe "parallel", :realworld => true do gem 'i18n', '~> 0.6.0' # Because 0.7+ requires Ruby 1.9.3+ G - bundle :update, :jobs => 4, :env => {"DEBUG" => "1"} + bundle :update, :jobs => 4, :env => { "DEBUG" => "1" } if Bundler.rubygems.provides?(">= 2.1.0") expect(out).to match(/[1-3]: /) diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb index 9bee4fab..d4517805 100644 --- a/spec/runtime/setup_spec.rb +++ b/spec/runtime/setup_spec.rb @@ -292,7 +292,7 @@ describe "Bundler.setup" do context "when the ruby stdlib is a substring of Gem.path" do it "does not reject the stdlib from $LOAD_PATH" do substring = "/" + $LOAD_PATH.find{|p| p =~ /vendor_ruby/ }.split("/")[2] - run "puts 'worked!'", :env => {"GEM_PATH" => substring} + run "puts 'worked!'", :env => { "GEM_PATH" => substring } expect(out).to eq("worked!") end end @@ -707,7 +707,7 @@ describe "Bundler.setup" do G Dir.chdir(bundled_app.parent) do - run <<-R, :env => {"BUNDLE_GEMFILE" => bundled_app("Gemfile")} + run <<-R, :env => { "BUNDLE_GEMFILE" => bundled_app("Gemfile") } require 'foo' R end @@ -731,7 +731,7 @@ describe "Bundler.setup" do bundle :install Dir.chdir(bundled_app.parent) do - run <<-R, :env => {"BUNDLE_GEMFILE" => bundled_app("Gemfile")} + run <<-R, :env => { "BUNDLE_GEMFILE" => bundled_app("Gemfile") } require 'foo' R end |