dockerfilemerge 0.3.0 → 0.3.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b63e0bcfcb59f559285571c5e19848a61caf857
4
- data.tar.gz: 84451eb6af66352739206c2e491dc82cbff970c5
3
+ metadata.gz: a473168ffb22459fec1a66528f549bf62e40fc12
4
+ data.tar.gz: 1cabcdd721e4ceaf4eea43d9562fdd83eb077552
5
5
  SHA512:
6
- metadata.gz: 461e0f16154793598931f7e844ded1b9b9478b0fceae5c7e48a0a8225fd211fbc9f46928358518837e84ce751770cd5a34df117b2a0792bfd430379154429827
7
- data.tar.gz: 7938eaef56ee5a5880200f113c0ff2ad6b3fb6c60275095833bc0f12b2bc69694054a258ba97fe5ff7e9919bcd5c5c258dcdf3292e67728375a5fa2302499046
6
+ metadata.gz: e54453818d8eac55c4a22ddc147a81cab71414eca7799624f3b94fc61a9b80d95e9f958c5e3d8c1673c61b31172dcc0dbd9caeeaa37d83fc891e75464bd46e6b
7
+ data.tar.gz: ff46cf37d4cae95e0c4cd18709c2f7c7230d36425a4f2e291459d76d6127d1232a25402f2e6b800a0da7a3e8783d7a1f27d57a096e03b47a4129629f63619bd6
checksums.yaml.gz.sig CHANGED
@@ -1 +1 @@
1
- 5�}T��q�&fpd�:��Uڦ���E!�_�힯w?��Oǎ� �8V�*^��fW˶�碏0� )V�s�ف0pJny�:����O�����Xcbv�G`��H<�]ݸ��C�ۛ�R� D(��`~����PH9���<�G���h�?�����>{p�=�Lx(d|��m{���%�k��ߢ�r4y�Ƀ"j���ID�BvY���Yh ],NP_��n,ȕ�2�`Y��W~g����W
1
+ ��È�Q��;;\��+|�������K��GUc��j�a.����Ўy}$�3��H`r�'����`� ���m^�⁑�#��v ���n=��lEwt@�~����oV���jq���aze����'4Yv�G�S�潄�s�F�������^��"hoSENYZ1���ʖ��2�̘�Qi{��n30AC}:<��$-����<����U�^<�=��Sֳ��lVj2㖈�W�&�2���LYc�O
@@ -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 << r.first
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] = r.first
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, r.first)
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.0
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-11 00:00:00.000000000 Z
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