opsworks-cli 0.4.0 → 0.4.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
  SHA1:
3
- metadata.gz: 8db33372954155ca2aa7df0535f12e67decbaa83
4
- data.tar.gz: 0a98b7220142d4f68b99c525db8e459af142a7cf
3
+ metadata.gz: bfd9c693a24d5a7f5de807fbc15794a8e4f58c51
4
+ data.tar.gz: 9772af5d01fb661eea88f783ef3659ed6b2fe169
5
5
  SHA512:
6
- metadata.gz: 2f7eabb9792ff89932746e8d3c187bb6074a0e5e4b5e41c7231a8901078693fefecb3f40e4634af17fea9b9f02676df7366b46940f5ec78c34515db1a235b786
7
- data.tar.gz: c938ebc4718cee2eb56a16637dad7ffc753b826c7b7bd6961544d58e71e168e18de18721831de789c07232839891f550a5b0c3084a50f953acd8050482a4dbd2
6
+ metadata.gz: 95546553bfc0e27b9a3122fc6abe6fde2f1e4118bfbcd4b3144cbbcc7790350b91834ca7c662166ca9a2a81900ec4f2dbc3e7a846fc6ef0f094e872909c5448c
7
+ data.tar.gz: aed808326ac06d230b85e2cedcc45bbfaf43637579cceac668d634e81c7fb02b7db44f7564d3a1be5f106698ac16c7952882bf2931ad9a91d4ba28edea21c2c9
@@ -3,6 +3,7 @@ require 'aws'
3
3
 
4
4
  require_relative 'helpers/credentials'
5
5
  require_relative 'helpers/options'
6
+ require_relative 'helpers/typecasts'
6
7
 
7
8
  require_relative 'subcommands/chef'
8
9
  require_relative 'subcommands/recipes'
@@ -17,6 +18,7 @@ module OpsWorks
17
18
 
18
19
  include Helpers::Credentials
19
20
  include Helpers::Options
21
+ include Helpers::Typecasts
20
22
 
21
23
  include Subcommands::Chef
22
24
  include Subcommands::Recipes
@@ -0,0 +1,17 @@
1
+ require 'opsworks/stack'
2
+
3
+ module OpsWorks
4
+ module CLI
5
+ module Helpers
6
+ module Typecasts
7
+ def typecast_string_argument(arg)
8
+ case arg
9
+ when 'true' then true
10
+ when 'false' then false
11
+ else arg
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -28,7 +28,7 @@ module OpsWorks
28
28
  fetch_credentials unless env_credentials?
29
29
  parse_stacks(options).each do |stack|
30
30
  say "Updating #{stack.name}..."
31
- stack.set_custom_json_at(key, value)
31
+ stack.set_custom_json_at(key, typecast_string_argument(value))
32
32
  end
33
33
  end
34
34
 
@@ -1,5 +1,5 @@
1
1
  module OpsWorks
2
2
  module CLI
3
- VERSION = '0.4.0'
3
+ VERSION = '0.4.1'
4
4
  end
5
5
  end
@@ -69,6 +69,16 @@ describe OpsWorks::CLI::Agent do
69
69
  expect(stack.custom_json['env']['FOO']).to eq 'baz'
70
70
  expect(stack.custom_json['other']).to eq 'something'
71
71
  end
72
+
73
+ it 'should typecast Boolean values' do
74
+ stack.custom_json = {}
75
+ expect(client).to receive(:update_stack) do |hash|
76
+ json = JSON.parse(hash[:custom_json])
77
+ expect(json['env']['FOO']).to eq true
78
+ end
79
+ subject.send('config:set', json_path, 'true')
80
+ expect(stack.custom_json['env']['FOO']).to eq true
81
+ end
72
82
  end
73
83
 
74
84
  describe 'config:unset' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsworks-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Frank Macreery
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-15 00:00:00.000000000 Z
11
+ date: 2015-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -185,6 +185,7 @@ files:
185
185
  - lib/opsworks/cli/agent.rb
186
186
  - lib/opsworks/cli/helpers/credentials.rb
187
187
  - lib/opsworks/cli/helpers/options.rb
188
+ - lib/opsworks/cli/helpers/typecasts.rb
188
189
  - lib/opsworks/cli/subcommands/apps.rb
189
190
  - lib/opsworks/cli/subcommands/chef.rb
190
191
  - lib/opsworks/cli/subcommands/config.rb