Class: Cleaner::CLI
- Inherits:
-
Thor
- Object
- Thor
- Cleaner::CLI
- Includes:
- Thor::Actions
- Defined in:
- lib/cleaner/cli.rb
Instance Attribute Summary collapse
-
#interval ⇒ Object
readonly
Returns the value of attribute interval.
Instance Method Summary collapse
- #cleanup ⇒ Object
- #init ⇒ Object
- #start(interval = "1.hour") ⇒ Object
- #stop ⇒ Object
- #version ⇒ Object
Instance Attribute Details
#interval ⇒ Object (readonly)
Returns the value of attribute interval.
7 8 9 |
# File 'lib/cleaner/cli.rb', line 7 def interval @interval end |
Instance Method Details
#cleanup ⇒ Object
29 30 31 |
# File 'lib/cleaner/cli.rb', line 29 def cleanup run_cleaner end |
#init ⇒ Object
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 |
#stop ⇒ Object
24 25 26 |
# File 'lib/cleaner/cli.rb', line 24 def stop daemon.stop end |
#version ⇒ Object
35 36 37 |
# File 'lib/cleaner/cli.rb', line 35 def version say "cleaner version #{VERSION}" end |