ruby-terraform 0.22.0 → 0.23.0.pre.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: 907807be8f7c8b5b047a6927c8714fc96d474f6aabec37025f12d82756560bab
4
- data.tar.gz: bd27d9965213cdb637602281c035eb41292647d50641e77738a165b42fa126b5
3
+ metadata.gz: 9ab2a3343990bfdf0092451fc18070295d18c1e54202a17e2e3c2fbcfd2280ef
4
+ data.tar.gz: 0ef36155929128298489b15a0df71592e0ab208b319bc18ced6a9823d95ebfa0
5
5
  SHA512:
6
- metadata.gz: 1199308028b1ad3ee5a0d6cb19aab0c7f041cfc845f4ab927cdb88bfceb622faf40e1d98d1e07aec0d7117c0ed76ce46944aa3b4dc25f172278c14449c4a8363
7
- data.tar.gz: 93c24a368417889e12973144b259d1224ffca2eda97b340a63957044b09f9047465fcd1575ad910381d2bc80ab0d0c640f47c03ff93c3d9fb2714a3fd7f7151f
6
+ metadata.gz: 63e004f756910b354b3c04c22bfcaa59918b282318839d8bf8662e957131925c8c6b5d6e24245eada9c5b228371ca61160e4684fd5d1a3796b3e0af919a69359
7
+ data.tar.gz: ed9db5b688020427984dc559b21bfa4905fc4bb43cf2f5f35025369b7794a774ae057af85235007ad07f4bd81b7dfcb59b0bc1c4a8229e851d4702cc625f6642
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- ruby-terraform (0.22.0)
4
+ ruby-terraform (0.23.0.pre.pre.1)
5
5
  lino (~> 1.1)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -46,6 +46,7 @@ Currently, there is partial support for the following commands:
46
46
  * `RubyTerraform::Commands::Destroy`: executes `terraform destroy`
47
47
  * `RubyTerraform::Commands::Output`: executes `terraform output`
48
48
  * `RubyTerraform::Commands::RemoteConfig`: executes `terraform remote config`
49
+ * `RubyTerraform::Commands::Workspace`: executes `terraform workspace`
49
50
 
50
51
  ### RubyTerraform::Commands::Clean
51
52
 
@@ -264,6 +265,23 @@ arguments:
264
265
  * `no_color`: whether or not the output from the command should be in color;
265
266
  defaults to `false`.
266
267
 
268
+ ### RubyTerraform::Commands::Workspace
269
+
270
+ The `workspace` command configures [Terraform Workspaces](https://www.terraform.io/docs/state/workspaces.html#using-workspaces). It can be used as follows:
271
+
272
+ ```ruby
273
+ RubyTerraform.workspace(operation: 'list') # terraform workspace list
274
+ RubyTerraform.workspace(operation: 'new', workspace: 'staging') # terraform workspace new staging
275
+ RubyTerraform.workspace(operation: 'select', workspace: 'staging') # terraform workspace select staging
276
+ RubyTerraform.workspace(operation: 'list') # terraform workspace list
277
+ RubyTerraform.workspace(operation: 'select', workspace: 'default') # terraform workspace select default
278
+ RubyTerraform.workspace(operation: 'delete', workspace: 'staging') # terraform workspace delete staging
279
+ ```
280
+
281
+ The workspace command supports the following options passed as keyword arguments:
282
+ * `directory`: the directory containing terraform configuration, the default is the current path.
283
+ * `operation`: `list`, `select`, `new` or `delete`. default `list`.
284
+ * `workspace`: Workspace name.
267
285
 
268
286
  ## Development
269
287
 
@@ -0,0 +1,21 @@
1
+ require 'lino'
2
+ require_relative 'base'
3
+
4
+ module RubyTerraform
5
+ module Commands
6
+ class Workspace < Base
7
+ def configure_command(builder, opts)
8
+ directory = opts[:directory] || nil
9
+ operation = opts[:operation] || 'list'
10
+ workspace = opts[:workspace] || nil
11
+
12
+ builder = builder
13
+ .with_subcommand('workspace')
14
+ .with_subcommand(operation)
15
+
16
+ builder = builder.with_subcommand(workspace) if workspace && operation != 'list'
17
+ builder = builder.with_argument(directory)
18
+ end
19
+ end
20
+ end
21
+ end
@@ -9,6 +9,7 @@ require_relative 'commands/output'
9
9
  require_relative 'commands/refresh'
10
10
  require_relative 'commands/remote_config'
11
11
  require_relative 'commands/show'
12
+ require_relative 'commands/workspace'
12
13
 
13
14
  module RubyTerraform
14
15
  module Commands
@@ -1,3 +1,3 @@
1
1
  module RubyTerraform
2
- VERSION = "0.22.0"
2
+ VERSION = "0.23.0-pre.1"
3
3
  end
@@ -59,6 +59,10 @@ module RubyTerraform
59
59
  Commands::Output.new.execute(opts)
60
60
  end
61
61
 
62
+ def workspace(opts = {})
63
+ Commands::Workspace.new.execute(opts)
64
+ end
65
+
62
66
  def output_from_remote(opts)
63
67
  output_name = opts[:name]
64
68
  remote_opts = opts[:remote]
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.22.0
4
+ version: 0.23.0.pre.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: 2019-03-01 00:00:00.000000000 Z
11
+ date: 2019-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lino
@@ -130,6 +130,7 @@ files:
130
130
  - lib/ruby_terraform/commands/remote_config.rb
131
131
  - lib/ruby_terraform/commands/show.rb
132
132
  - lib/ruby_terraform/commands/validate.rb
133
+ - lib/ruby_terraform/commands/workspace.rb
133
134
  - lib/ruby_terraform/version.rb
134
135
  - ruby_terraform.gemspec
135
136
  - scripts/ci/common/configure-git.sh
@@ -154,9 +155,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
154
155
  version: '0'
155
156
  required_rubygems_version: !ruby/object:Gem::Requirement
156
157
  requirements:
157
- - - ">="
158
+ - - ">"
158
159
  - !ruby/object:Gem::Version
159
- version: '0'
160
+ version: 1.3.1
160
161
  requirements: []
161
162
  rubyforge_project:
162
163
  rubygems_version: 2.7.7