TerraformDevKit 0.1.1 → 0.1.2

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
  SHA1:
3
- metadata.gz: b2284c31fa2c443c6a9cf685401f12d586fbde25
4
- data.tar.gz: db265ed767ab36f71cd901bdd48aaa6d81fe2fdc
3
+ metadata.gz: 4bf334632780d7a74097aa472d40a483d475b4a8
4
+ data.tar.gz: 3646248e8946931f8fccf56e681adc74d6559237
5
5
  SHA512:
6
- metadata.gz: ad83ebbc060fbd8003c836a045c2c009f478e1080031b0806fb3be3fba1bbfaea097b75d0ecb9e5932a427b155095adb8484e069c056a670d5502ac8fb97b4c6
7
- data.tar.gz: 890ae15ceb38ca603f54528292d016f182392636dd1ee1c39ece74524229d03dbd2b71516e6b4d83c3b8f10184a82df08bd88b6d916089702320374a54058334
6
+ metadata.gz: 732188c769df072888d934e1a956d7a7d3878de0c2332b5e2ebfcf97a5354a61ddf95f1daf112658c1de04c41c443f27d106714541e1196b68d46749b3229937
7
+ data.tar.gz: 9b5c244462fa4c783187fd2bb8a688c3d4a98ea6102e2ed69e50d737b0493a40bc3ad514e6a650c311e6bc349900dcce743ee7531eb5c64438c899e98b287bd3
data/README.md CHANGED
@@ -8,7 +8,7 @@ The script collection incldues support for:
8
8
 
9
9
  * Managing AWS credentials
10
10
  * Simple reading and writing to AWS DynamoDB
11
- * Polling until an AWS ApiGateway resource becomes ready
11
+ * Polling an AWS ApiGateway endpoint until it becomes ready
12
12
  * Executing commands
13
13
  * Locally installing Terraform and [Terragrunt](https://github.com/gruntwork-io/terragrunt)
14
14
  * Backing up the state from a failed Terraform execution
@@ -10,7 +10,7 @@ INTERVAL_LENGTH = 5.0
10
10
  MAX_TIME_TO_RETRY = 300.0
11
11
 
12
12
  if ARGV.length != 1
13
- puts 'USAGE: wait_for_url.rb <url>'
13
+ puts 'USAGE: wait_for_url <url>'
14
14
  exit
15
15
  end
16
16
 
@@ -2,19 +2,19 @@ require 'open3'
2
2
 
3
3
  module TerraformDevKit
4
4
  class Command
5
- def self.run(cmd, directory = Dir.pwd)
5
+ def self.run(cmd, directory: Dir.pwd, print_output: true)
6
6
  output = []
7
7
 
8
- Open3.popen2e(cmd, chdir: directory) do |_, stdout, thread|
9
- while line = stdout.gets
10
- output << line
11
- puts(line)
8
+ Open3.popen2e(cmd, chdir: directory) do |_, stdout_and_stderr, thread|
9
+ stdout_and_stderr.each do |line|
10
+ output << line.tr("\r\n", '')
11
+ puts line if print_output
12
12
  end
13
13
 
14
14
  raise "Error running command #{cmd}" unless thread.value.success?
15
15
  end
16
16
 
17
- output.join('')
17
+ output
18
18
  end
19
19
  end
20
20
  end
@@ -9,7 +9,7 @@ module TerraformDevKit
9
9
  LOCAL_FILE_NAME = 'terraform.zip'.freeze
10
10
 
11
11
  def self.installed_terraform_version
12
- version = Command.run('terraform --version').tr("\r\n", '')
12
+ version = Command.run('terraform --version')[0]
13
13
  match = /Terraform v(\d+\.\d+\.\d+)/.match(version)
14
14
  match[1] unless match.nil?
15
15
  rescue
@@ -10,7 +10,7 @@ module TerraformDevKit
10
10
  LOCAL_FILE_NAME = "terragrunt#{EXTENSION}".freeze
11
11
 
12
12
  def self.installed_terragrunt_version
13
- version = Command.run('terragrunt --version').tr("\r\n", '')
13
+ version = Command.run('terragrunt --version')[0]
14
14
  match = /terragrunt version v(\d+\.\d+\.\d+)/.match(version)
15
15
  match[1] unless match.nil?
16
16
  rescue
@@ -1,3 +1,3 @@
1
1
  module TerraformDevKit
2
- VERSION = '0.1.1'.freeze
2
+ VERSION = '0.1.2'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: TerraformDevKit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Jimenez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-06-19 00:00:00.000000000 Z
11
+ date: 2017-06-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler