Class: Schked::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/schked/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.exit_on_failure?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/schked/cli.rb', line 21

def self.exit_on_failure?
  true
end

.start(argv) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/schked/cli.rb', line 8

def self.start(argv)
  if File.exist?(".schked")
    argv += File
      .read(".schked")
      .split("\n")
      .join(" ")
      .strip
      .shellsplit
  end

  super(argv)
end

Instance Method Details

#showObject



37
38
39
40
41
42
43
# File 'lib/schked/cli.rb', line 37

def show
  load_requires

  puts "====="
  puts Schked.worker.schedule
  puts "====="
end

#startObject



29
30
31
32
33
# File 'lib/schked/cli.rb', line 29

def start
  load_requires

  Schked.worker.wait
end