Class: Blockr::CLI
- Inherits:
-
Thor
- Object
- Thor
- Blockr::CLI
- Defined in:
- lib/blockr/cli.rb
Overview
Handle the application command line parsing and the dispatch to various command objects
Constant Summary collapse
- Error =
Error raised by this runner
Class.new(StandardError)
Instance Method Summary collapse
- #activate ⇒ Object
- #block(*websites) ⇒ Object
- #deactivate ⇒ Object
- #unblock(*websites) ⇒ Object
- #version ⇒ Object
Instance Method Details
#activate ⇒ Object
37 38 39 40 41 42 43 44 |
# File 'lib/blockr/cli.rb', line 37 def activate(*) if [:help] invoke :help, ['activate'] else require_relative 'commands/activate' Blockr::Commands::Activate.new().execute end end |
#block(*websites) ⇒ Object
63 64 65 66 67 68 69 70 |
# File 'lib/blockr/cli.rb', line 63 def block(*websites) if [:help] invoke :help, ['block'] else require_relative 'commands/block' Blockr::Commands::Block.new(websites, ).execute end end |
#deactivate ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/blockr/cli.rb', line 24 def deactivate(*) if [:help] invoke :help, ['deactivate'] else require_relative 'commands/deactivate' Blockr::Commands::Deactivate.new().execute end end |