dockerfilemerge 0.3.0 → 0.3.1
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 +1 -1
- data/lib/dockerfilemerge.rb +12 -4
- data.tar.gz.sig +0 -0
- metadata +2 -2
- 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: a473168ffb22459fec1a66528f549bf62e40fc12
|
4
|
+
data.tar.gz: 1cabcdd721e4ceaf4eea43d9562fdd83eb077552
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e54453818d8eac55c4a22ddc147a81cab71414eca7799624f3b94fc61a9b80d95e9f958c5e3d8c1673c61b31172dcc0dbd9caeeaa37d83fc891e75464bd46e6b
|
7
|
+
data.tar.gz: ff46cf37d4cae95e0c4cd18709c2f7c7230d36425a4f2e291459d76d6127d1232a25402f2e6b800a0da7a3e8783d7a1f27d57a096e03b47a4129629f63619bd6
|
checksums.yaml.gz.sig
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
��È�Q��;;\��+|�������K��GU�c��j�a.����Ўy}$�3��H`r�'����`� ���m^�⁑�#��v���n=��lEw�t@�~����oV���jq���a�z�e����'4Yv�G�S�潄�s�F�������^��"hoSENYZ�1���ʖ��2�̘�Qi�{��n30�A�C}:<��$-����<����U�^<�=��Sֳ��l�Vj�2㖈�W�&�2���LY�c�O
|
data/lib/dockerfilemerge.rb
CHANGED
@@ -14,6 +14,7 @@ class DockerfileMerge
|
|
14
14
|
s, type = RXFHelper.read(raw_s)
|
15
15
|
|
16
16
|
patterns = [
|
17
|
+
[:root, /FROM\s+(?<from>.*)/, :from],
|
17
18
|
[:root, /INCLUDE\s*(?<path>.*)?/, :include],
|
18
19
|
[:include, /(?<path>.*)/, :dockerfile],
|
19
20
|
[:root, /MAINTAINER (?<name>.*)/, :maintainer],
|
@@ -34,10 +35,17 @@ class DockerfileMerge
|
|
34
35
|
|
35
36
|
a.each do |label, h, r, c| # h=hash, r=remaining, c=children
|
36
37
|
|
38
|
+
line = r.first
|
39
|
+
|
37
40
|
case label
|
41
|
+
when :from
|
42
|
+
|
43
|
+
lines << line
|
44
|
+
lines << '' if r.length > 1
|
45
|
+
|
38
46
|
when :comment
|
39
47
|
|
40
|
-
lines <<
|
48
|
+
lines << line
|
41
49
|
lines << '' if r.length > 1
|
42
50
|
|
43
51
|
when :include
|
@@ -50,7 +58,7 @@ class DockerfileMerge
|
|
50
58
|
|
51
59
|
maintainers = lines.grep(/MAINTAINER/)
|
52
60
|
i = lines.index maintainers.shift
|
53
|
-
lines[i] =
|
61
|
+
lines[i] = line
|
54
62
|
|
55
63
|
maintainers.each {|x| lines.delete x}
|
56
64
|
|
@@ -58,7 +66,7 @@ class DockerfileMerge
|
|
58
66
|
|
59
67
|
i = lines.index lines.grep(/RUN/).last
|
60
68
|
i+=1 while lines[i][/\\\s*$/]
|
61
|
-
lines.insert(i+1,
|
69
|
+
lines.insert(i+1, line)
|
62
70
|
lines.insert(i+2, ' ' + r[1..-1].join("\n ").rstrip) if r.length > 1
|
63
71
|
|
64
72
|
end
|
@@ -74,7 +82,7 @@ class DockerfileMerge
|
|
74
82
|
private
|
75
83
|
|
76
84
|
def merge_file(lines, path)
|
77
|
-
|
85
|
+
|
78
86
|
raw_buffer, type = RXFHelper.read(path)
|
79
87
|
buffer = raw_buffer[/^\bINCLUDE\b/] ? \
|
80
88
|
DockerfileMerge.new(raw_buffer).to_s : raw_buffer
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dockerfilemerge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
WHpJ21HYl4KWG8TISerrdwpQAZ5dhV2Yy/4q0MWSnDcMRSYdRAixOcdYW+U+R8cz
|
32
32
|
pf2JrQZNdYZXIg==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2015-07-
|
34
|
+
date: 2015-07-12 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: lineparser
|
metadata.gz.sig
CHANGED
Binary file
|