smg 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,14 +22,15 @@ module SMG #:nodoc:
22
22
  if thing = @mapping.nested[@stack] and
23
23
  !@parsed.include?(thing.object_id) &&
24
24
  thing.in_context_of?(@context) &&
25
- thing.with?(ahash ||= Hash[*attrs])
25
+ thing.with?(ahash ||= Hash[*attrs.flatten])
26
26
  @docs << Document.new(thing.data_class.new,@context,thing)
27
27
  end
28
28
 
29
29
  @docs.each { |doc| doc.start_element(name,attrs) }
30
30
 
31
31
  if !attrs.empty? && maps = @mapping.attributes[@stack]
32
- maps.values_at(*(ahash ||= Hash[*attrs]).keys).compact.each do |m|
32
+ #maps.values_at(*(ahash ||= Hash[*attrs]).keys).compact.each do |m|
33
+ maps.values_at(*(ahash ||= Hash[*attrs.flatten]).keys).flatten.compact.each do |m|
33
34
  if !@parsed.include?(m.object_id) &&
34
35
  m.in_context_of?(@context) &&
35
36
  m.with?(ahash)
@@ -42,7 +43,7 @@ module SMG #:nodoc:
42
43
  if e = @mapping.elements[@stack] and
43
44
  !@parsed.include?(e.object_id) &&
44
45
  e.in_context_of?(@context) &&
45
- e.with?(ahash ||= Hash[*attrs])
46
+ e.with?(ahash ||= Hash[*attrs.flatten])
46
47
  @elements << [e,""]
47
48
  end
48
49
 
@@ -15,7 +15,9 @@ module SMG #:nodoc:
15
15
  thing = Element.new(chain, options)
16
16
  if options.key?(:at)
17
17
  @attributes[chain] ||= {}
18
- @attributes[chain][thing.at] = thing
18
+ #@attributes[chain][thing.at] = thing
19
+ @attributes[chain][thing.at] ||= []
20
+ @attributes[chain][thing.at] << thing
19
21
  else
20
22
  @elements[chain] = thing
21
23
  end
@@ -41,6 +41,7 @@ module SMG #:nodoc:
41
41
 
42
42
  def root(tag)
43
43
  mapping.use_root(tag)
44
+ nil
44
45
  end
45
46
 
46
47
  def parse(data, context = nil)
@@ -1,5 +1,5 @@
1
1
  module SMG
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
4
4
 
5
5
  # EOF
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smg
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 2
10
- version: 0.2.2
9
+ - 3
10
+ version: 0.2.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - SSDany
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-07-16 00:00:00 +04:00
18
+ date: 2010-11-26 00:00:00 +03:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency