Class: FitCommit::Cli

Inherits:
Object
  • Object
show all
Defined in:
lib/fit-commit/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ Cli

Returns a new instance of Cli.



6
7
8
# File 'lib/fit-commit/cli.rb', line 6

def initialize(*args)
  self.args = args
end

Instance Attribute Details

#argsObject

Returns the value of attribute args.



5
6
7
# File 'lib/fit-commit/cli.rb', line 5

def args
  @args
end

Instance Method Details

#executeObject



10
11
12
13
14
15
16
17
18
# File 'lib/fit-commit/cli.rb', line 10

def execute
  action_name = args.shift
  if action_name == "install"
    FitCommit::Installer.new.install
  else
    warn "Usage: fit-commit install"
    false
  end
end