Class: FitCommit::Cli
- Inherits:
-
Object
- Object
- FitCommit::Cli
- Defined in:
- lib/fit_commit/cli.rb
Constant Summary collapse
- EXIT_CODE_SUCCESS =
0
- EXIT_CODE_FAILURE =
1
Instance Attribute Summary collapse
-
#args ⇒ Object
Returns the value of attribute args.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(*args) ⇒ Cli
constructor
A new instance of Cli.
Constructor Details
#initialize(*args) ⇒ Cli
Returns a new instance of Cli.
10 11 12 |
# File 'lib/fit_commit/cli.rb', line 10 def initialize(*args) self.args = args end |
Instance Attribute Details
#args ⇒ Object
Returns the value of attribute args.
9 10 11 |
# File 'lib/fit_commit/cli.rb', line 9 def args @args end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 |
# File 'lib/fit_commit/cli.rb', line 14 def execute action_name = in_git_repo? ? args.shift : :fail_git_repo action_name = :help unless action_name && respond_to?(action_name, :include_private) send(action_name) end |