aws_sam_yarn_builder 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/aws_sam_yarn_builder/template.rb +7 -7
- data/lib/aws_sam_yarn_builder/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 86a48c920133cf42267ab5fc5244737b62a49cb3a5573f03606c5095e9c4780f
|
4
|
+
data.tar.gz: cd941f0b7c93ac952560560ce860bdce42530919dd3fe11f49653c8ccf599beb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c953d60b87d7f44da3911759e7818d405004247ec49e561d9fd97e2d856cfb02a1cc2fdf43821c15dd6380e0e06dee25a77e37c1ee53346d25744598896ca4e
|
7
|
+
data.tar.gz: 01f1979489c2db52e151df08be886cac5aec3fe449eb0786ccfad5985a7b51418af8fc3f3303fee616e1be09b2b631492f0f7e77023216029f95bacc01b316d9
|
data/Gemfile.lock
CHANGED
@@ -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 <<
|
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
|
55
|
-
|
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
|
-
|
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
|