aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/version.rb
diff options
context:
space:
mode:
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 e2085a8a6..00fe2f490 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?