class Blockr::CLI

Handle the application command line parsing and the dispatch to various command objects

@api public

Constants

Error

Error raised by this runner

Public Instance Methods

activate(*) click to toggle source
# File lib/blockr/cli.rb, line 37
def activate(*)
  if options[:help]
    invoke :help, ['activate']
  else
    require_relative 'commands/activate'
    Blockr::Commands::Activate.new(options).execute
  end
end
block(*websites) click to toggle source
# File lib/blockr/cli.rb, line 63
def block(*websites)
  if options[:help]
    invoke :help, ['block']
  else
    require_relative 'commands/block'
    Blockr::Commands::Block.new(websites, options).execute
  end
end
deactivate(*) click to toggle source
# File lib/blockr/cli.rb, line 24
def deactivate(*)
  if options[:help]
    invoke :help, ['deactivate']
  else
    require_relative 'commands/deactivate'
    Blockr::Commands::Deactivate.new(options).execute
  end
end
unblock(*websites) click to toggle source
# File lib/blockr/cli.rb, line 50
def unblock(*websites)
  if options[:help]
    invoke :help, ['unblock']
  else
    require_relative 'commands/unblock'
    Blockr::Commands::Unblock.new(websites, options).execute
  end
end
version() click to toggle source
# File lib/blockr/cli.rb, line 15
def version
  require_relative 'version'
  puts "v#{Blockr::VERSION}"
end