firespring_dev_commands 2.1.1 → 2.1.2.pre.alpha.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: abb45242307cc08509ddc63a507488ce03e1d545ef01abc2f909d2b09382c8a1
4
- data.tar.gz: 2f65a0f2845675e4930ff062865d47535c086b88267be51bba1e142f4b678057
3
+ metadata.gz: a3db1999f6439e25498a7a5dc84b96d7191cea3be8210382d8302502d07cae3d
4
+ data.tar.gz: 4be9c55b74b4bfcee808d4ce888a39ba9bb8db3598ae0421a67bf86628bf5983
5
5
  SHA512:
6
- metadata.gz: 7d699f6345d0cae3650009a92330ee4b46882c849ac85fe6cb99e53861e9a57bd9e53e119e28be8ffbce6066d9e021985a7e93734aec848705b227cdd291522a
7
- data.tar.gz: 972fd3a65395c8cff43136fb5cadaf96f1ab554c78feb917c9f7fccb765f3210d680e7e653f46693d9568f42bf04ef7a670e4036cf0eedec33e214b969e62ea0
6
+ metadata.gz: c4221e8f43391c3e7db66a6e46bf4b60baa7d4524cc4e0706529f18599c29ec69490be451339a45926ff0d26200d517d2af25451c5535c92ff91515c135e9c57
7
+ data.tar.gz: 2874a653490e414a00a0e6ff94c12bb1ce7e29d65218b1b7e90b04cebaa801bf7dde1fe53bdb2d0770bb15dfc6dc815cdaa4fe069a62d861a2dec7e7032fca46
@@ -6,11 +6,14 @@ module Dev
6
6
  class Application
7
7
  # Contains rake tasks for displaying and setting application variables in parameter store
8
8
  class Config < Dev::Template::ApplicationInterface
9
- attr_reader :path
9
+ attr_reader :path_prefix, :key_parameter_path
10
+
11
+ # Allow for custom config path_prefix for the application
12
+ # Allow for custom key parameter path (otherwise base it off the path prefix)
13
+ def initialize(name, path_prefix, key_parameter_path: nil, exclude: [])
14
+ @path_prefix = path_prefix
15
+ @key_parameter_path = key_parameter_path || "#{path_prefix}/kms/id"
10
16
 
11
- # Allow for custom config path for the application
12
- def initialize(name, path, exclude: [])
13
- @path = path
14
17
  super(name, exclude:)
15
18
  end
16
19
 
@@ -18,7 +21,7 @@ module Dev
18
21
  def create_list_task!
19
22
  # Have to set a local variable to be accessible inside of the instance_eval block
20
23
  application = @name
21
- path = @path
24
+ path_prefix = @path_prefix
22
25
  exclude = @exclude
23
26
 
24
27
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
@@ -29,7 +32,7 @@ module Dev
29
32
  desc "List all #{application} configs"
30
33
  task list: %w(init) do
31
34
  puts
32
- Dev::Aws::Parameter.new.list(path).each do |it|
35
+ Dev::Aws::Parameter.new.list(path_prefix).each do |it|
33
36
  puts " #{it.name} => #{it.value} (#{it.type})"
34
37
  end
35
38
  puts
@@ -44,7 +47,8 @@ module Dev
44
47
  def create_set_task!
45
48
  # Have to set a local variable to be accessible inside of the instance_eval block
46
49
  application = @name
47
- path = @path
50
+ path_prefix = @path_prefix
51
+ key_parameter_path = @key_parameter_path
48
52
  exclude = @exclude
49
53
 
50
54
  DEV_COMMANDS_TOP_LEVEL.instance_eval do
@@ -58,7 +62,7 @@ module Dev
58
62
  "\n\toptionally specify ENCRYPT=true to change a String type to a SecureString type"
59
63
  task set: %w(ensure_aws_credentials) do
60
64
  raise 'NAME is required' if ENV['NAME'].to_s.strip.blank?
61
- raise 'NAME is not found in this apps parameters' if Dev::Aws::Parameter.new.list(path).none? { |it| it.name == ENV['NAME'] }
65
+ raise 'NAME is not found in this apps parameters' if Dev::Aws::Parameter.new.list(path_prefix).none? { |it| it.name == ENV['NAME'] }
62
66
  raise 'VALUE is required' if ENV['VALUE'].to_s.strip.blank?
63
67
 
64
68
  param_path = ENV.fetch('NAME', nil)
@@ -68,7 +72,7 @@ module Dev
68
72
  params = {type: 'String'}
69
73
  if ENV['ENCRYPT'].to_s.strip == 'true' || old_value.type == 'SecureString'
70
74
  params[:type] = 'SecureString'
71
- params[:key_id] = Dev::Aws::Parameter.new.get_value("#{path}/kms/id")
75
+ params[:key_id] = Dev::Aws::Parameter.new.get_value(key_parameter_path)
72
76
  end
73
77
 
74
78
  message = 'This will change '.light_green +
@@ -6,6 +6,6 @@ module Dev
6
6
  # Use 'v.v.v.pre.alpha.v' for pre-release vesions
7
7
  # Use 'v.v.v.beta.v for beta versions
8
8
  # Use semantic versioning for any releases (https://semver.org/)
9
- VERSION = '2.1.1'.freeze
9
+ VERSION = '2.1.2.pre.alpha.1'.freeze
10
10
  end
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: firespring_dev_commands
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.2.pre.alpha.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Firespring
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-16 00:00:00.000000000 Z
11
+ date: 2023-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -330,9 +330,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
330
330
  version: '3.1'
331
331
  required_rubygems_version: !ruby/object:Gem::Requirement
332
332
  requirements:
333
- - - ">="
333
+ - - ">"
334
334
  - !ruby/object:Gem::Version
335
- version: '0'
335
+ version: 1.3.1
336
336
  requirements: []
337
337
  rubygems_version: 3.4.10
338
338
  signing_key: