Class: Limarka::Check

Inherits:
Object
  • Object
show all
Defined in:
lib/limarka/check.rb

Overview

Possibilita checar dependencias: pandoc Ver github.com/abntex/limarka/issues/165

See Also:

Constant Summary collapse

PANDOC_VERSAO_MINIMA =
'1.19.1'
PANDOC_VERSAO_MAXIMA =
'3.0.0'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pandoc: nil, sistema: true) ⇒ Check

Returns a new instance of Check.



14
15
16
17
# File 'lib/limarka/check.rb', line 14

def initialize(pandoc: nil, sistema: true)
  self.pandoc = pandoc
  self.sistema = sistema
end

Instance Attribute Details

#pandocObject

Returns the value of attribute pandoc.



9
10
11
# File 'lib/limarka/check.rb', line 9

def pandoc
  @pandoc
end

#sistemaObject

Returns the value of attribute sistema.



10
11
12
# File 'lib/limarka/check.rb', line 10

def sistema
  @sistema
end

Instance Method Details

#checkObject



19
20
21
22
23
24
25
# File 'lib/limarka/check.rb', line 19

def check
  if sistema
    ler_pandoc_version
  end
  verifica_compatibilidade
  puts "OK."
end

#ler_pandoc_versionObject



27
28
29
# File 'lib/limarka/check.rb', line 27

def ler_pandoc_version
  self.pandoc = `pandoc --version`.split("\n")[0].split(" ")[1]
end