Class: TimeBlock::CLI

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

Class Method Summary collapse

Class Method Details

.start(*args) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/time_block/cli.rb', line 6

def self.start(*args)
  time = args.shift.strip.to_i
  Dante::Runner.new('timeblock').execute(daemonize: true, pid_path: '/tmp/timeblock.pid', log_path: '/tmp/timblock.log') do |opts|
    TimeBlock::Agent.new(time).run
  end
rescue => e
  puts e.message
  exit(1)
end