aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/version.rb
diff options
context:
space:
mode:
authorMarkus Reiter2016-09-23 22:02:23 +0200
committerMarkus Reiter2016-09-24 12:24:35 +0200
commit58e36c73193befb57d351344cea2a4a33fef850d (patch)
tree3d26751835440341e5a42a189cf580e6253785df /Library/Homebrew/version.rb
parentbbc3f1c3a852e6cfd26a7a7c333092fae0520eb4 (diff)
downloadbrew-58e36c73193befb57d351344cea2a4a33fef850d.tar.bz2
Fix Style/GuardClause.
Diffstat (limited to 'Library/Homebrew/version.rb')
-rw-r--r--Library/Homebrew/version.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb
index 60eb6b571..a1f482192 100644
--- a/Library/Homebrew/version.rb
+++ b/Library/Homebrew/version.rb
@@ -192,11 +192,10 @@ class Version
end
def initialize(val)
- if val.respond_to?(:to_str)
- @version = val.to_str
- else
+ unless val.respond_to?(:to_str)
raise TypeError, "Version value must be a string; got a #{val.class} (#{val})"
end
+ @version = val.to_str
end
def detected_from_url?