class LearnTest::Dependencies::PhantomJS

Private Class Methods

check_installation() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 37
def self.check_installation
  new.check_installation
end

Public Instance Methods

install() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 19
def install
  install_phantomjs
end
missing?() click to toggle source
Calls superclass method LearnTest::Dependency#missing?
# File lib/learn_test/dependencies/phantomjs.rb, line 6
def missing?
  if mac?
    die('You must have Homebrew installed') unless brew_installed?
    return !phantom_installed_on_mac?
  end

  unless phantom_installed_on_linux?
    die('You must have PhantomJS installed: http://phantomjs.org/download.html')
  end

  super
end

Private Instance Methods

brew_installed?() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 25
def brew_installed?
  !`which brew`.empty?
end
check_installation() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 41
def check_installation; end
install_phantomjs() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 51
def install_phantomjs
  print_installing('phantomjs')
  `brew install phantomjs`
end
phantom_installed?() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 47
def phantom_installed?
  !`which phantomjs`.empty?
end
phantom_installed_by_brew?() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 43
def phantom_installed_by_brew?
  !`brew ls --versions phantomjs`.empty?
end
phantom_installed_on_linux?() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 33
def phantom_installed_on_linux?
  phantom_installed?
end
phantom_installed_on_mac?() click to toggle source
# File lib/learn_test/dependencies/phantomjs.rb, line 29
def phantom_installed_on_mac?
  phantom_installed_by_brew? || phantom_installed?
end