Class: Cleaner::CLI

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/cleaner/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#intervalObject (readonly)

Returns the value of attribute interval.



7
8
9
# File 'lib/cleaner/cli.rb', line 7

def interval
  @interval
end

Instance Method Details

#cleanupObject



29
30
31
# File 'lib/cleaner/cli.rb', line 29

def cleanup
  run_cleaner
end

#initObject



11
12
13
# File 'lib/cleaner/cli.rb', line 11

def init
  copy_file "cleaner.rb", "~/.cleaner.rb"
end

#start(interval = "1.hour") ⇒ Object



18
19
20
21
# File 'lib/cleaner/cli.rb', line 18

def start(interval = "1.hour")
  @interval = eval(interval)
  daemon.start
end

#stopObject



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

def stop
  daemon.stop
end

#versionObject



35
36
37
# File 'lib/cleaner/cli.rb', line 35

def version
  say "cleaner version #{VERSION}"
end