ruby-terraform 0.58.0 → 0.62.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +28 -26
- data/README.md +32 -0
- data/lib/ruby-terraform.rb +3 -0
- data/lib/ruby_terraform.rb +4 -0
- data/lib/ruby_terraform/commands.rb +1 -0
- data/lib/ruby_terraform/commands/format.rb +31 -0
- data/lib/ruby_terraform/version.rb +1 -1
- data/ruby_terraform.gemspec +1 -1
- metadata +6 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22bf25dd2efd16d4330e50d48f3b1db00735dbafb7c43962f57aef653c411ae2
|
4
|
+
data.tar.gz: 87f64dc586399a15f60253be62831b9a8b26847fcff19bcd86fd5b423e52f884
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a36781b57712b72281cec340e55ff5c43955ad6d4c9edfe8427bcb40edc39d05ac94c89e035d0303e39645f6d9cef0577acc1528b22b7c1bbab4c326a017b4f
|
7
|
+
data.tar.gz: ca1e82dbab19175cd3b6bfc89cc1ee01939380907a6851288842e13de7a5d635cbd8b3fe60844fe6f2eea50eba130f1341472e2eb23c4cedbe6492a3a151ce7c
|
data/Gemfile.lock
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ruby-terraform (0.
|
5
|
-
lino (>= 1.
|
4
|
+
ruby-terraform (0.62.0)
|
5
|
+
lino (>= 1.5)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
activesupport (6.0.3.
|
10
|
+
activesupport (6.0.3.4)
|
11
11
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
12
12
|
i18n (>= 0.7, < 2)
|
13
13
|
minitest (~> 5.1)
|
@@ -16,26 +16,27 @@ GEM
|
|
16
16
|
addressable (2.7.0)
|
17
17
|
public_suffix (>= 2.0.2, < 5.0)
|
18
18
|
colored2 (3.1.2)
|
19
|
-
concurrent-ruby (1.1.
|
20
|
-
diff-lcs (1.
|
21
|
-
excon (0.
|
22
|
-
faraday (1.0
|
19
|
+
concurrent-ruby (1.1.7)
|
20
|
+
diff-lcs (1.4.4)
|
21
|
+
excon (0.78.0)
|
22
|
+
faraday (1.1.0)
|
23
23
|
multipart-post (>= 1.2, < 3)
|
24
|
-
|
24
|
+
ruby2_keywords
|
25
|
+
gem-release (2.2.0)
|
25
26
|
hamster (3.0.0)
|
26
27
|
concurrent-ruby (~> 1.0)
|
27
|
-
i18n (1.8.
|
28
|
+
i18n (1.8.5)
|
28
29
|
concurrent-ruby (~> 1.0)
|
29
|
-
lino (1.
|
30
|
+
lino (1.5.0)
|
30
31
|
hamster (~> 3.0)
|
31
32
|
open4 (~> 1.3)
|
32
|
-
minitest (5.14.
|
33
|
+
minitest (5.14.2)
|
33
34
|
multipart-post (2.1.1)
|
34
|
-
octokit (4.
|
35
|
+
octokit (4.19.0)
|
35
36
|
faraday (>= 0.9)
|
36
37
|
sawyer (~> 0.8.0, >= 0.5.3)
|
37
38
|
open4 (1.3.4)
|
38
|
-
public_suffix (4.0.
|
39
|
+
public_suffix (4.0.6)
|
39
40
|
rake (13.0.1)
|
40
41
|
rake_circle_ci (0.7.0)
|
41
42
|
colored2 (~> 3.1)
|
@@ -54,27 +55,28 @@ GEM
|
|
54
55
|
colored2 (~> 3.1)
|
55
56
|
rake_factory (~> 0.23)
|
56
57
|
sshkey (~> 2.0)
|
57
|
-
rspec (3.
|
58
|
-
rspec-core (~> 3.
|
59
|
-
rspec-expectations (~> 3.
|
60
|
-
rspec-mocks (~> 3.
|
61
|
-
rspec-core (3.
|
62
|
-
rspec-support (~> 3.
|
63
|
-
rspec-expectations (3.
|
58
|
+
rspec (3.10.0)
|
59
|
+
rspec-core (~> 3.10.0)
|
60
|
+
rspec-expectations (~> 3.10.0)
|
61
|
+
rspec-mocks (~> 3.10.0)
|
62
|
+
rspec-core (3.10.0)
|
63
|
+
rspec-support (~> 3.10.0)
|
64
|
+
rspec-expectations (3.10.0)
|
64
65
|
diff-lcs (>= 1.2.0, < 2.0)
|
65
|
-
rspec-support (~> 3.
|
66
|
-
rspec-mocks (3.
|
66
|
+
rspec-support (~> 3.10.0)
|
67
|
+
rspec-mocks (3.10.0)
|
67
68
|
diff-lcs (>= 1.2.0, < 2.0)
|
68
|
-
rspec-support (~> 3.
|
69
|
-
rspec-support (3.
|
69
|
+
rspec-support (~> 3.10.0)
|
70
|
+
rspec-support (3.10.0)
|
71
|
+
ruby2_keywords (0.0.2)
|
70
72
|
sawyer (0.8.2)
|
71
73
|
addressable (>= 2.3.5)
|
72
74
|
faraday (> 0.8, < 2.0)
|
73
75
|
sshkey (2.0.0)
|
74
76
|
thread_safe (0.3.6)
|
75
|
-
tzinfo (1.2.
|
77
|
+
tzinfo (1.2.8)
|
76
78
|
thread_safe (~> 0.1)
|
77
|
-
zeitwerk (2.
|
79
|
+
zeitwerk (2.4.1)
|
78
80
|
|
79
81
|
PLATFORMS
|
80
82
|
ruby
|
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::Format`: 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::Format
|
387
389
|
|
390
|
+
The format command formats the terraform directory specified. It can be called in the following ways:
|
391
|
+
|
392
|
+
```ruby
|
393
|
+
RubyTerraform.format(
|
394
|
+
directory: 'infra/networking',
|
395
|
+
vars: {
|
396
|
+
region: 'eu-central'
|
397
|
+
})
|
398
|
+
RubyTerraform::Commands::Format.new.execute(
|
399
|
+
directory: 'infra/networking',
|
400
|
+
vars: {
|
401
|
+
region: 'eu-central'
|
402
|
+
})
|
403
|
+
```
|
404
|
+
|
405
|
+
The format 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 Format < 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
|
data/ruby_terraform.gemspec
CHANGED
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.required_ruby_version = '>= 2.6'
|
27
27
|
|
28
|
-
spec.add_dependency 'lino', '>= 1.
|
28
|
+
spec.add_dependency 'lino', '>= 1.5'
|
29
29
|
|
30
30
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
31
31
|
spec.add_development_dependency 'rake', '~> 13.0'
|
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.62.0
|
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-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lino
|
@@ -16,20 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
20
|
-
- - "<"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '2'
|
19
|
+
version: '1.5'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
26
23
|
requirements:
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
|
-
version: '1.
|
30
|
-
- - "<"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '2'
|
26
|
+
version: '1.5'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: bundler
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -166,12 +160,14 @@ files:
|
|
166
160
|
- config/secrets/github/config.yaml
|
167
161
|
- config/secrets/rubygems/credentials
|
168
162
|
- go
|
163
|
+
- lib/ruby-terraform.rb
|
169
164
|
- lib/ruby_terraform.rb
|
170
165
|
- lib/ruby_terraform/commands.rb
|
171
166
|
- lib/ruby_terraform/commands/apply.rb
|
172
167
|
- lib/ruby_terraform/commands/base.rb
|
173
168
|
- lib/ruby_terraform/commands/clean.rb
|
174
169
|
- lib/ruby_terraform/commands/destroy.rb
|
170
|
+
- lib/ruby_terraform/commands/format.rb
|
175
171
|
- lib/ruby_terraform/commands/get.rb
|
176
172
|
- lib/ruby_terraform/commands/import.rb
|
177
173
|
- lib/ruby_terraform/commands/init.rb
|