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

Use %Q instead of bare % for string literals

This commit is contained in:
Matt Brictson 2016-03-01 20:13:57 -08:00
parent 04238cb040
commit f90f9a03f5
4 changed files with 5 additions and 3 deletions

View file

@ -3,6 +3,8 @@ AllCops:
DisplayStyleGuide: true DisplayStyleGuide: true
TargetRubyVersion: 2.0 TargetRubyVersion: 2.0
Style/BarePercentLiterals:
EnforcedStyle: percent_q
Style/ClassAndModuleChildren: Style/ClassAndModuleChildren:
Enabled: false Enabled: false
Style/DoubleNegation: Style/DoubleNegation:

View file

@ -12,7 +12,7 @@ module RemoteCommandHelpers
end end
def exists?(type, path) def exists?(type, path)
%{[ -#{type} "#{path}" ]} %Q{[ -#{type} "#{path}" ]}
end end
def safely_remove_file(_path) def safely_remove_file(_path)

View file

@ -1,7 +1,7 @@
validate :application do |_key, value| validate :application do |_key, value|
changed_value = value.gsub(/[^A-Z0-9\.\-]/i, "_") changed_value = value.gsub(/[^A-Z0-9\.\-]/i, "_")
if value != changed_value if value != changed_value
warn %(The :application value "#{value}" is invalid!) warn %Q(The :application value "#{value}" is invalid!)
warn "Use only letters, numbers, hyphens, dots, and underscores. For example:" warn "Use only letters, numbers, hyphens, dots, and underscores. For example:"
warn " set :application, '#{changed_value}'" warn " set :application, '#{changed_value}'"
raise Capistrano::ValidationError raise Capistrano::ValidationError

View file

@ -192,7 +192,7 @@ namespace :deploy do
task :log_revision do task :log_revision do
on release_roles(:all) do on release_roles(:all) do
within releases_path do within releases_path do
execute :echo, %{"#{revision_log_message}" >> #{revision_log}} execute :echo, %Q{"#{revision_log_message}" >> #{revision_log}}
end end
end end
end end