ruby-terraform 0.65.0.pre.1 → 0.65.0.pre.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 16009b9bc2985a1338a90ca2fc881ed7e75150471d241359f4d62e61ca6dd7c7
4
- data.tar.gz: d7f328671bf4c122776548ac81a2608e6beec764c20a292c95fc06120df40404
3
+ metadata.gz: c5cfd39cb3e8dbe09c0589280ac5b3879e913a9588574420bb285d89a8507217
4
+ data.tar.gz: 0e87b3b820aff40c28c38073735c4da17c14f95081b6a57f861df034a326bfa1
5
5
  SHA512:
6
- metadata.gz: b6f49b564e09567b5393dc1a93d48764331b8551a5fce741e394288f0568276e8eb1e5c929f95e20d7ea26e0088533eea3d4a3cecbe5446bdce64a188854c5de
7
- data.tar.gz: 010cabe4078842a9a67a2ee6f91583f0d20644d4c249aea837a0fd2cf94e6761fafeaa02640d58b92611d88016b3c5e76f8efb0b125bc3b13a47907f74968edc
6
+ metadata.gz: 86d696b30097ac1248ae4f421c591307bad5002ce91fb0352e30334d1c5861ec8abd43c734e6fb1eb0c6efefb07d7f9b09706684bd97b616a6f556e2e6fb9064
7
+ data.tar.gz: c55bd0a0a10da6bf852b097c17e11890c26ddbeb123edff321a31d5c89fa09404145299c69cda3b403979a0f88d6eca7d9ebf676b5e570933cd4e14f63b36483
data/Gemfile.lock CHANGED
@@ -1,33 +1,37 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-terraform (0.65.0.pre.1)
5
- lino (>= 1.5)
4
+ ruby-terraform (0.65.0.pre.6)
5
+ lino (>= 2.3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
9
9
  specs:
10
- activesupport (6.0.3.4)
10
+ activesupport (6.1.3.1)
11
11
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- zeitwerk (~> 2.2, >= 2.2.2)
12
+ i18n (>= 1.6, < 2)
13
+ minitest (>= 5.1)
14
+ tzinfo (~> 2.0)
15
+ zeitwerk (~> 2.3)
16
16
  addressable (2.7.0)
17
17
  public_suffix (>= 2.0.2, < 5.0)
18
+ ast (2.4.2)
18
19
  coderay (1.1.3)
19
20
  colored2 (3.1.2)
20
- concurrent-ruby (1.1.7)
21
+ concurrent-ruby (1.1.8)
21
22
  diff-lcs (1.4.4)
22
- excon (0.78.1)
23
+ docile (1.3.5)
24
+ excon (0.79.0)
23
25
  faker (2.17.0)
24
26
  i18n (>= 1.6, < 2)
25
- faraday (1.1.0)
27
+ faraday (1.3.0)
28
+ faraday-net_http (~> 1.0)
26
29
  multipart-post (>= 1.2, < 3)
27
30
  ruby2_keywords
31
+ faraday-net_http (1.0.1)
28
32
  ffi (1.15.0)
29
33
  formatador (0.2.5)
30
- gem-release (2.2.0)
34
+ gem-release (2.2.1)
31
35
  guard (2.16.2)
32
36
  formatador (>= 0.2.4)
33
37
  listen (>= 2.7, < 4.0)
@@ -44,40 +48,44 @@ GEM
44
48
  rspec (>= 2.99.0, < 4.0)
45
49
  hamster (3.0.0)
46
50
  concurrent-ruby (~> 1.0)
47
- i18n (1.8.5)
51
+ i18n (1.8.10)
48
52
  concurrent-ruby (~> 1.0)
49
- lino (1.5.0)
53
+ lino (2.3.0)
50
54
  hamster (~> 3.0)
51
55
  open4 (~> 1.3)
52
- listen (3.4.1)
56
+ listen (3.5.1)
53
57
  rb-fsevent (~> 0.10, >= 0.10.3)
54
58
  rb-inotify (~> 0.9, >= 0.9.10)
55
59
  lumberjack (1.2.8)
56
60
  method_source (1.0.0)
57
- minitest (5.14.2)
61
+ minitest (5.14.4)
58
62
  multipart-post (2.1.1)
59
63
  nenv (0.3.0)
60
64
  notiffany (0.1.3)
61
65
  nenv (~> 0.1)
62
66
  shellany (~> 0.0)
63
- octokit (4.19.0)
67
+ octokit (4.20.0)
64
68
  faraday (>= 0.9)
65
69
  sawyer (~> 0.8.0, >= 0.5.3)
66
70
  open4 (1.3.4)
67
- pry (0.13.1)
71
+ parallel (1.20.1)
72
+ parser (3.0.0.0)
73
+ ast (~> 2.4.1)
74
+ pry (0.14.0)
68
75
  coderay (~> 1.1)
69
76
  method_source (~> 1.0)
70
77
  public_suffix (4.0.6)
71
- rake (13.0.1)
78
+ rainbow (3.0.0)
79
+ rake (13.0.3)
72
80
  rake_circle_ci (0.9.0)
73
81
  colored2 (~> 3.1)
74
82
  excon (~> 0.72)
75
83
  rake_factory (~> 0.23)
76
84
  sshkey (~> 2.0)
77
- rake_factory (0.27.0)
85
+ rake_factory (0.29.0)
78
86
  activesupport (>= 4)
79
87
  rake (~> 13.0)
80
- rake_github (0.5.0)
88
+ rake_github (0.7.0)
81
89
  colored2 (~> 3.1)
82
90
  octokit (~> 4.16)
83
91
  rake_factory (~> 0.23)
@@ -85,39 +93,62 @@ GEM
85
93
  rake_gpg (0.14.0)
86
94
  rake_factory (>= 0.23, < 1)
87
95
  ruby_gpg2 (>= 0.6, < 1)
88
- rake_ssh (0.4.0)
96
+ rake_ssh (0.6.0)
89
97
  colored2 (~> 3.1)
90
98
  rake_factory (~> 0.23)
91
99
  sshkey (~> 2.0)
92
100
  rb-fsevent (0.10.4)
93
101
  rb-inotify (0.10.1)
94
102
  ffi (~> 1.0)
103
+ regexp_parser (2.1.1)
104
+ rexml (3.2.5)
95
105
  rspec (3.10.0)
96
106
  rspec-core (~> 3.10.0)
97
107
  rspec-expectations (~> 3.10.0)
98
108
  rspec-mocks (~> 3.10.0)
99
- rspec-core (3.10.0)
109
+ rspec-core (3.10.1)
100
110
  rspec-support (~> 3.10.0)
101
- rspec-expectations (3.10.0)
111
+ rspec-expectations (3.10.1)
102
112
  diff-lcs (>= 1.2.0, < 2.0)
103
113
  rspec-support (~> 3.10.0)
104
- rspec-mocks (3.10.0)
114
+ rspec-mocks (3.10.2)
105
115
  diff-lcs (>= 1.2.0, < 2.0)
106
116
  rspec-support (~> 3.10.0)
107
- rspec-support (3.10.0)
108
- ruby2_keywords (0.0.2)
109
- ruby_gpg2 (0.6.0)
117
+ rspec-support (3.10.2)
118
+ rubocop (1.12.1)
119
+ parallel (~> 1.10)
120
+ parser (>= 3.0.0.0)
121
+ rainbow (>= 2.2.2, < 4.0)
122
+ regexp_parser (>= 1.8, < 3.0)
123
+ rexml
124
+ rubocop-ast (>= 1.2.0, < 2.0)
125
+ ruby-progressbar (~> 1.7)
126
+ unicode-display_width (>= 1.4.0, < 3.0)
127
+ rubocop-ast (1.4.1)
128
+ parser (>= 2.7.1.5)
129
+ rubocop-rspec (2.2.0)
130
+ rubocop (~> 1.0)
131
+ rubocop-ast (>= 1.1.0)
132
+ ruby-progressbar (1.11.0)
133
+ ruby2_keywords (0.0.4)
134
+ ruby_gpg2 (0.8.0)
110
135
  lino (>= 1.5)
111
136
  sawyer (0.8.2)
112
137
  addressable (>= 2.3.5)
113
138
  faraday (> 0.8, < 2.0)
114
139
  shellany (0.0.1)
140
+ simplecov (0.21.2)
141
+ docile (~> 1.1)
142
+ simplecov-html (~> 0.11)
143
+ simplecov_json_formatter (~> 0.1)
144
+ simplecov-html (0.12.3)
145
+ simplecov_json_formatter (0.1.2)
115
146
  sshkey (2.0.0)
116
147
  thor (1.1.0)
117
- thread_safe (0.3.6)
118
- tzinfo (1.2.8)
119
- thread_safe (~> 0.1)
120
- zeitwerk (2.4.1)
148
+ tzinfo (2.0.4)
149
+ concurrent-ruby (~> 1.0)
150
+ unicode-display_width (2.0.0)
151
+ zeitwerk (2.4.2)
121
152
 
122
153
  PLATFORMS
123
154
  ruby
@@ -126,15 +157,18 @@ DEPENDENCIES
126
157
  bundler (~> 2.0)
127
158
  faker (~> 2.17)
128
159
  gem-release (~> 2.1)
129
- guard
130
- guard-rspec
160
+ guard (~> 2.16)
161
+ guard-rspec (~> 4.7)
131
162
  rake (~> 13.0)
132
163
  rake_circle_ci (~> 0.9)
133
164
  rake_github (~> 0.5)
134
165
  rake_gpg (~> 0.12)
135
166
  rake_ssh (~> 0.4)
136
167
  rspec (~> 3.9)
168
+ rubocop (~> 1.12)
169
+ rubocop-rspec (~> 2.2)
137
170
  ruby-terraform!
171
+ simplecov (~> 0.21)
138
172
 
139
173
  BUNDLED WITH
140
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
@@ -23,83 +25,99 @@ end
23
25
  namespace :keys do
24
26
  namespace :deploy do
25
27
  RakeSSH.define_key_tasks(
26
- path: 'config/secrets/ci/',
27
- comment: 'maintainers@infrablocks.io')
28
+ path: 'config/secrets/ci/',
29
+ comment: 'maintainers@infrablocks.io'
30
+ )
28
31
  end
29
32
 
30
33
  namespace :gpg do
31
34
  RakeGPG.define_generate_key_task(
32
- output_directory: 'config/secrets/ci',
33
- name_prefix: 'gpg',
34
- owner_name: 'InfraBlocks Maintainers',
35
- owner_email: 'maintainers@infrablocks.io',
36
- owner_comment: 'ruby_terraform CI Key')
35
+ output_directory: 'config/secrets/ci',
36
+ name_prefix: 'gpg',
37
+ owner_name: 'InfraBlocks Maintainers',
38
+ owner_email: 'maintainers@infrablocks.io',
39
+ owner_comment: 'ruby_terraform CI Key'
40
+ )
37
41
  end
38
42
  end
39
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
+
40
58
  RakeCircleCI.define_project_tasks(
41
- namespace: :circle_ci,
42
- project_slug: 'github/infrablocks/ruby_terraform'
59
+ namespace: :circle_ci,
60
+ project_slug: 'github/infrablocks/ruby_terraform'
43
61
  ) do |t|
44
62
  circle_ci_config =
45
- YAML.load_file('config/secrets/circle_ci/config.yaml')
63
+ YAML.load_file('config/secrets/circle_ci/config.yaml')
46
64
 
47
- t.api_token = circle_ci_config["circle_ci_api_token"]
65
+ t.api_token = circle_ci_config['circle_ci_api_token']
48
66
  t.environment_variables = {
49
- ENCRYPTION_PASSPHRASE:
50
- File.read('config/secrets/ci/encryption.passphrase')
51
- .chomp
67
+ ENCRYPTION_PASSPHRASE:
68
+ File.read('config/secrets/ci/encryption.passphrase')
69
+ .chomp
52
70
  }
53
71
  t.checkout_keys = []
54
72
  t.ssh_keys = [
55
- {
56
- hostname: "github.com",
57
- private_key: File.read('config/secrets/ci/ssh.private')
58
- }
73
+ {
74
+ hostname: 'github.com',
75
+ private_key: File.read('config/secrets/ci/ssh.private')
76
+ }
59
77
  ]
60
78
  end
61
79
 
62
80
  RakeGithub.define_repository_tasks(
63
- namespace: :github,
64
- repository: 'infrablocks/ruby_terraform',
81
+ namespace: :github,
82
+ repository: 'infrablocks/ruby_terraform'
65
83
  ) do |t|
66
84
  github_config =
67
- YAML.load_file('config/secrets/github/config.yaml')
85
+ YAML.load_file('config/secrets/github/config.yaml')
68
86
 
69
- t.access_token = github_config["github_personal_access_token"]
87
+ t.access_token = github_config['github_personal_access_token']
70
88
  t.deploy_keys = [
71
- {
72
- title: 'CircleCI',
73
- public_key: File.read('config/secrets/ci/ssh.public')
74
- }
89
+ {
90
+ title: 'CircleCI',
91
+ public_key: File.read('config/secrets/ci/ssh.public')
92
+ }
75
93
  ]
76
94
  end
77
95
 
78
96
  namespace :pipeline do
79
- task :prepare => [
80
- :'circle_ci:project:follow',
81
- :'circle_ci:env_vars:ensure',
82
- :'circle_ci:checkout_keys:ensure',
83
- :'circle_ci:ssh_keys:ensure',
84
- :'github:deploy_keys:ensure'
97
+ task prepare: %i[
98
+ circle_ci:project:follow
99
+ circle_ci:env_vars:ensure
100
+ circle_ci:checkout_keys:ensure
101
+ circle_ci:ssh_keys:ensure
102
+ github:deploy_keys:ensure
85
103
  ]
86
104
  end
87
105
 
88
106
  namespace :version do
89
- desc "Bump version for specified type (pre, major, minor, patch)"
107
+ desc 'Bump version for specified type (pre, major, minor, patch)'
90
108
  task :bump, [:type] do |_, args|
91
109
  bump_version_for(args.type)
92
110
  end
93
111
  end
94
112
 
95
- desc "Release gem"
113
+ desc 'Release gem'
96
114
  task :release do
97
- sh "gem release --tag --push"
115
+ sh 'gem release --tag --push'
98
116
  end
99
117
 
100
118
  def bump_version_for(version_type)
101
- sh "gem bump --version #{version_type} " +
102
- "&& bundle install " +
103
- "&& export LAST_MESSAGE=\"$(git log -1 --pretty=%B)\" " +
104
- "&& git commit -a --amend -m \"${LAST_MESSAGE} [ci skip]\""
119
+ sh "gem bump --version #{version_type} " \
120
+ '&& bundle install ' \
121
+ '&& export LAST_MESSAGE="$(git log -1 --pretty=%B)" ' \
122
+ '&& git commit -a --amend -m "${LAST_MESSAGE} [ci skip]"'
105
123
  end
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "ruby_terraform"
3
+ require 'bundler/setup'
4
+ require 'ruby_terraform'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +10,5 @@ require "ruby_terraform"
10
10
  # require "pry"
11
11
  # Pry.start
12
12
 
13
- require "irb"
13
+ require 'irb'
14
14
  IRB.start(__FILE__)
@@ -1,3 +1,3 @@
1
1
  # Enable `require 'ruby-terraform'`, to match the gem name
2
2
 
3
- require_relative 'ruby_terraform.rb'
3
+ require_relative 'ruby_terraform'
@@ -21,60 +21,25 @@ module RubyTerraform
21
21
  end
22
22
 
23
23
  module ClassMethods
24
- def clean(opts = {})
25
- Commands::Clean.new.execute(opts)
26
- end
27
-
28
- def init(opts = {})
29
- Commands::Init.new.execute(opts)
30
- end
31
-
32
- def get(opts = {})
33
- Commands::Get.new.execute(opts)
34
- end
35
-
36
- def validate(opts = {})
37
- Commands::Validate.new.execute(opts)
38
- end
39
-
40
- def plan(opts = {})
41
- Commands::Plan.new.execute(opts)
42
- end
43
-
44
- def apply(opts = {})
45
- Commands::Apply.new.execute(opts)
46
- end
47
-
48
- def destroy(opts = {})
49
- Commands::Destroy.new.execute(opts)
50
- end
51
-
52
- def remote_config(opts = {})
53
- Commands::RemoteConfig.new.execute(opts)
54
- end
55
-
56
- def refresh(opts = {})
57
- Commands::Refresh.new.execute(opts)
58
- end
59
-
60
- def output(opts = {})
61
- Commands::Output.new.execute(opts)
62
- end
63
-
64
- def show(opts = {})
65
- Commands::Show.new.execute(opts)
66
- end
67
-
68
- def workspace(opts = {})
69
- Commands::Workspace.new.execute(opts)
70
- end
71
-
72
- def import(opts = {})
73
- Commands::Import.new.execute(opts)
74
- end
75
-
76
- def format(opts = {})
77
- Commands::Format.new.execute(opts)
24
+ {
25
+ apply: RubyTerraform::Commands::Apply,
26
+ clean: RubyTerraform::Commands::Clean,
27
+ destroy: RubyTerraform::Commands::Destroy,
28
+ format: RubyTerraform::Commands::Format,
29
+ get: RubyTerraform::Commands::Get,
30
+ import: RubyTerraform::Commands::Import,
31
+ init: RubyTerraform::Commands::Init,
32
+ output: RubyTerraform::Commands::Output,
33
+ plan: RubyTerraform::Commands::Plan,
34
+ refresh: RubyTerraform::Commands::Refresh,
35
+ remote_config: RubyTerraform::Commands::RemoteConfig,
36
+ show: RubyTerraform::Commands::Show,
37
+ validate: RubyTerraform::Commands::Validate,
38
+ workspace: RubyTerraform::Commands::Workspace
39
+ }.each do |method, command_class|
40
+ define_method(method) do |opts = {}|
41
+ command_class.new.execute(opts)
42
+ end
78
43
  end
79
44
  end
80
45
  extend ClassMethods
@@ -107,7 +72,7 @@ module RubyTerraform
107
72
  end
108
73
 
109
74
  def write(*args)
110
- @targets.each {|t| t.write(*args)}
75
+ @targets.each { |t| t.write(*args) }
111
76
  end
112
77
 
113
78
  def close