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:
parent
3d9800d977
commit
eb08215e87
3 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,10 @@ AllCops:
|
|||
DisplayStyleGuide: true
|
||||
TargetRubyVersion: 2.0
|
||||
|
||||
Metrics/BlockLength:
|
||||
Exclude:
|
||||
- "spec/**/*"
|
||||
- "lib/**/*.rake"
|
||||
Style/BarePercentLiterals:
|
||||
EnforcedStyle: percent_q
|
||||
Style/ClassAndModuleChildren:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue