aws_sam_yarn_builder 0.2.4 → 0.2.5
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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/aws_sam_yarn_builder/build.rb +7 -7
- data/lib/aws_sam_yarn_builder/template.rb +18 -0
- data/lib/aws_sam_yarn_builder/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 762229d65b7e22d038b3ab516aee8c0dab2a2c769b7dbe258db3b4324fcfee66
|
4
|
+
data.tar.gz: 7cc91f7e9cb33c33e1cda52a5d29eefacdd3493ac28caf2a8e8de9dac2b4ad59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 685d6b3659bc74c1478c395de4f7307586bae707a4e9fb4d7ffef3055ea7053e0df60073c5768824df10214c521a345ec1f82685aa81edff9b03561d20281f2d
|
7
|
+
data.tar.gz: 67ef963f33032315c382a63f0404a4a578fc1d178015e1ee821459cb1b66301c6893b0a0f79ac111843b346a454ae9d580dd395436bd1f5f699ae96b0df3424f
|
data/Gemfile.lock
CHANGED
@@ -18,18 +18,14 @@ module AwsSamYarnBuilder
|
|
18
18
|
reset_build_dir!
|
19
19
|
reset_staging_dir!
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
21
|
+
package = package_from_global_path(template.function_globals.path)
|
22
|
+
|
23
|
+
local_dependencies = package.dependencies.select(&:local?).flatten.uniq.compact
|
24
24
|
|
25
25
|
local_dependencies.each do |d|
|
26
26
|
d.pack destination_staging_dir
|
27
27
|
end
|
28
28
|
|
29
|
-
function_resource = template.function_resources.first
|
30
|
-
|
31
|
-
package = package_from_function(function_resource)
|
32
|
-
|
33
29
|
package.pack destination_staging_dir
|
34
30
|
package.build "UnifiedPackage", destination_dir, destination_staging_dir
|
35
31
|
|
@@ -94,6 +90,10 @@ module AwsSamYarnBuilder
|
|
94
90
|
package.dependencies.select(&:local?)
|
95
91
|
end
|
96
92
|
|
93
|
+
def package_from_global_path(path)
|
94
|
+
Package.extract_from_file! File.join(File.expand_path(File.join(template_base_dir, path)), "package.json")
|
95
|
+
end
|
96
|
+
|
97
97
|
def package_from_function(function)
|
98
98
|
Package.extract_from_file! File.join(File.expand_path(File.join(template_base_dir, function.path)), "package.json")
|
99
99
|
end
|
@@ -33,6 +33,20 @@ module AwsSamYarnBuilder
|
|
33
33
|
attr_writer :name
|
34
34
|
end
|
35
35
|
|
36
|
+
class FunctionGlobals
|
37
|
+
def initialize(properties = {})
|
38
|
+
self.properties = properties
|
39
|
+
end
|
40
|
+
|
41
|
+
def path
|
42
|
+
properties["CodeUri"]
|
43
|
+
end
|
44
|
+
|
45
|
+
protected
|
46
|
+
|
47
|
+
attr_accessor :properties
|
48
|
+
end
|
49
|
+
|
36
50
|
def self.extract_from_file!(file_path)
|
37
51
|
new file_path, File.read(file_path)
|
38
52
|
end
|
@@ -62,6 +76,10 @@ module AwsSamYarnBuilder
|
|
62
76
|
FunctionResource.new(raw_function_resource.first, raw_function_resource.last["Properties"])
|
63
77
|
end
|
64
78
|
|
79
|
+
def function_globals
|
80
|
+
FunctionGlobals.new(document["Globals"]["Function"])
|
81
|
+
end
|
82
|
+
|
65
83
|
protected
|
66
84
|
|
67
85
|
attr_accessor :contents, :path
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aws_sam_yarn_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Allam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-06-
|
11
|
+
date: 2019-06-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|