dockerfile2bash 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dockerfile2bash.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a785ccf9123004b91f8f80a4aa96f913f4e3b31
|
4
|
+
data.tar.gz: a94e356b891404ad6c98ab019e5923646ace1e5d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a3c308dc76f3956d82888731a531822fd3a6ffea27abd7850edf4c47c8a21508ab1b4e9a8edde2cb8858c6fca4917a98f83f1558f9cfbfcd42d6d2006c43403c
|
7
|
+
data.tar.gz: da146652ab20b0d3ca543b5dc81bf1346d2774ef8dc2acee9bc7214b125b38d6700afc29990b3114364c4af2530ac31670288090f70d0bcea2998a2b8f3a49c9
|
data/lib/dockerfile2bash.rb
CHANGED
@@ -2,7 +2,7 @@ require 'json'
|
|
2
2
|
require 'rest-client'
|
3
3
|
|
4
4
|
class Dockerfile2bash
|
5
|
-
VERSION = '0.1.
|
5
|
+
VERSION = '0.1.5'
|
6
6
|
attr_reader :commands
|
7
7
|
FIELDS = %w(from user run add copy arg env expose cmd onbuild)
|
8
8
|
|
@@ -13,7 +13,7 @@ class Dockerfile2bash
|
|
13
13
|
end
|
14
14
|
|
15
15
|
def parse
|
16
|
-
return
|
16
|
+
return if !@content || @content.empty?
|
17
17
|
@content.gsub!("\\\n", "")
|
18
18
|
lines = @content.split(/\r?\n+/) || []
|
19
19
|
|
@@ -22,7 +22,7 @@ class Dockerfile2bash
|
|
22
22
|
next if /^\s*$/ =~ line
|
23
23
|
next if /^\s*#/ =~ line
|
24
24
|
segments = line.split(" ", 2)
|
25
|
-
next if segments.length < 2
|
25
|
+
next if segments.length < 2 || !FIELDS.include?(segments[0].downcase)
|
26
26
|
|
27
27
|
case segments[0].downcase!
|
28
28
|
when "from", "user", "run", "expose", "copy", "add"
|