smps 0.2.0 → 0.2.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: 2592793a373af3a1f29aba3417884fe1e6a1b1c4
4
- data.tar.gz: eca608af712b806e0f81836328df50df290e6f47
3
+ metadata.gz: 15e113dabe0eb6b4a7fc8fb7fc3f3c547f5e356c
4
+ data.tar.gz: d135671af94168bfd52e42879a704db5f6d9c104
5
5
  SHA512:
6
- metadata.gz: a94e15e1860a5c3c6e995660e8bfb3e7c9c092a59de6cbc022d4acc0025425644d9737469047ddec9ecab70431c02bbbf3ee94fac92757cf1a5584a3e428cfc0
7
- data.tar.gz: 17e3de415445ddf7b703b1f7bf31ac98d84ba510b26154e3b58c47e50e021b8b0b0b5aaa62fe2eb30ba6ba25871e6a8076297800139448d84ffd8361c156e16b
6
+ metadata.gz: 6e60e0396a8fed1ff31d46f7f60f9de7c9dad586c05f7f17d9739420388881a06185ef5267741f142944ab82f51b90c2b91512e40154c507618f433de8f19988
7
+ data.tar.gz: 529e4a1fb4b898084d4511636ca92f6564f83dc6cfe6830b5d44cf80dac0f9611abf5907aa4d6162e690f005baa0339f5f08034fcb2a19b21b9963e676ac6967
data/changelog.md CHANGED
@@ -3,16 +3,15 @@ All notable changes to this project will be documented in this file.
3
3
 
4
4
  ## [Unreleased]
5
5
 
6
+ ## [0.2.1] - 2017-10-05
7
+ ### Changed
8
+ - Class structure improvement
9
+ - move optional requires into if block
10
+
6
11
  ## [0.2.0] - 2017-10-05
7
12
  ### Added
8
13
  - smps cli query script
9
14
 
10
- ### Changed
11
- - ...
12
-
13
- ### Removed
14
- - ...
15
-
16
15
  ## [0.1.3] - 2017-10-05
17
16
  ### Added
18
17
  - ...
data/exe/smps CHANGED
@@ -51,10 +51,10 @@ opts.each do |opt, arg|
51
51
  end
52
52
  end
53
53
 
54
- require 'awssession'
55
- require 'aws_config'
56
-
57
54
  if role
55
+ require 'awssession'
56
+ require 'aws_config'
57
+
58
58
  profile_name = role
59
59
  profile = AWSConfig[profile_name]
60
60
  profile['name'] = profile_name
@@ -1,49 +1,52 @@
1
1
 
2
- class SmPs::Parameter
3
- def initialize(options)
4
- @ssm = options[:ssm]
5
- @name = options[:name]
6
- parameter
7
- end
2
+ class SmPs
3
+ # SmPs Parameter management
4
+ class Parameter
5
+ def initialize(options)
6
+ @ssm = options[:ssm]
7
+ @name = options[:name]
8
+ parameter
9
+ end
8
10
 
9
- def parameter(decrypt = true)
10
- resp = @ssm.get_parameter(
11
- name: @name,
12
- with_decryption: decrypt
13
- )
14
- @type = resp.parameter.type
15
- @value = resp.parameter.value
16
- @exists = true
17
- rescue Aws::SSM::Errors::ParameterNotFound
18
- @exists = false
19
- end
11
+ def parameter(decrypt = true)
12
+ resp = @ssm.get_parameter(
13
+ name: @name,
14
+ with_decryption: decrypt
15
+ )
16
+ @type = resp.parameter.type
17
+ @value = resp.parameter.value
18
+ @exists = true
19
+ rescue Aws::SSM::Errors::ParameterNotFound
20
+ @exists = false
21
+ end
20
22
 
21
- def to_s
22
- @value
23
- end
23
+ def to_s
24
+ @value
25
+ end
24
26
 
25
- def exists?
26
- @exists
27
- end
27
+ def exists?
28
+ @exists
29
+ end
28
30
 
29
- def write!(value, type = 'String', description = nil, key_id = nil)
30
- raise ArgumentError unless %w[String StringList SecureString].include? type
31
- true if value == @value
32
- @ssm.put_parameter(
33
- name: @name, description: description,
34
- value: value, type: type,
35
- key_id: key_id, overwrite: @exists,
36
- # allowed_pattern: "AllowedPattern",
37
- )
38
- @value = value
39
- end
31
+ def write!(value, type = 'String', description = nil, key_id = nil)
32
+ raise ArgumentError unless %w[String StringList SecureString].include? type
33
+ true if value == @value
34
+ @ssm.put_parameter(
35
+ name: @name, description: description,
36
+ value: value, type: type,
37
+ key_id: key_id, overwrite: @exists,
38
+ # allowed_pattern: "AllowedPattern",
39
+ )
40
+ @value = value
41
+ end
40
42
 
41
- def history
42
- # get_parameter_history
43
- end
43
+ def history
44
+ # get_parameter_history
45
+ end
44
46
 
45
- def tag
46
- # add_tags_to_resource
47
- # remove_tags_from_resource
47
+ def tag
48
+ # add_tags_to_resource
49
+ # remove_tags_from_resource
50
+ end
48
51
  end
49
52
  end
data/lib/smps/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class SmPs
2
- VERSION = '0.2.0'.freeze
2
+ VERSION = '0.2.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan - Zipkid - Goethals