mirror of
https://github.com/capistrano/capistrano
synced 2023-03-27 23:21:18 -04:00
Enable SpaceAfterComma cop
This commit is contained in:
parent
90574e065b
commit
a39277bb6f
11 changed files with 23 additions and 25 deletions
|
@ -23,8 +23,6 @@ Style/AndOr:
|
|||
Enabled: false
|
||||
Style/Documentation:
|
||||
Enabled: false
|
||||
Style/SpaceAfterComma:
|
||||
Enabled: false
|
||||
Style/RegexpLiteral:
|
||||
Enabled: false
|
||||
Style/SignalException:
|
||||
|
|
|
@ -98,7 +98,7 @@ module Capistrano
|
|||
|
||||
# allows the `cap install` task to load without a capfile
|
||||
def capfile
|
||||
File.expand_path(File.join(File.dirname(__FILE__),"..","Capfile"))
|
||||
File.expand_path(File.join(File.dirname(__FILE__), "..", "Capfile"))
|
||||
end
|
||||
|
||||
def version
|
||||
|
|
|
@ -118,7 +118,7 @@ module Capistrano
|
|||
sshkit.backend.configure do |backend|
|
||||
backend.pty = fetch(:pty)
|
||||
backend.connection_timeout = fetch(:connection_timeout)
|
||||
backend.ssh_options = (backend.ssh_options || {}).merge(fetch(:ssh_options,{}))
|
||||
backend.ssh_options = (backend.ssh_options || {}).merge(fetch(:ssh_options, {}))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -131,7 +131,7 @@ module Capistrano
|
|||
@filters = cmdline_filters.clone
|
||||
@filters << Filter.new(:role, ENV["ROLES"]) if ENV["ROLES"]
|
||||
@filters << Filter.new(:host, ENV["HOSTS"]) if ENV["HOSTS"]
|
||||
fh = fetch_for(:filter,{}) || {}
|
||||
fh = fetch_for(:filter, {}) || {}
|
||||
@filters << Filter.new(:host, fh[:hosts]) if fh[:hosts]
|
||||
@filters << Filter.new(:role, fh[:roles]) if fh[:roles]
|
||||
@filters << Filter.new(:host, fh[:host]) if fh[:host]
|
||||
|
@ -144,7 +144,7 @@ module Capistrano
|
|||
|
||||
def filter(list)
|
||||
setup_filters if @filters.nil?
|
||||
@filters.reduce(list) { |l,f| f.filter l }
|
||||
@filters.reduce(list) { |l, f| f.filter l }
|
||||
end
|
||||
|
||||
private
|
||||
|
|
|
@ -25,7 +25,7 @@ module Capistrano
|
|||
end
|
||||
|
||||
def select?(options)
|
||||
options.each do |k,v|
|
||||
options.each do |k, v|
|
||||
callable = v.respond_to?(:call) ? v : ->(server) { server.fetch(v) }
|
||||
result = \
|
||||
case k
|
||||
|
|
|
@ -1 +1 @@
|
|||
load File.expand_path(File.join(File.dirname(__FILE__),"tasks/install.rake"))
|
||||
load File.expand_path(File.join(File.dirname(__FILE__), "tasks/install.rake"))
|
||||
|
|
|
@ -110,7 +110,7 @@ describe Capistrano::DSL do
|
|||
subject { dsl.roles(:app) }
|
||||
it "ignores it" do
|
||||
dsl.set :filter, :role => :web
|
||||
expect(subject.map(&:hostname)).to eq(["example3.com","example4.com"])
|
||||
expect(subject.map(&:hostname)).to eq(["example3.com", "example4.com"])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -118,7 +118,7 @@ describe Capistrano::DSL do
|
|||
subject { dsl.roles(:app) }
|
||||
it "ignores it" do
|
||||
dsl.set :filter, :role => :web, :host => "example1.com"
|
||||
expect(subject.map(&:hostname)).to eq(["example3.com","example4.com"])
|
||||
expect(subject.map(&:hostname)).to eq(["example3.com", "example4.com"])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -142,7 +142,7 @@ describe Capistrano::DSL do
|
|||
subject { dsl.roles(:app) }
|
||||
it "ignores it" do
|
||||
dsl.set :filter, :roles => :web
|
||||
expect(subject.map(&:hostname)).to eq(["example3.com","example4.com"])
|
||||
expect(subject.map(&:hostname)).to eq(["example3.com", "example4.com"])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -150,7 +150,7 @@ describe Capistrano::DSL do
|
|||
subject { dsl.roles(:app) }
|
||||
it "ignores it" do
|
||||
dsl.set :filter, :roles => :web, :hosts => "example1.com"
|
||||
expect(subject.map(&:hostname)).to eq(["example3.com","example4.com"])
|
||||
expect(subject.map(&:hostname)).to eq(["example3.com", "example4.com"])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -585,7 +585,7 @@ describe Capistrano::DSL do
|
|||
|
||||
it "retrieves properties for multiple roles as a set" do
|
||||
rps = dsl.role_properties(:app, :web)
|
||||
expect(rps).to eq(Set[{ :hostname => "example3.com", :role => :app },{ :hostname => "example1.com", :role => :web, :port => 80 },{ :hostname => "example2.com", :role => :web, :port => 81 }])
|
||||
expect(rps).to eq(Set[{ :hostname => "example3.com", :role => :app }, { :hostname => "example1.com", :role => :web, :port => 80 }, { :hostname => "example2.com", :role => :web, :port => 81 }])
|
||||
end
|
||||
|
||||
it "yields the properties for a single role" do
|
||||
|
|
|
@ -4,7 +4,7 @@ module Capistrano
|
|||
class Configuration
|
||||
describe Filter do
|
||||
let(:available) {
|
||||
[Server.new("server1").add_roles([:web,:db]),
|
||||
[Server.new("server1").add_roles([:web, :db]),
|
||||
Server.new("server2").add_role(:web),
|
||||
Server.new("server3").add_role(:redis),
|
||||
Server.new("server4").add_role(:db),
|
||||
|
|
|
@ -6,7 +6,7 @@ module Capistrano
|
|||
subject(:role_filter) { RoleFilter.new(values) }
|
||||
|
||||
let(:available) {
|
||||
[Server.new("server1").add_roles([:web,:db]),
|
||||
[Server.new("server1").add_roles([:web, :db]),
|
||||
Server.new("server2").add_role(:web),
|
||||
Server.new("server3").add_role(:redis),
|
||||
Server.new("server4").add_role(:db),
|
||||
|
|
|
@ -167,22 +167,22 @@ module Capistrano
|
|||
end
|
||||
|
||||
it "concatenates previously defined array properties" do
|
||||
servers.add_host("1", :roles => [:b], :steps => [1,3,5])
|
||||
servers.add_host("1", :roles => [:b], :steps => [1,9])
|
||||
servers.add_host("1", :roles => [:b], :steps => [1, 3, 5])
|
||||
servers.add_host("1", :roles => [:b], :steps => [1, 9])
|
||||
expect(servers.count).to eq(1)
|
||||
expect(servers.roles_for([:b]).first.properties.steps).to eq([1,3,5,1,9])
|
||||
expect(servers.roles_for([:b]).first.properties.steps).to eq([1, 3, 5, 1, 9])
|
||||
end
|
||||
|
||||
it "merges previously defined set properties" do
|
||||
servers.add_host("1", :roles => [:b], :endpoints => Set[123,333])
|
||||
servers.add_host("1", :roles => [:b], :endpoints => Set[222,333])
|
||||
servers.add_host("1", :roles => [:b], :endpoints => Set[123, 333])
|
||||
servers.add_host("1", :roles => [:b], :endpoints => Set[222, 333])
|
||||
expect(servers.count).to eq(1)
|
||||
expect(servers.roles_for([:b]).first.properties.endpoints).to eq(Set[123,222,333])
|
||||
expect(servers.roles_for([:b]).first.properties.endpoints).to eq(Set[123, 222, 333])
|
||||
end
|
||||
|
||||
it "adds array property value only ones for a new host" do
|
||||
servers.add_host("2", :roles => [:array_test], :array_property => [1,2])
|
||||
expect(servers.roles_for([:array_test]).first.properties.array_property).to eq [1,2]
|
||||
servers.add_host("2", :roles => [:array_test], :array_property => [1, 2])
|
||||
expect(servers.roles_for([:array_test]).first.properties.array_property).to eq [1, 2]
|
||||
end
|
||||
|
||||
it "updates roles when custom user defined" do
|
||||
|
|
|
@ -88,7 +88,7 @@ describe Capistrano::DSL::Paths do
|
|||
|
||||
context "where the release path has been set" do
|
||||
before do
|
||||
dsl.set(:release_path,"/var/www/release_path")
|
||||
dsl.set(:release_path, "/var/www/release_path")
|
||||
end
|
||||
|
||||
it "returns the set `release_path` value" do
|
||||
|
|
2
spec/support/Vagrantfile
vendored
2
spec/support/Vagrantfile
vendored
|
@ -10,7 +10,7 @@ Vagrant.configure("2") do |config|
|
|||
primary.vm.network "forwarded_port", :guest => 22, :host => "222#{i}".to_i
|
||||
primary.vm.provision :shell, :inline => "sudo apt-get -y install git-core"
|
||||
|
||||
vagrantkey = open("https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub", "r",&:read)
|
||||
vagrantkey = open("https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub", "r", &:read)
|
||||
|
||||
primary.vm.provision :shell,
|
||||
:inline => <<-INLINE
|
||||
|
|
Loading…
Reference in a new issue