ruby-sfn-local 0.1.27 → 0.1.29

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: 1d6385a2c314fd825107942b944d72db015669637a51880c03eac7238dcb4abd
4
- data.tar.gz: 83058e9ce9ad7d6b2ec6e7c59b753b886c1686da9c4a451c886d44574b27d467
3
+ metadata.gz: be57c78578b7ddee065c2bcd524f3a8a76fbee4c8f55010fcb2ed08c9daae437
4
+ data.tar.gz: '072679be3d8981e2831a27ba5e47bb7b8ca588b779e6aab5ba2a38673e72918e'
5
5
  SHA512:
6
- metadata.gz: fedfb55e9bdc340b3f26f9ed56dd721a3631d33ee869722077a7cc28fdce0ee5def60a7537be7c02fd3deb071f0f48a077944aa40a5c422f90a2051b606c9cd3
7
- data.tar.gz: f31002ca1116c87a48f9ab8c429d217c52c33929c7a5e046e1c45e468321d9f59357da11c8a1026c9a248aafe15709ff857cde0f06e292629c034887c41b4f80
6
+ metadata.gz: c62f2e9b6c359688ac144d19b2f0816839e95bd3249683f0df2b5abdedea609638c0238e9d90867792340a1ad159fae0397c3b065a38a520ed54f4d958c1e2c7
7
+ data.tar.gz: ae4203012bb56dca90fc2a771e9da7988dc0296995d5db402106da4b70a8230a3bb55078bb230598d45fe0e1b468760fc066da57bc4b78beed0c4f1a4e3968a9
data/lib/hash.rb ADDED
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Hash
4
+ def stringify_keys
5
+ h = self.map do |k,v|
6
+ v_str = if v.instance_of? Hash
7
+ v.stringify_keys
8
+ else
9
+ v
10
+ end
11
+
12
+ [k.to_s, v_str]
13
+ end
14
+ Hash[h]
15
+ end
16
+ end
@@ -30,7 +30,7 @@ module Sfn
30
30
  def initialize(name, variables = {}, arn = nil)
31
31
  self.path = "#{Sfn.configuration.definition_path}/#{name}.json"
32
32
  self.name = name.split('/').last
33
- self.variables = variables
33
+ self.variables = (variables || {}).stringify_keys
34
34
  self.arn = arn || self.class.find_by_name(self.name)&.arn || create_state_machine
35
35
  self.executions = {}
36
36
  end
@@ -83,7 +83,7 @@ module Sfn
83
83
  local_definition = local_definition.gsub(/,[\s\n]+\}/, "\n}")
84
84
  local_definition = local_definition.gsub(/(\${[a-z_]+})/) do |variable|
85
85
  key = variable.gsub(/[${}]/, '')
86
- variables[key]
86
+ (self.variables[key] || variable).to_s
87
87
  end
88
88
  File.open(local_definition_path, 'w') { |file| file.puts local_definition }
89
89
  "file://#{local_definition_path}"
data/lib/sfn.rb CHANGED
@@ -11,3 +11,4 @@ require 'sfn/mock_macros'
11
11
  require 'sfn/execution'
12
12
  require 'sfn/execution_log'
13
13
  require 'string'
14
+ require 'hash'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-sfn-local
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.27
4
+ version: 0.1.29
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gianni Mazza
@@ -58,6 +58,7 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
+ - lib/hash.rb
61
62
  - lib/sfn.rb
62
63
  - lib/sfn/aws_cli.rb
63
64
  - lib/sfn/collection.rb