diff options
| author | Markus Roberts <Markus@reality.com> | 2010-07-09 18:05:07 -0700 |
|---|---|---|
| committer | Markus Roberts <Markus@reality.com> | 2010-07-09 18:05:07 -0700 |
| commit | 184132e07fc1461555cb4da842df15f32842a843 (patch) | |
| tree | 67085c1100b28991ee3b5f4745d67777acf8d075 /lib/puppet/application | |
| parent | 9ee56f2e67be973da49b1d3f21de1bf87de35e6f (diff) | |
| download | puppet-184132e07fc1461555cb4da842df15f32842a843.tar.gz puppet-184132e07fc1461555cb4da842df15f32842a843.tar.xz puppet-184132e07fc1461555cb4da842df15f32842a843.zip | |
Code smell: Use {} for % notation delimiters wherever practical
*
* Replaced 16 occurances of %([qQrwWx])\((.*?)\) with %\1{\2}
3 Examples:
The code:
# %r(/) != /\//
becomes:
# %r{/} != /\//
The code:
ri = glob(%w(bin/*.rb sbin/* lib/**/*.rb)).reject { |e| e=~ /\.(bat|cmd)$/ }
becomes:
ri = glob(%w{bin/*.rb sbin/* lib/**/*.rb}).reject { |e| e=~ /\.(bat|cmd)$/ }
The code:
if !FileUtils.uptodate?("/var/cache/eix", %w(/usr/bin/eix /usr/portage/metadata/timestamp))
becomes:
if !FileUtils.uptodate?("/var/cache/eix", %w{/usr/bin/eix /usr/portage/metadata/timestamp})
* Replaced 12 occurances of %([qQrwWx])\[(.*?)\] with %\1{\2}
3 Examples:
The code:
return send(command) if %w[get backup restore].include? command
becomes:
return send(command) if %w{get backup restore}.include? command
The code:
for iv in %w[indent space space_before object_nl array_nl check_circular allow_nan max_nesting]
becomes:
for iv in %w{indent space space_before object_nl array_nl check_circular allow_nan max_nesting}
The code:
@puppetd.command_line.stubs(:args).returns(%w[--logdest /my/file])
becomes:
@puppetd.command_line.stubs(:args).returns(%w{--logdest /my/file})
* Replaced no occurances of %([qQrwWx])<(.*?)> with %\1{\2}
* Replaced 19 occurances of
%([qQrwWx])([^{\[(<])(.*?)\2
with
%\1{\3}
3 Examples:
The code:
at.add_mapping(%r%^lib/puppet/(.*)\.rb$%) { |filename, m|
becomes:
at.add_mapping(%r{^lib/puppet/(.*)\.rb$}) { |filename, m|
The code:
at.add_mapping(%r%^spec/(unit|integration)/.*\.rb$%) { |filename, _|
becomes:
at.add_mapping(%r{^spec/(unit|integration)/.*\.rb$}) { |filename, _|
The code:
at.add_mapping(%r!^lib/puppet\.rb$!) { |filename, _|
becomes:
at.add_mapping(%r{^lib/puppet\.rb$}) { |filename, _|
Diffstat (limited to 'lib/puppet/application')
| -rw-r--r-- | lib/puppet/application/filebucket.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/application/filebucket.rb b/lib/puppet/application/filebucket.rb index 8f9e91771..842e172c1 100644 --- a/lib/puppet/application/filebucket.rb +++ b/lib/puppet/application/filebucket.rb @@ -15,7 +15,7 @@ class Puppet::Application::Filebucket < Puppet::Application def run_command @args = command_line.args command = args.shift - return send(command) if %w[get backup restore].include? command + return send(command) if %w{get backup restore}.include? command help end |
