diff options
| author | Markus Reiter | 2016-10-24 17:07:57 +0200 |
|---|---|---|
| committer | Markus Reiter | 2016-11-13 23:00:47 +0100 |
| commit | 84b2276fd866342cd84c6ada8ffc13c5c209c3cf (patch) | |
| tree | dc5b52be0021022438af2df26d22be1b4d13aef5 /Library/Homebrew/cask/lib/hbc/utils.rb | |
| parent | fc3d586584ea8c0208ec08c4797effa8b3824b78 (diff) | |
| download | brew-84b2276fd866342cd84c6ada8ffc13c5c209c3cf.tar.bz2 | |
Use guard clauses.
Diffstat (limited to 'Library/Homebrew/cask/lib/hbc/utils.rb')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/utils.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/utils.rb b/Library/Homebrew/cask/lib/hbc/utils.rb index b442efd2f..88b8a88c4 100644 --- a/Library/Homebrew/cask/lib/hbc/utils.rb +++ b/Library/Homebrew/cask/lib/hbc/utils.rb @@ -137,13 +137,13 @@ module Hbc def self.nowstamp_metadata_path(container_path) @timenow ||= Time.now.gmtime - if container_path.respond_to?(:join) - precision = 3 - timestamp = @timenow.strftime("%Y%m%d%H%M%S") - fraction = format("%.#{precision}f", @timenow.to_f - @timenow.to_i)[1..-1] - timestamp.concat(fraction) - container_path.join(timestamp) - end + return unless container_path.respond_to?(:join) + + precision = 3 + timestamp = @timenow.strftime("%Y%m%d%H%M%S") + fraction = format("%.#{precision}f", @timenow.to_f - @timenow.to_i)[1..-1] + timestamp.concat(fraction) + container_path.join(timestamp) end def self.size_in_bytes(files) |
