Class: Terraspace::CLI::Fmt
- Inherits:
-
Object
- Object
- Terraspace::CLI::Fmt
- Includes:
- Concerns::SourceDirs, Util::Logging
- Defined in:
- lib/terraspace/cli/fmt.rb,
lib/terraspace/cli/fmt/runner.rb
Defined Under Namespace
Classes: Runner
Constant Summary collapse
- @@exit_status =
0
Instance Method Summary collapse
- #format(dir) ⇒ Object
-
#initialize(options = {}) ⇒ Fmt
constructor
A new instance of Fmt.
- #run ⇒ Object
Methods included from Util::Logging
Methods included from Concerns::SourceDirs
#app_source_dirs, #source_dirs
Constructor Details
#initialize(options = {}) ⇒ Fmt
Returns a new instance of Fmt.
6 7 8 9 |
# File 'lib/terraspace/cli/fmt.rb', line 6 def initialize(={}) @options = @mod_name = [:mod] end |
Instance Method Details
#format(dir) ⇒ Object
21 22 23 |
# File 'lib/terraspace/cli/fmt.rb', line 21 def format(dir) Runner.new(dir, @options).format! end |
#run ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/terraspace/cli/fmt.rb', line 12 def run logger.info "Formatting terraform files" dirs.each do |dir| exit_status = format(dir) @@exit_status = exit_status if exit_status != 0 end exit(@@exit_status) end |