summaryrefslogtreecommitdiff
path: root/lib/rake/ext/string.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rake/ext/string.rb')
-rw-r--r--lib/rake/ext/string.rb4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/rake/ext/string.rb b/lib/rake/ext/string.rb
index be8b463..07ef167 100644
--- a/lib/rake/ext/string.rb
+++ b/lib/rake/ext/string.rb
@@ -13,9 +13,7 @@ class String
# +ext+ is a user added method for the String class.
def ext(newext='')
return self.dup if ['.', '..'].include? self
- if newext != ''
- newext = (newext =~ /^\./) ? newext : ("." + newext)
- end
+ newext = (newext =~ /^\./) ? newext : ("." + newext) if newext != ''
self.chomp(File.extname(self)) << newext
end
end