summaryrefslogtreecommitdiffstats
path: root/lib/puppet/network/handler
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2010-07-09 18:06:48 -0700
committerMarkus Roberts <Markus@reality.com>2010-07-09 18:06:48 -0700
commit42a539061293f8e745a9dc5b97b4415b6a275e04 (patch)
treefb268244b7ca95dd36e8136bcd3c02fd2a05632f /lib/puppet/network/handler
parenta07bbe2e711ee22a40e147c046997c8813ae3cc8 (diff)
Code smell: Use ||= for conditional initialization
Replaced 55 occurances of ([$@]?\w+) += +(.*) +(if +\1.nil\?|if +! *\1|unless +\1|unless +defined\?\(\1\))$ with \1 ||= \2 3 Examples: The code: @sync becomes: @sync The code: becomes: The code: if @yydebug becomes: if @yydebug
Diffstat (limited to 'lib/puppet/network/handler')
-rwxr-xr-xlib/puppet/network/handler/fileserver.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/network/handler/fileserver.rb b/lib/puppet/network/handler/fileserver.rb
index efd71223f..1131e434a 100755
--- a/lib/puppet/network/handler/fileserver.rb
+++ b/lib/puppet/network/handler/fileserver.rb
@@ -701,7 +701,7 @@ class Puppet::Network::Handler
if modpath = mod.plugin(relpath)
if FileTest.directory?(modpath) and recurse
ary = reclist(modpath, recurse, ignore)
- ary = [] if ary.nil?
+ ary ||= []
result += ary
else
result += [["/", File.stat(modpath).ftype]]