dockerfilemerge 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/dockerfilemerge.rb +11 -2
- data.tar.gz.sig +0 -0
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d599ded6bbbf1ead3a4579de11f1e238a506f8b
|
4
|
+
data.tar.gz: 711775e96daeb5264fb2177d1ca6056d7e055545
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ba0cd5909454789d330506239b7dd61157a7419ba3d1cccef0061dfca1def2b2e0f6491f0f0c55c7f50a6fc0f4645455c48aabcb7c71a4d26ba95a30bd32997
|
7
|
+
data.tar.gz: 9a2de95dfa4e9ddc0d582f38b13b4b7fb31b8157838212fccf304d43ae2ed10f805b7feab67148df70a601eb074d7a8ee479d5a475eeb7e6a7fab7ccf9297615
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/dockerfilemerge.rb
CHANGED
@@ -9,8 +9,10 @@ class DockerfileMerge
|
|
9
9
|
|
10
10
|
attr_reader :to_s
|
11
11
|
|
12
|
-
def initialize(
|
12
|
+
def initialize(raw_s)
|
13
13
|
|
14
|
+
s, type = RXFHelper.read(raw_s)
|
15
|
+
|
14
16
|
patterns = [
|
15
17
|
[:root, /INCLUDE\s*(?<path>.*)?/, :include],
|
16
18
|
[:include, /(?<path>.*)/, :dockerfile],
|
@@ -19,9 +21,16 @@ class DockerfileMerge
|
|
19
21
|
[:all, /#/, :comment]
|
20
22
|
]
|
21
23
|
|
24
|
+
s.sub!(/\A# Dockermergefile/,'# Dockerfile')
|
22
25
|
a = LineParser.new(patterns, ignore_blank_lines: false).parse s
|
23
26
|
|
24
27
|
lines = []
|
28
|
+
|
29
|
+
if type == :url then
|
30
|
+
lines << '# Generated ' + Time.now.strftime("%a %d-%b-%Y %-I:%M%P")
|
31
|
+
lines << '# source: ' + raw_s
|
32
|
+
end
|
33
|
+
|
25
34
|
|
26
35
|
a.each do |label, h, r, c| # h=hash, r=remaining, c=children
|
27
36
|
|
@@ -57,7 +66,7 @@ class DockerfileMerge
|
|
57
66
|
end
|
58
67
|
|
59
68
|
singlify lines, /^FROM /
|
60
|
-
singlify lines, /^CMD /
|
69
|
+
singlify lines, /^CMD /
|
61
70
|
|
62
71
|
@to_s = lines.join("\n")
|
63
72
|
end
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|