ruby-terraform 0.57.0.pre.2 → 0.61.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b81d7b5918ae0fa3f13d025d2deac0f75ee325b403cf442155b5041a7bd3e740
4
- data.tar.gz: c14af27fb5134648a4c1deaffcb84f4b605018fd4757dce165e1ad82400ccbdb
3
+ metadata.gz: 4116e7f4b7f6af63c149014c6dcacd5c2abbc5dbdab35252544f216c4c2f33e2
4
+ data.tar.gz: de2f9294fd0f6e268859828fa486380f943717fb818b24661219201b7bd21673
5
5
  SHA512:
6
- metadata.gz: e396f290f591bee57073801c4d87d9eb7309f0543e8158c04a67fec4acdc9488f353234823655e78c230f38cfcc3b56942496e8bb0ac431e7dcece463059b604
7
- data.tar.gz: b93e880f3e42139beb130fb431c12d3c265770c1f11fa6fcdd48e99539fde29093f0de7137c2cc9fda1e84b23ef797e8cfa7244d00442c060c8a30684b173237
6
+ metadata.gz: 6cc893c5f58992f118f38c9ee7da559cbe1a4e51290eef5442509740e7df16e9291441ccf677a05fe068ba5055df8184d4e24fcc7da794766ecf39a8258366fc
7
+ data.tar.gz: 7269789b76f4633c9f7044aa0a8781cba3d07cdf62b93bb48ca7e9507e034b2adb363790818833c2ae111e4e41c6d0be07ab1435b5a8684655334227afd35614
@@ -1,13 +1,13 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-terraform (0.57.0.pre.2)
5
- lino (>= 1.1, < 2)
4
+ ruby-terraform (0.61.0.pre.1)
5
+ lino (>= 1.5)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.3.1)
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.6)
20
- diff-lcs (1.3)
21
- excon (0.73.0)
22
- faraday (1.0.1)
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
- gem-release (2.1.1)
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.2)
28
+ i18n (1.8.5)
28
29
  concurrent-ruby (~> 1.0)
29
- lino (1.3.0)
30
+ lino (1.5.0)
30
31
  hamster (~> 3.0)
31
32
  open4 (~> 1.3)
32
- minitest (5.14.1)
33
+ minitest (5.14.2)
33
34
  multipart-post (2.1.1)
34
- octokit (4.18.0)
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.5)
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.9.0)
58
- rspec-core (~> 3.9.0)
59
- rspec-expectations (~> 3.9.0)
60
- rspec-mocks (~> 3.9.0)
61
- rspec-core (3.9.2)
62
- rspec-support (~> 3.9.3)
63
- rspec-expectations (3.9.2)
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.9.0)
66
- rspec-mocks (3.9.1)
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.9.0)
69
- rspec-support (3.9.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.7)
77
+ tzinfo (1.2.8)
76
78
  thread_safe (~> 0.1)
77
- zeitwerk (2.3.0)
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
@@ -0,0 +1,3 @@
1
+ # Enable `require 'ruby-terraform'`, to match the gem name
2
+
3
+ require_relative 'ruby_terraform.rb'
@@ -72,6 +72,10 @@ module RubyTerraform
72
72
  def import(opts = {})
73
73
  Commands::Import.new.execute(opts)
74
74
  end
75
+
76
+ def format(opts = {})
77
+ Commands::Format.new.execute(opts)
78
+ end
75
79
  end
76
80
  extend ClassMethods
77
81
 
@@ -11,6 +11,7 @@ require_relative 'commands/remote_config'
11
11
  require_relative 'commands/show'
12
12
  require_relative 'commands/workspace'
13
13
  require_relative 'commands/import'
14
+ require_relative 'commands/format'
14
15
 
15
16
  module RubyTerraform
16
17
  module Commands
@@ -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
@@ -1,3 +1,3 @@
1
1
  module RubyTerraform
2
- VERSION = "0.57.0.pre.2"
2
+ VERSION = "0.61.0.pre.1"
3
3
  end
@@ -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.1', "< 2"
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.57.0.pre.2
4
+ version: 0.61.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-07-16 00:00:00.000000000 Z
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.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.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