From 396ca3fc590ff1e8e5c6fb784458d7a5a5162b00 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Tue, 28 Aug 2012 12:11:34 -0400 Subject: Add Version.slice to compat suite Refs Homebrew/homebrew#14299. --- Library/Homebrew/compat/compatibility.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Library') diff --git a/Library/Homebrew/compat/compatibility.rb b/Library/Homebrew/compat/compatibility.rb index bbd349249..aff8e0be9 100644 --- a/Library/Homebrew/compat/compatibility.rb +++ b/Library/Homebrew/compat/compatibility.rb @@ -217,3 +217,11 @@ module MacOS extend self end alias_method :mountain_lion_or_newer?, :mountain_lion? end + + +class Version + def slice *args + opoo "Calling slice on versions is deprecated, use: to_s.slice" + to_s.slice *args + end +end -- cgit v1.2.3