aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorJack Nagel2014-03-27 22:35:08 -0500
committerJack Nagel2014-03-27 22:35:08 -0500
commitc046c4c88bbff068087dde3f485f5db3613413bc (patch)
tree81b06e86cc745517770336ee0e98118300aafbc9 /Library
parent149abcdba85acfd2860c14f7efc26f4e8210f36c (diff)
downloadhomebrew-c046c4c88bbff068087dde3f485f5db3613413bc.tar.bz2
Move initializer after constants and class methods
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/keg.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb
index d40b53d99..edf82a71d 100644
--- a/Library/Homebrew/keg.rb
+++ b/Library/Homebrew/keg.rb
@@ -4,12 +4,6 @@ require "formula_lock"
require "ostruct"
class Keg < Pathname
- def initialize path
- super path
- raise "#{to_s} is not a valid keg" unless parent.parent.realpath == HOMEBREW_CELLAR.realpath
- raise "#{to_s} is not a directory" unless directory?
- end
-
# locale-specific directories have the form language[_territory][.codeset][@modifier]
LOCALEDIR_RX = /(locale|man)\/([a-z]{2}|C|POSIX)(_[A-Z]{2})?(\.[a-zA-Z\-0-9]+(@.+)?)?/
INFOFILE_RX = %r[info/([^.].*?\.info|dir)$]
@@ -40,6 +34,12 @@ class Keg < Pathname
raise NotAKegError, "#{path} is not inside a keg"
end
+ def initialize path
+ super path
+ raise "#{to_s} is not a valid keg" unless parent.parent.realpath == HOMEBREW_CELLAR.realpath
+ raise "#{to_s} is not a directory" unless directory?
+ end
+
def uninstall
rmtree
parent.rmdir_if_possible