ruby-terraform 0.58.0 → 0.59.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +32 -0
- data/lib/ruby_terraform.rb +4 -0
- data/lib/ruby_terraform/commands.rb +1 -0
- data/lib/ruby_terraform/commands/fmt.rb +31 -0
- data/lib/ruby_terraform/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31791b88071aedec456f114396f8066b555ddcaddaa3e9d3d4fa100560a92262
|
4
|
+
data.tar.gz: 1d2d327bacc5593010b5dd9bc51e7dd44c729b6f614eb92fc415102973cbcb6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54d68b310141085f68296b7f35cb40d64cfc07398d2679f07e055d07dca8bbbcdde21b611d468a2a0067101b8c39583dc7a5640625ec123ddff50150327e2d91
|
7
|
+
data.tar.gz: b0c44a9823117cc4365a29d22631bb615e4432eb08e0b0d049322565694440d92830b808236923c159e937f7149436cf6edf705bc9f538e1d469b02d65b709ad
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -50,6 +50,7 @@ Currently, there is partial support for the following commands:
|
|
50
50
|
* `RubyTerraform::Commands::Refresh`: executes `terraform refresh`
|
51
51
|
* `RubyTerraform::Commands::Import`: executes `terraform import`
|
52
52
|
* `RubyTerraform::Commands::RemoteConfig`: executes `terraform remote config`
|
53
|
+
* `RubyTerraform::Commands::FMT`: executes `terraform fmt`
|
53
54
|
* `RubyTerraform::Commands::Validate`: executes `terraform validate`
|
54
55
|
* `RubyTerraform::Commands::Workspace`: executes `terraform workspace`
|
55
56
|
|
@@ -384,7 +385,38 @@ arguments:
|
|
384
385
|
* `no_color`: whether or not the output from the command should be in color;
|
385
386
|
defaults to `false`.
|
386
387
|
|
388
|
+
### RubyTerraform::Commands::FMT
|
387
389
|
|
390
|
+
The FMT command formats the terraform directory specified. It can be called in the following ways:
|
391
|
+
|
392
|
+
```ruby
|
393
|
+
RubyTerraform.fmt(
|
394
|
+
directory: 'infra/networking',
|
395
|
+
vars: {
|
396
|
+
region: 'eu-central'
|
397
|
+
})
|
398
|
+
RubyTerraform::Commands::FMT.new.execute(
|
399
|
+
directory: 'infra/networking',
|
400
|
+
vars: {
|
401
|
+
region: 'eu-central'
|
402
|
+
})
|
403
|
+
```
|
404
|
+
|
405
|
+
The fmt command supports the following options passed as keyword arguments:
|
406
|
+
* `directory`: the directory containing terraform configuration to be formatted; required.
|
407
|
+
* `recursive`: Processes files in subdirectories;
|
408
|
+
defaults to `false`.
|
409
|
+
* `list`: Don't list files whose formatting differs;
|
410
|
+
defaults to `false`.
|
411
|
+
* `write`: Don't write to source files;
|
412
|
+
defaults to `false`.
|
413
|
+
* `check`: Checks if the input is formatted, exit status will be 0 if all input is properly formatted and non zero otherwise;
|
414
|
+
defaults to `false`.
|
415
|
+
* `diff`: Displays a diff of the formatting changes;
|
416
|
+
defaults to `false`.
|
417
|
+
* `no_color`: whether or not the output from the command should be in color;
|
418
|
+
defaults to `false`.
|
419
|
+
|
388
420
|
### RubyTerraform::Commands::Validate
|
389
421
|
|
390
422
|
The validate command validates terraform configuration in the provided terraform
|
data/lib/ruby_terraform.rb
CHANGED
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lino'
|
4
|
+
require_relative 'base'
|
5
|
+
|
6
|
+
module RubyTerraform
|
7
|
+
module Commands
|
8
|
+
class FMT < Base
|
9
|
+
def configure_command(builder, opts)
|
10
|
+
directory = opts[:directory]
|
11
|
+
check = opts[:check]
|
12
|
+
diff = opts[:diff]
|
13
|
+
list = opts[:list]
|
14
|
+
no_color = opts[:no_color]
|
15
|
+
recursive = opts[:recursive]
|
16
|
+
write = opts[:write]
|
17
|
+
|
18
|
+
builder.with_subcommand('fmt') do |sub|
|
19
|
+
sub = sub.with_option('-list', list) if list
|
20
|
+
sub = sub.with_option('-write', write) if write
|
21
|
+
|
22
|
+
sub = sub.with_flag('-check') if check
|
23
|
+
sub = sub.with_flag('-diff') if diff
|
24
|
+
sub = sub.with_flag('-no-color') if no_color
|
25
|
+
sub = sub.with_flag('-recursive') if recursive
|
26
|
+
sub
|
27
|
+
end.with_argument(directory)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-terraform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.59.0.pre.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toby Clemson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lino
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- lib/ruby_terraform/commands/base.rb
|
173
173
|
- lib/ruby_terraform/commands/clean.rb
|
174
174
|
- lib/ruby_terraform/commands/destroy.rb
|
175
|
+
- lib/ruby_terraform/commands/fmt.rb
|
175
176
|
- lib/ruby_terraform/commands/get.rb
|
176
177
|
- lib/ruby_terraform/commands/import.rb
|
177
178
|
- lib/ruby_terraform/commands/init.rb
|
@@ -209,9 +210,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
209
210
|
version: '2.6'
|
210
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
212
|
requirements:
|
212
|
-
- - "
|
213
|
+
- - ">"
|
213
214
|
- !ruby/object:Gem::Version
|
214
|
-
version:
|
215
|
+
version: 1.3.1
|
215
216
|
requirements: []
|
216
217
|
rubygems_version: 3.0.1
|
217
218
|
signing_key:
|