prick 0.20.18 → 0.20.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/builder/parser.rb +19 -11
- data/lib/prick/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 523f3f63b46850833fd679103f6a2ed389fee673376be4ffd54ab85ed76e9dfb
|
4
|
+
data.tar.gz: 58d881d1e9a5ebaea7b16caf35fc7d34670a6fa7f1a404357463f3dbbb73e81c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5f95a314a5dbaddef93d4e184ed5c10c35118b6e29f8ac8111589e4e79031dc83f254345853da84591edb9b511c5eab299dfa6716dc8db91b70361fe56ada12
|
7
|
+
data.tar.gz: '08eef7aaeea483bd45956898d290d69bb2859d41caafcc2ea64ce45bd9c2edd348a0cb003ba76054192e078fae3cf325c009ddb271d5d9e863915eb8eed95fe7'
|
data/lib/builder/parser.rb
CHANGED
@@ -76,31 +76,39 @@ module Prick
|
|
76
76
|
unit
|
77
77
|
end
|
78
78
|
|
79
|
+
def parse_file_entry(dir, entry)
|
80
|
+
name = entry.dup
|
81
|
+
name.sub!(/\$ENVIRONMENT/, Prick.state.environment.to_s)
|
82
|
+
name.sub!(/\/$/, "")
|
83
|
+
if name =~ /^(\S+)\s+(.*)$/ # exe
|
84
|
+
file = $1
|
85
|
+
args = $2
|
86
|
+
else
|
87
|
+
file = name
|
88
|
+
end
|
89
|
+
path = "#{dir}/#{file}"
|
90
|
+
[path, name, file, args]
|
91
|
+
end
|
92
|
+
|
79
93
|
def parse_entry(unit, phase, dir, entry)
|
80
94
|
if entry.is_a?(Hash)
|
81
95
|
entry.size == 1 or raise Error, "sql and module are single-line values"
|
82
96
|
key, value = entry.first
|
83
97
|
case key
|
84
98
|
when "sql"; InlineNode.new(unit, phase, unit.path, value)
|
85
|
-
when "call"
|
99
|
+
when "call"
|
86
100
|
args = value.split(/\s+/)
|
87
101
|
args.size >= 3 or raise "Illegal number of arguments: #{value}"
|
88
102
|
file, klass, command, args = *args
|
89
103
|
ModuleNode.new(unit, phase, "#{dir}/#{file}", klass, command, args)
|
104
|
+
when "exec"
|
105
|
+
path, name, file, args = parse_file_entry(dir, value)
|
106
|
+
ExeNode.new(unit, phase, path, args)
|
90
107
|
else
|
91
108
|
raise Error, "Illegal key: #{key}"
|
92
109
|
end
|
93
110
|
else
|
94
|
-
name = entry
|
95
|
-
name.sub!(/\$ENVIRONMENT/, Prick.state.environment.to_s)
|
96
|
-
name.sub!(/\/$/, "")
|
97
|
-
if name =~ /^(\S+)\s+(.*)$/ # exe
|
98
|
-
file = $1
|
99
|
-
args = $2
|
100
|
-
else
|
101
|
-
file = name
|
102
|
-
end
|
103
|
-
path = "#{dir}/#{file}"
|
111
|
+
path, name, file, args = parse_file_entry(dir, entry)
|
104
112
|
if File.directory? path
|
105
113
|
parse_directory(unit, path)
|
106
114
|
elsif File.executable? path
|
data/lib/prick/version.rb
CHANGED