From c17a8392cfc341961f14d5b1668fe1c06ceba47a Mon Sep 17 00:00:00 2001 From: William Johnston Date: Sun, 28 Feb 2016 17:22:42 -0600 Subject: [PATCH] Fix Style/SpaceBeforeBlockBraces --- lib/capistrano/configuration/question.rb | 2 +- lib/capistrano/configuration/server.rb | 2 +- lib/capistrano/dsl/paths.rb | 2 +- spec/lib/capistrano/configuration/server_spec.rb | 4 ++-- spec/lib/capistrano/configuration/servers_spec.rb | 8 ++++---- spec/lib/capistrano/configuration_spec.rb | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/capistrano/configuration/question.rb b/lib/capistrano/configuration/question.rb index ad28f3a1..9cb695aa 100644 --- a/lib/capistrano/configuration/question.rb +++ b/lib/capistrano/configuration/question.rb @@ -35,7 +35,7 @@ module Capistrano if echo? $stdin.gets else - $stdin.noecho(&:gets).tap{ $stdout.print "\n" } + $stdin.noecho(&:gets).tap { $stdout.print "\n" } end rescue Errno::EIO # when stdio gets closed diff --git a/lib/capistrano/configuration/server.rb b/lib/capistrano/configuration/server.rb index 454e28eb..f3daa2ea 100644 --- a/lib/capistrano/configuration/server.rb +++ b/lib/capistrano/configuration/server.rb @@ -26,7 +26,7 @@ module Capistrano def select?(options) options.each do |k,v| - callable = v.respond_to?(:call) ? v: ->(server){ server.fetch(v) } + callable = v.respond_to?(:call) ? v: ->(server) { server.fetch(v) } result = \ case k when :filter, :select diff --git a/lib/capistrano/dsl/paths.rb b/lib/capistrano/dsl/paths.rb index f026d04f..b2218e82 100644 --- a/lib/capistrano/dsl/paths.rb +++ b/lib/capistrano/dsl/paths.rb @@ -54,7 +54,7 @@ module Capistrano end def repo_path - Pathname.new(fetch(:repo_path, ->(){ deploy_path.join("repo") })) + Pathname.new(fetch(:repo_path, ->() { deploy_path.join("repo") })) end def shared_path diff --git a/spec/lib/capistrano/configuration/server_spec.rb b/spec/lib/capistrano/configuration/server_spec.rb index 066b95cc..157de900 100644 --- a/spec/lib/capistrano/configuration/server_spec.rb +++ b/spec/lib/capistrano/configuration/server_spec.rb @@ -8,14 +8,14 @@ module Capistrano describe "adding a role" do subject { server.add_role(:test) } it "adds the role" do - expect{ subject }.to change{ server.roles.size }.from(0).to(1) + expect { subject }.to change { server.roles.size }.from(0).to(1) end end describe "adding roles" do subject { server.add_roles([:things, :stuff]) } it "adds the roles" do - expect{ subject }.to change{ server.roles.size }.from(0).to(2) + expect { subject }.to change { server.roles.size }.from(0).to(2) end end diff --git a/spec/lib/capistrano/configuration/servers_spec.rb b/spec/lib/capistrano/configuration/servers_spec.rb index 04ed1f96..48fbf984 100644 --- a/spec/lib/capistrano/configuration/servers_spec.rb +++ b/spec/lib/capistrano/configuration/servers_spec.rb @@ -8,8 +8,8 @@ module Capistrano describe "adding a role" do it "adds two new server instances" do - expect{ servers.add_role(:app, %w{1 2}) }. - to change{ servers.count }.from(0).to(2) + expect { servers.add_role(:app, %w{1 2}) }. + to change { servers.count }.from(0).to(2) end it "handles de-duplification within roles" do @@ -39,8 +39,8 @@ module Capistrano servers.add_host("1", :db => { :master => true }) expect(servers.count).to eq(2) expect(servers.roles_for([:db]).count).to eq 2 - expect(servers.find(){ |s| s.hostname == "1" }.properties.db).to eq({ :port => 1234, :master => true }) - expect(servers.find(){ |s| s.hostname == "2" }.properties.db).to eq({ :port => 1234 }) + expect(servers.find() { |s| s.hostname == "1" }.properties.db).to eq({ :port => 1234, :master => true }) + expect(servers.find() { |s| s.hostname == "2" }.properties.db).to eq({ :port => 1234 }) end end diff --git a/spec/lib/capistrano/configuration_spec.rb b/spec/lib/capistrano/configuration_spec.rb index 99a84353..fedd8721 100644 --- a/spec/lib/capistrano/configuration_spec.rb +++ b/spec/lib/capistrano/configuration_spec.rb @@ -57,7 +57,7 @@ module Capistrano end it "raises an exception when given both a value and block" do - expect{ config.set(:key, :value) { :value } }.to raise_error(Capistrano::ValidationError) + expect { config.set(:key, :value) { :value } }.to raise_error(Capistrano::ValidationError) end end @@ -155,7 +155,7 @@ module Capistrano end it "raises an exception" do - expect{ config.set(:key, "sho") }.to raise_error(Capistrano::ValidationError) + expect { config.set(:key, "sho") }.to raise_error(Capistrano::ValidationError) end end