1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Fix Style/SpaceBeforeBlockBraces

This commit is contained in:
William Johnston 2016-02-28 17:22:42 -06:00
parent ff9e0ac3a3
commit c17a8392cf
6 changed files with 11 additions and 11 deletions

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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