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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d40e04f3b48e80d1462a9d19b897705f9592a27
4
- data.tar.gz: ba2590f77eb7bda5a6a92e5d91174972cc38432f
3
+ metadata.gz: 0d599ded6bbbf1ead3a4579de11f1e238a506f8b
4
+ data.tar.gz: 711775e96daeb5264fb2177d1ca6056d7e055545
5
5
  SHA512:
6
- metadata.gz: 2d17a85a94fffebb4e826e99974745cb5e889f50bb652d6922569fbf6b57aaddffe82ac3f7077e7057c7fc4c71615b09ccd6ef49f43d5fcb930f0d727454530d
7
- data.tar.gz: 4b482dc7df40d34b1ad97494d2bf2cb5229ec8cc2c7c0acabd391d00ece6e6f7a48c92f4bbbd052221daf9f4a4316fbe0b800d22581623b620ebaf44fb4b43e8
6
+ metadata.gz: 5ba0cd5909454789d330506239b7dd61157a7419ba3d1cccef0061dfca1def2b2e0f6491f0f0c55c7f50a6fc0f4645455c48aabcb7c71a4d26ba95a30bd32997
7
+ data.tar.gz: 9a2de95dfa4e9ddc0d582f38b13b4b7fb31b8157838212fccf304d43ae2ed10f805b7feab67148df70a601eb074d7a8ee479d5a475eeb7e6a7fab7ccf9297615
checksums.yaml.gz.sig CHANGED
Binary file
@@ -9,8 +9,10 @@ class DockerfileMerge
9
9
 
10
10
  attr_reader :to_s
11
11
 
12
- def initialize(s)
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
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dockerfilemerge
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
metadata.gz.sig CHANGED
Binary file