aws_sam_yarn_builder 0.1.2 → 0.1.3

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
  SHA256:
3
- metadata.gz: 84a6ff9a256e1732ea9e35fbe0797cb6acc7182513adf75398170d2ac35958b3
4
- data.tar.gz: 5d60e78270fd623c4c5d7bff2d972a1e3a5457634e651c5a60cceb65c2ed8110
3
+ metadata.gz: 86a48c920133cf42267ab5fc5244737b62a49cb3a5573f03606c5095e9c4780f
4
+ data.tar.gz: cd941f0b7c93ac952560560ce860bdce42530919dd3fe11f49653c8ccf599beb
5
5
  SHA512:
6
- metadata.gz: 04b422bbcc7c58b4020bb0a1d4698c7811c78ac1b71086702f874865e2e920ba3e496ee41b1a65f89b79865fecc128c55521069cd02f54daf1780242e0f905c5
7
- data.tar.gz: e5f56b438c8a09b61330368a87c43a8d5604adf9c3cdbb3da67bcc0f4a8b1c704afccf0804f9656bae6460405807b3d1ccb067e166f9563dd17ffe8b7293d6c9
6
+ metadata.gz: 8c953d60b87d7f44da3911759e7818d405004247ec49e561d9fd97e2d856cfb02a1cc2fdf43821c15dd6380e0e06dee25a77e37c1ee53346d25744598896ca4e
7
+ data.tar.gz: 01f1979489c2db52e151df08be886cac5aec3fe449eb0786ccfad5985a7b51418af8fc3f3303fee616e1be09b2b631492f0f7e77023216029f95bacc01b316d9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aws_sam_yarn_builder (0.1.1)
4
+ aws_sam_yarn_builder (0.1.2)
5
5
  activesupport (~> 5.2.2)
6
6
  slop (~> 4.6.0)
7
7
 
@@ -31,7 +31,7 @@ module AwsSamYarnBuilder
31
31
 
32
32
  def write_to_output(output)
33
33
  File.open(File.join(output, "template.yaml"), "w+") do |file|
34
- file << YAML.dump(document_with_transformed_function_paths)
34
+ file << contents_with_transformed_function_paths
35
35
  end
36
36
  end
37
37
 
@@ -51,14 +51,14 @@ module AwsSamYarnBuilder
51
51
  @document ||= YAML.load(contents)
52
52
  end
53
53
 
54
- def document_with_transformed_function_paths
55
- transformed_document = Marshal.load(Marshal.dump(document))
56
-
57
- raw_function_resources.each do |name, resource|
58
- transformed_document["Resources"][name]["Properties"]["CodeUri"] = "./#{name}"
54
+ def contents_with_transformed_function_paths
55
+ contents.gsub(/CodeUri:\s*(.*)/) do |_|
56
+ "CodeUri: ./#{find_function_name_for_code_uri($1)}"
59
57
  end
58
+ end
60
59
 
61
- transformed_document
60
+ def find_function_name_for_code_uri(code_uri)
61
+ raw_function_resources.detect { |name, options| options["Properties"]["CodeUri"] == code_uri }.first
62
62
  end
63
63
 
64
64
  def raw_resources
@@ -1,3 +1,3 @@
1
1
  module AwsSamYarnBuilder
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws_sam_yarn_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Allam