Class: LearnTest::Dependencies::NodeJS

Inherits:
LearnTest::Dependency show all
Defined in:
lib/learn_test/dependencies/nodejs.rb

Instance Attribute Summary

Attributes inherited from LearnTest::Dependency

#options

Instance Method Summary collapse

Methods inherited from LearnTest::Dependency

#execute, #initialize, #mac?, #print_installing, #run_install, #win?

Constructor Details

This class inherits a constructor from LearnTest::Dependency

Instance Method Details

#installObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/learn_test/dependencies/nodejs.rb', line 8

def install
  if !mac?
    die('Please install NodeJS: https://nodejs.org/en/download')
  else
    puts('Checking for homebrew...'.green)
    die('You must have Homebrew installed') unless brew_installed?
    puts('Updating brew...'.green)
    print_installing('node')
    run_install('brew install node')
  end
end

#missing?Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/learn_test/dependencies/nodejs.rb', line 4

def missing?
  `which node`.empty?
end