ruby-terraform 0.65.0.pre.2 → 0.65.0.pre.3

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: 2dbba56077adf66c7e32da731ddb62cc90bfea3d2ba29ead63913edf3e1da5bd
4
- data.tar.gz: 708c49c91c22e75dcc9262f3d7858d51015451ebfb56dd222bddcf37d95d0fdb
3
+ metadata.gz: 8134ce739c38d0dc08a0ecdb0737d6227b8408809258c8eada6d95591182194d
4
+ data.tar.gz: bb5e4eeeaa9c3817ab67da0d2d2bb1b974aedb9b380934cbdc7ac633039e61c3
5
5
  SHA512:
6
- metadata.gz: 12e0d2f034a80f3d3a3b08aaac13858ef88df3a7fcd16f41320c8aa79ea895cd11165ce8fe439568c46b906b85c54f6249a109899d50c1c4e1c4bd4a2b7356c4
7
- data.tar.gz: a1e07bec999d28347645081e3d660c814f7e66a0d2c4f6079002a95e3ac021743904acc600a9a9f3965e8410b654c33381419110435cc0587cafad9acc93260a
6
+ metadata.gz: e7b1373932d2c2ff94456bad7e8a96daab3a84500a509bfd3ae557193a54e00310d773fd3d99996459bf5859434b385df609a863db7e4844536a64d98c24af53
7
+ data.tar.gz: c80e73a02de20a50a8feec447b826b5a63a1a8f62b8d7e40ec89c3e4266ef8a3b2a836257bb5a005d9676d6ec0ab6238e9db15709a3b5f9d844781782b1bb796
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-terraform (0.65.0.pre.2)
4
+ ruby-terraform (0.65.0.pre.3)
5
5
  lino (>= 1.5)
6
6
 
7
7
  GEM
@@ -157,18 +157,18 @@ DEPENDENCIES
157
157
  bundler (~> 2.0)
158
158
  faker (~> 2.17)
159
159
  gem-release (~> 2.1)
160
- guard
161
- guard-rspec
160
+ guard (~> 2.16)
161
+ guard-rspec (~> 4.7)
162
162
  rake (~> 13.0)
163
163
  rake_circle_ci (~> 0.9)
164
164
  rake_github (~> 0.5)
165
165
  rake_gpg (~> 0.12)
166
166
  rake_ssh (~> 0.4)
167
167
  rspec (~> 3.9)
168
- rubocop
169
- rubocop-rspec
168
+ rubocop (~> 1.12)
169
+ rubocop-rspec (~> 2.2)
170
170
  ruby-terraform!
171
- simplecov
171
+ simplecov (~> 0.21)
172
172
 
173
173
  BUNDLED WITH
174
174
  2.2.15
data/README.md CHANGED
@@ -467,7 +467,7 @@ RubyTerraform.workspace(operation: 'delete', workspace: 'staging')
467
467
  arguments:
468
468
  * `directory`: the directory containing terraform configuration, the default is
469
469
  the current path.
470
- * `operation`: `list`, `select`, `new` or `delete`. default `list`.
470
+ * `operation`: `list`, `select`, `new` or `delete`. default `list`.
471
471
  * `workspace`: Workspace name.
472
472
 
473
473
 
@@ -551,15 +551,35 @@ interactive input from the terminal.
551
551
 
552
552
  ## Development
553
553
 
554
- After checking out the repo, run `bin/setup` to install dependencies. Then,
555
- run `rake spec` to run the tests. You can also run `bin/console` for an
556
- interactive prompt that will allow you to experiment.
554
+ To install dependencies and run the build, run the pre-commit build:
557
555
 
558
- To install this gem onto your local machine, run `bundle exec rake install`. To
559
- release a new version, update the version number in `version.rb`, and then run
560
- `bundle exec rake release`, which will create a git tag for the version, push
561
- git commits and tags, and push the `.gem` file to
562
- [rubygems.org](https://rubygems.org).
556
+ ```shell script
557
+ ./go
558
+ ```
559
+
560
+ This runs all unit tests and other checks including coverage and code linting /
561
+ formatting.
562
+
563
+ To run only the unit tests, including coverage:
564
+
565
+ ```shell script
566
+ ./go test:unit
567
+ ```
568
+
569
+ To attempt to fix any code linting / formatting issues:
570
+
571
+ ```shell script
572
+ ./go library:fix
573
+ ```
574
+
575
+ To check for code linting / formatting issues without fixing:
576
+
577
+ ```shell script
578
+ ./go library:check
579
+ ```
580
+
581
+ You can also run `bin/console` for an interactive prompt that will allow you to
582
+ experiment.
563
583
 
564
584
  ### Managing CircleCI keys
565
585
 
data/Rakefile CHANGED
@@ -5,10 +5,12 @@ require 'rake_ssh'
5
5
  require 'rake_gpg'
6
6
  require 'securerandom'
7
7
  require 'rspec/core/rake_task'
8
+ require 'rubocop/rake_task'
8
9
 
9
- task default: :spec
10
-
11
- RSpec::Core::RakeTask.new(:spec)
10
+ task default: [
11
+ #:'library:fix',
12
+ :'test:unit'
13
+ ]
12
14
 
13
15
  namespace :encryption do
14
16
  namespace :passphrase do
@@ -39,6 +41,20 @@ namespace :keys do
39
41
  end
40
42
  end
41
43
 
44
+ RuboCop::RakeTask.new
45
+
46
+ namespace :library do
47
+ desc 'Run all checks of the library'
48
+ task check: [:rubocop]
49
+
50
+ desc 'Attempt to automatically fix issues with the library'
51
+ task fix: [:'rubocop:auto_correct']
52
+ end
53
+
54
+ namespace :test do
55
+ RSpec::Core::RakeTask.new(:unit)
56
+ end
57
+
42
58
  RakeCircleCI.define_project_tasks(
43
59
  namespace: :circle_ci,
44
60
  project_slug: 'github/infrablocks/ruby_terraform'
@@ -20,29 +20,30 @@ module RubyTerraform
20
20
  no_color = opts[:no_color]
21
21
 
22
22
  builder
23
- .with_subcommand('apply') do |sub|
24
- vars.each do |key, value|
25
- var_value = value.is_a?(String) ? value : JSON.generate(value)
26
- sub = sub.with_option(
27
- '-var', "'#{key}=#{var_value}'", separator: ' ')
28
- end
29
- sub = sub.with_option('-var-file', var_file) if var_file
30
- var_files.each do |file|
31
- sub = sub.with_option('-var-file', file)
32
- end
33
- sub = sub.with_option('-target', target) if target
34
- targets.each do |file|
35
- sub = sub.with_option('-target', file)
36
- end
37
- sub = sub.with_option('-state', state) if state
38
- sub = sub.with_option('-input', input) if input
39
- sub = sub.with_option('-auto-approve', auto_approve) unless
40
- auto_approve.nil?
41
- sub = sub.with_option('-backup', backup) if backup
42
- sub = sub.with_flag('-no-color') if no_color
43
- sub
44
- end
45
- .with_argument(plan || directory)
23
+ .with_subcommand('apply') do |sub|
24
+ vars.each do |key, value|
25
+ var_value = value.is_a?(String) ? value : JSON.generate(value)
26
+ sub = sub.with_option(
27
+ '-var', "'#{key}=#{var_value}'", separator: ' '
28
+ )
29
+ end
30
+ sub = sub.with_option('-var-file', var_file) if var_file
31
+ var_files.each do |file|
32
+ sub = sub.with_option('-var-file', file)
33
+ end
34
+ sub = sub.with_option('-target', target) if target
35
+ targets.each do |file|
36
+ sub = sub.with_option('-target', file)
37
+ end
38
+ sub = sub.with_option('-state', state) if state
39
+ sub = sub.with_option('-input', input) if input
40
+ sub = sub.with_option('-auto-approve', auto_approve) unless
41
+ auto_approve.nil?
42
+ sub = sub.with_option('-backup', backup) if backup
43
+ sub = sub.with_flag('-no-color') if no_color
44
+ sub
45
+ end
46
+ .with_argument(plan || directory)
46
47
  end
47
48
  end
48
49
  end
@@ -18,29 +18,30 @@ module RubyTerraform
18
18
  auto_approve = opts[:auto_approve]
19
19
 
20
20
  builder
21
- .with_subcommand('destroy') do |sub|
22
- vars.each do |key, value|
23
- var_value = value.is_a?(String) ? value : JSON.generate(value)
24
- sub = sub.with_option(
25
- '-var', "'#{key}=#{var_value}'", separator: ' ')
26
- end
27
- sub = sub.with_option('-var-file', var_file) if var_file
28
- var_files.each do |file|
29
- sub = sub.with_option('-var-file', file)
30
- end
31
- sub = sub.with_option('-target', target) if target
32
- targets.each do |target_name|
33
- sub = sub.with_option('-target', target_name)
34
- end
35
- sub = sub.with_option('-state', state) if state
36
- sub = sub.with_option('-auto-approve', auto_approve) unless
37
- auto_approve.nil?
38
- sub = sub.with_option('-backup', backup) if backup
39
- sub = sub.with_flag('-no-color') if no_color
40
- sub = sub.with_flag('-force') if force
41
- sub
42
- end
43
- .with_argument(directory)
21
+ .with_subcommand('destroy') do |sub|
22
+ vars.each do |key, value|
23
+ var_value = value.is_a?(String) ? value : JSON.generate(value)
24
+ sub = sub.with_option(
25
+ '-var', "'#{key}=#{var_value}'", separator: ' '
26
+ )
27
+ end
28
+ sub = sub.with_option('-var-file', var_file) if var_file
29
+ var_files.each do |file|
30
+ sub = sub.with_option('-var-file', file)
31
+ end
32
+ sub = sub.with_option('-target', target) if target
33
+ targets.each do |target_name|
34
+ sub = sub.with_option('-target', target_name)
35
+ end
36
+ sub = sub.with_option('-state', state) if state
37
+ sub = sub.with_option('-auto-approve', auto_approve) unless
38
+ auto_approve.nil?
39
+ sub = sub.with_option('-backup', backup) if backup
40
+ sub = sub.with_flag('-no-color') if no_color
41
+ sub = sub.with_flag('-force') if force
42
+ sub
43
+ end
44
+ .with_argument(directory)
44
45
  end
45
46
  end
46
47
  end
@@ -5,12 +5,12 @@ module RubyTerraform
5
5
  class Get < Base
6
6
  def configure_command(builder, opts)
7
7
  builder
8
- .with_subcommand('get') do |sub|
9
- sub = sub.with_option('-update', true) if opts[:update]
10
- sub = sub.with_flag('-no-color') if opts[:no_color]
11
- sub
12
- end
13
- .with_argument(opts[:directory])
8
+ .with_subcommand('get') do |sub|
9
+ sub = sub.with_option('-update', true) if opts[:update]
10
+ sub = sub.with_flag('-no-color') if opts[:no_color]
11
+ sub
12
+ end
13
+ .with_argument(opts[:directory])
14
14
  end
15
15
  end
16
16
  end
@@ -14,21 +14,28 @@ module RubyTerraform
14
14
  force_copy = opts[:force_copy]
15
15
 
16
16
  builder = builder
17
- .with_subcommand('init') do |sub|
18
- sub = sub.with_option('-backend', backend) unless backend.nil?
19
- sub = sub.with_option('-force-copy', force_copy) unless force_copy.nil?
20
- sub = sub.with_option('-get', get) unless get.nil?
21
- sub = sub.with_option('-from-module', source) if source
22
- sub = sub.with_flag('-no-color') if no_color
23
- sub = sub.with_option('-plugin-dir', plugin_dir) unless plugin_dir.nil?
24
- backend_config.each do |key, value|
25
- sub = sub.with_option(
26
- '-backend-config',
27
- "'#{key}=#{value}'",
28
- separator: ' ')
29
- end
30
- sub
31
- end
17
+ .with_subcommand('init') do |sub|
18
+ sub = sub.with_option('-backend', backend) unless backend.nil?
19
+ unless force_copy.nil?
20
+ sub = sub.with_option('-force-copy',
21
+ force_copy)
22
+ end
23
+ sub = sub.with_option('-get', get) unless get.nil?
24
+ sub = sub.with_option('-from-module', source) if source
25
+ sub = sub.with_flag('-no-color') if no_color
26
+ unless plugin_dir.nil?
27
+ sub = sub.with_option('-plugin-dir',
28
+ plugin_dir)
29
+ end
30
+ backend_config.each do |key, value|
31
+ sub = sub.with_option(
32
+ '-backend-config',
33
+ "'#{key}=#{value}'",
34
+ separator: ' '
35
+ )
36
+ end
37
+ sub
38
+ end
32
39
 
33
40
  builder = builder.with_argument(path) if path
34
41
 
@@ -18,7 +18,7 @@ module RubyTerraform
18
18
  mod = opts[:module]
19
19
 
20
20
  builder = builder
21
- .with_subcommand('output') do |sub|
21
+ .with_subcommand('output') do |sub|
22
22
  sub = sub.with_flag('-no-color') if no_color
23
23
  sub = sub.with_flag('-json') if json
24
24
  sub = sub.with_option('-state', state) if state
@@ -18,28 +18,29 @@ module RubyTerraform
18
18
  no_color = opts[:no_color]
19
19
 
20
20
  builder
21
- .with_subcommand('plan') do |sub|
22
- vars.each do |key, value|
23
- var_value = value.is_a?(String) ? value : JSON.generate(value)
24
- sub = sub.with_option(
25
- '-var', "'#{key}=#{var_value}'", separator: ' ')
26
- end
27
- sub = sub.with_option('-var-file', var_file) if var_file
28
- var_files.each do |file|
29
- sub = sub.with_option('-var-file', file)
30
- end
31
- sub = sub.with_option('-target', target) if target
32
- targets.each do |file|
33
- sub = sub.with_option('-target', file)
34
- end
35
- sub = sub.with_option('-state', state) if state
36
- sub = sub.with_option('-out', plan) if plan
37
- sub = sub.with_option('-input', input) if input
38
- sub = sub.with_flag('-destroy') if destroy
39
- sub = sub.with_flag('-no-color') if no_color
40
- sub
41
- end
42
- .with_argument(directory)
21
+ .with_subcommand('plan') do |sub|
22
+ vars.each do |key, value|
23
+ var_value = value.is_a?(String) ? value : JSON.generate(value)
24
+ sub = sub.with_option(
25
+ '-var', "'#{key}=#{var_value}'", separator: ' '
26
+ )
27
+ end
28
+ sub = sub.with_option('-var-file', var_file) if var_file
29
+ var_files.each do |file|
30
+ sub = sub.with_option('-var-file', file)
31
+ end
32
+ sub = sub.with_option('-target', target) if target
33
+ targets.each do |file|
34
+ sub = sub.with_option('-target', file)
35
+ end
36
+ sub = sub.with_option('-state', state) if state
37
+ sub = sub.with_option('-out', plan) if plan
38
+ sub = sub.with_option('-input', input) if input
39
+ sub = sub.with_flag('-destroy') if destroy
40
+ sub = sub.with_flag('-no-color') if no_color
41
+ sub
42
+ end
43
+ .with_argument(directory)
43
44
  end
44
45
  end
45
46
  end
@@ -16,26 +16,27 @@ module RubyTerraform
16
16
  no_color = opts[:no_color]
17
17
 
18
18
  builder
19
- .with_subcommand('refresh') do |sub|
20
- vars.each do |key, value|
21
- var_value = value.is_a?(String) ? value : JSON.generate(value)
22
- sub = sub.with_option(
23
- '-var', "'#{key}=#{var_value}'", separator: ' ')
24
- end
25
- sub = sub.with_option('-var-file', var_file) if var_file
26
- var_files.each do |file|
27
- sub = sub.with_option('-var-file', file)
28
- end
29
- sub = sub.with_option('-state', state) if state
30
- sub = sub.with_option('-input', input) if input
31
- sub = sub.with_option('-target', target) if target
32
- targets.each do |target_name|
33
- sub = sub.with_option('-target', target_name)
34
- end
35
- sub = sub.with_flag('-no-color') if no_color
36
- sub
37
- end
38
- .with_argument(directory)
19
+ .with_subcommand('refresh') do |sub|
20
+ vars.each do |key, value|
21
+ var_value = value.is_a?(String) ? value : JSON.generate(value)
22
+ sub = sub.with_option(
23
+ '-var', "'#{key}=#{var_value}'", separator: ' '
24
+ )
25
+ end
26
+ sub = sub.with_option('-var-file', var_file) if var_file
27
+ var_files.each do |file|
28
+ sub = sub.with_option('-var-file', file)
29
+ end
30
+ sub = sub.with_option('-state', state) if state
31
+ sub = sub.with_option('-input', input) if input
32
+ sub = sub.with_option('-target', target) if target
33
+ targets.each do |target_name|
34
+ sub = sub.with_option('-target', target_name)
35
+ end
36
+ sub = sub.with_flag('-no-color') if no_color
37
+ sub
38
+ end
39
+ .with_argument(directory)
39
40
  end
40
41
  end
41
42
  end
@@ -9,17 +9,18 @@ module RubyTerraform
9
9
  backend_config = opts[:backend_config] || {}
10
10
 
11
11
  builder
12
- .with_subcommand('remote')
13
- .with_subcommand('config') do |sub|
14
- sub = sub.with_option('-backend', backend) if backend
15
- backend_config.each do |key, value|
16
- sub = sub.with_option(
17
- '-backend-config', "'#{key}=#{value}'", separator: ' ')
18
- end
12
+ .with_subcommand('remote')
13
+ .with_subcommand('config') do |sub|
14
+ sub = sub.with_option('-backend', backend) if backend
15
+ backend_config.each do |key, value|
16
+ sub = sub.with_option(
17
+ '-backend-config', "'#{key}=#{value}'", separator: ' '
18
+ )
19
+ end
19
20
 
20
- sub = sub.with_flag('-no-color') if no_color
21
- sub
22
- end
21
+ sub = sub.with_flag('-no-color') if no_color
22
+ sub
23
+ end
23
24
  end
24
25
  end
25
26
  end
@@ -15,24 +15,25 @@ module RubyTerraform
15
15
  json_format = opts[:json]
16
16
 
17
17
  builder
18
- .with_subcommand('validate') do |sub|
19
- vars.each do |key, value|
20
- var_value = value.is_a?(String) ? value : JSON.generate(value)
21
- sub = sub.with_option(
22
- '-var', "'#{key}=#{var_value}'", separator: ' ')
23
- end
24
- sub = sub.with_option('-var-file', var_file) if var_file
25
- var_files.each do |file|
26
- sub = sub.with_option('-var-file', file)
27
- end
28
- sub = sub.with_option('-state', state) if state
29
- sub = sub.with_option('-check-variables', check_variables) unless
30
- check_variables.nil?
31
- sub = sub.with_flag('-no-color') if no_color
32
- sub = sub.with_flag('-json') if json_format
33
- sub
34
- end
35
- .with_argument(directory)
18
+ .with_subcommand('validate') do |sub|
19
+ vars.each do |key, value|
20
+ var_value = value.is_a?(String) ? value : JSON.generate(value)
21
+ sub = sub.with_option(
22
+ '-var', "'#{key}=#{var_value}'", separator: ' '
23
+ )
24
+ end
25
+ sub = sub.with_option('-var-file', var_file) if var_file
26
+ var_files.each do |file|
27
+ sub = sub.with_option('-var-file', file)
28
+ end
29
+ sub = sub.with_option('-state', state) if state
30
+ sub = sub.with_option('-check-variables', check_variables) unless
31
+ check_variables.nil?
32
+ sub = sub.with_flag('-no-color') if no_color
33
+ sub = sub.with_flag('-json') if json_format
34
+ sub
35
+ end
36
+ .with_argument(directory)
36
37
  end
37
38
  end
38
39
  end
@@ -9,14 +9,12 @@ module RubyTerraform
9
9
  workspace = opts[:workspace] || nil
10
10
 
11
11
  builder = builder
12
- .with_subcommand('workspace')
13
- .with_subcommand(operation)
12
+ .with_subcommand('workspace')
13
+ .with_subcommand(operation)
14
14
 
15
15
  builder = builder.with_subcommand(workspace) if
16
16
  workspace && operation != 'list'
17
- builder = builder.with_argument(directory)
18
-
19
- builder
17
+ builder.with_argument(directory)
20
18
  end
21
19
  end
22
20
  end
@@ -1,3 +1,3 @@
1
1
  module RubyTerraform
2
- VERSION = '0.65.0.pre.2'.freeze
2
+ VERSION = '0.65.0.pre.3'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-terraform
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.65.0.pre.2
4
+ version: 0.65.0.pre.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toby Clemson
@@ -70,30 +70,30 @@ dependencies:
70
70
  name: guard
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0'
75
+ version: '2.16'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0'
82
+ version: '2.16'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: guard-rspec
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ">="
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0'
89
+ version: '4.7'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ">="
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0'
96
+ version: '4.7'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -182,44 +182,44 @@ dependencies:
182
182
  name: rubocop
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ">="
185
+ - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: '0'
187
+ version: '1.12'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ">="
192
+ - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: '0'
194
+ version: '1.12'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: rubocop-rspec
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ">="
199
+ - - "~>"
200
200
  - !ruby/object:Gem::Version
201
- version: '0'
201
+ version: '2.2'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ">="
206
+ - - "~>"
207
207
  - !ruby/object:Gem::Version
208
- version: '0'
208
+ version: '2.2'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: simplecov
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: '0.21'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: '0.21'
223
223
  description: Wraps the Terraform CLI so that Terraform can be invoked from a Ruby
224
224
  script or Rakefile.
225
225
  email: