aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/node.rb
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Formula/node.rb')
-rw-r--r--Library/Formula/node.rb15
1 files changed, 7 insertions, 8 deletions
diff --git a/Library/Formula/node.rb b/Library/Formula/node.rb
index 55cfc9f9b..0574281b2 100644
--- a/Library/Formula/node.rb
+++ b/Library/Formula/node.rb
@@ -1,16 +1,19 @@
require 'formula'
class PythonVersion < Requirement
+ env :userpaths
+
+ satisfy { `python -c 'import sys;print(sys.version[:3])'`.strip.to_f >= 2.6 }
+
def message; <<-EOS.undent
Node's build system, gyp, requires Python 2.6 or newer.
EOS
end
- def satisfied?
- `python -c 'import sys;print(sys.version[:3])'`.strip.to_f >= 2.6
- end
end
class NpmNotInstalled < Requirement
+ fatal true
+
def modules_folder
"#{HOMEBREW_PREFIX}/lib/node_modules"
end
@@ -28,7 +31,7 @@ class NpmNotInstalled < Requirement
EOS
end
- def satisfied?
+ satisfy :build_env => false do
begin
path = Pathname.new("#{modules_folder}/npm")
not path.realpath.to_s.include?(HOMEBREW_CELLAR)
@@ -36,10 +39,6 @@ class NpmNotInstalled < Requirement
true
end
end
-
- def fatal?
- true
- end
end
class Node < Formula