Class: Ops
- Inherits:
-
Object
- Object
- Ops
- Defined in:
- lib/ops.rb
Overview
executes commands based on local ‘ops.yml`
Defined Under Namespace
Classes: UnknownActionError
Constant Summary collapse
- CONFIG_FILE =
"ops.yml"
- INVALID_SYNTAX_EXIT_CODE =
64
- UNKNOWN_ACTION_EXIT_CODE =
65
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(argv) ⇒ Ops
constructor
A new instance of Ops.
- #run ⇒ Object
Constructor Details
Class Method Details
.project_name ⇒ Object
23 24 25 |
# File 'lib/ops.rb', line 23 def project_name File.basename(::Dir.pwd) end |
Instance Method Details
#run ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/ops.rb', line 35 def run return exit(INVALID_SYNTAX_EXIT_CODE) unless syntax_valid? run_action rescue UnknownActionError => e Output.error("Error: #{e}") exit(UNKNOWN_ACTION_EXIT_CODE) end |