summaryrefslogtreecommitdiffstats
path: root/install.rb
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-07-09 18:05:07 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-09 18:05:07 -0700
commit184132e07fc1461555cb4da842df15f32842a843 (patch)
tree67085c1100b28991ee3b5f4745d67777acf8d075 /install.rb
parent9ee56f2e67be973da49b1d3f21de1bf87de35e6f (diff)
downloadpuppet-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 'install.rb')
-rwxr-xr-xinstall.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/install.rb b/install.rb
index 54a714674..18da2bebb 100755
--- a/install.rb
+++ b/install.rb
@@ -82,7 +82,7 @@ end
sbins = glob(%w{sbin/*})
bins = glob(%w{bin/*})
rdoc = glob(%w{bin/* sbin/* lib/**/*.rb README README-library CHANGELOG TODO Install}).reject { |e| e=~ /\.(bat|cmd)$/ }
-ri = glob(%w(bin/*.rb sbin/* lib/**/*.rb)).reject { |e| e=~ /\.(bat|cmd)$/ }
+ri = glob(%w{bin/*.rb sbin/* lib/**/*.rb}).reject { |e| e=~ /\.(bat|cmd)$/ }
man = glob(%w{man/man[0-9]/*})
libs = glob(%w{lib/**/*.rb lib/**/*.py})
tests = glob(%w{test/**/*.rb})