Class: LearnTest::Dependencies::Imagemagick

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

Instance Attribute Summary

Attributes inherited from LearnTest::Dependency

#options

Instance Method Summary collapse

Methods inherited from LearnTest::Dependency

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

Constructor Details

This class inherits a constructor from LearnTest::Dependency

Instance Method Details

#installObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/learn_test/dependencies/imagemagick.rb', line 14

def install
  if win?
    brew = false
  else
    brew = `which brew`
  end

  if brew.empty? || brew.match(/not found/i)
    die('Please install ImageMagick'.red)
  else
    print_installing('ImageMagick')
    run_install('brew install imagemagick')
  end
end

#missing?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
12
# File 'lib/learn_test/dependencies/imagemagick.rb', line 4

def missing?
  if win?
    convert = `where convert`
  else
    convert = `which convert`
  end

  convert.empty? || convert.match(/not found/i)
end