manifest 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/manifest.rb +14 -3
- data/lib/manifest/version.rb +1 -1
- metadata +2 -2
data/lib/manifest.rb
CHANGED
@@ -31,15 +31,26 @@ module Manifest
|
|
31
31
|
map.merge!(name=>nil)
|
32
32
|
else
|
33
33
|
valuesAsHash = {}
|
34
|
+
|
35
|
+
nestedList = false
|
34
36
|
values.split(/,/).inject([]) { |array, att1|
|
35
|
-
|
36
|
-
if
|
37
|
+
# split and then recompose. Not optimal at all but the manifest format is such a pain...
|
38
|
+
if nestedList
|
37
39
|
last = array.pop
|
38
|
-
array << "#{last},#{att1}"
|
40
|
+
array << "#{last},#{att1}"
|
39
41
|
else
|
40
42
|
array << att1
|
41
43
|
end
|
44
|
+
|
45
|
+
if (/.*"$/.match(att1))
|
46
|
+
nestedList = false
|
47
|
+
elsif /"/.match(att1) # if a " is in the value, it means we entered a subentry. And since it is not at the
|
48
|
+
# end of the line, we can conclude we are in a nested list.
|
49
|
+
nestedList = true
|
50
|
+
end
|
51
|
+
array
|
42
52
|
}.each { |attribute|
|
53
|
+
p attribute
|
43
54
|
optionalAttributes = {}
|
44
55
|
values = attribute.split(/;/)
|
45
56
|
value = values.shift
|
data/lib/manifest/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: manifest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Antoine Toulme
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-11 00:00:00 +02:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|