Module: Burr::Dependency

Defined in:
lib/burr/dependency.rb

Class Method Summary collapse

Class Method Details

.installed?(cmd) ⇒ Boolean

Checks if Dependent libx installed.

Returns true if installed, otherwise false.

Returns:

  • (Boolean)


18
19
20
21
# File 'lib/burr/dependency.rb', line 18

def self.installed?(cmd)
  return true if which(cmd)
  false
end

.kindlegen_installed?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/burr/dependency.rb', line 11

def self.kindlegen_installed?
  installed? 'kindlegen'
end

.prince_installed?Boolean

Checks if PrinceXML installed.

Returns true if installed, otherwise false.

Returns:

  • (Boolean)


7
8
9
# File 'lib/burr/dependency.rb', line 7

def self.prince_installed?
  installed? 'prince'
end

.which(cmd) ⇒ Object

Finds the executable.



24
25
26
# File 'lib/burr/dependency.rb', line 24

def self.which(cmd)
  system "which #{cmd} > /dev/null 2>&1"
end