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

Fix warnings reported by latest RuboCop (0.47)

This commit is contained in:
Matt Brictson 2017-01-20 08:38:01 -08:00
parent 3d9800d977
commit eb08215e87
No known key found for this signature in database
GPG key ID: 2F279EAD1F2ACFAF
3 changed files with 8 additions and 0 deletions

View file

@ -3,6 +3,10 @@ AllCops:
DisplayStyleGuide: true
TargetRubyVersion: 2.0
Metrics/BlockLength:
Exclude:
- "spec/**/*"
- "lib/**/*.rake"
Style/BarePercentLiterals:
EnforcedStyle: percent_q
Style/ClassAndModuleChildren:

View file

@ -17,10 +17,12 @@ module Capistrano
end
end
# rubocop:disable Security/MarshalLoad
def add_role(role, hosts, options={})
options_deepcopy = Marshal.dump(options.merge(roles: role))
Array(hosts).each { |host| add_host(host, Marshal.load(options_deepcopy)) }
end
# rubocop:enable Security/MarshalLoad
def roles_for(names)
options = extract_options(names)

View file

@ -59,10 +59,12 @@ module Capistrano
VersionValidator.new(locked_version).verify
end
# rubocop:disable Security/MarshalLoad
def on(hosts, options={}, &block)
subset_copy = Marshal.dump(Configuration.env.filter(hosts))
SSHKit::Coordinator.new(Marshal.load(subset_copy)).each(options, &block)
end
# rubocop:enable Security/MarshalLoad
def run_locally(&block)
SSHKit::Backend::Local.new(&block).run