Module: Cronto

Extended by:
Cronto
Included in:
Cronto
Defined in:
lib/cronto.rb

Defined Under Namespace

Classes: Error

Constant Summary collapse

VERSION =
'0.1.0'

Instance Method Summary collapse

Instance Method Details

#generate(*args) ⇒ Object



14
15
16
17
18
19
20
21
22
# File 'lib/cronto.rb', line 14

def generate(*args)
  out, err, status = Open3.capture3(['java', 'cronto'], '-jar', jar, *args)

  if status.success?
    return out
  else
    raise Cronto::Error, err
  end
end

#jarObject



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

def jar
  File.dirname(File.realpath(__FILE__)) + '/../out/artifacts/cronto_jar/cronto.jar'
end

#run(*args) ⇒ Object



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

def run(*args)
  puts generate(*args)
end