dslize 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,7 +12,7 @@ module DSLize
12
12
 
13
13
  protected
14
14
  def get_subclasses(type)
15
- superclasses.select { |k,v| v.to_s == type.to_s }.keys
15
+ superclasses.select { |k,v| v.to_s == type.to_s }.keys.map { |k| (!objects[k][:abstract] ? [k] : []) + get_subclasses(k) }.flatten
16
16
  end
17
17
  end
18
18
 
@@ -27,6 +27,11 @@ module DSLize
27
27
  xsd.element(nil, { :ref => clazz, :maxOccurs => max_occurs }.select { |k,v| !v.nil? })
28
28
  else
29
29
  xsd.choice({ :maxOccurs => max_occurs }.select { |k,v| !v.nil? }) do
30
+ xsd.annotation do
31
+ xsd.appinfo do
32
+ xsd.property :name => clazz, :xmlns => "http://java.sun.com/xml/ns/jaxb"
33
+ end
34
+ end
30
35
  subclasses.each do |sub_type|
31
36
  xsd.element(nil, :ref => sub_type)
32
37
  end
@@ -53,7 +58,8 @@ module DSLize
53
58
  end
54
59
 
55
60
  File.open(args[0], "w") do |f|
56
- f << schema.to_xml.gsub(' name=""', '') # xpain is buggy and always write a name on <element>
61
+ f << schema.to_xml.gsub(' name=""', ''). # xpain is buggy and always write a name on <element>
62
+ gsub(' xmlns:xsd="http://www.w3.org/2001/XMLSchema"', ' xmlns:xsd="http://www.w3.org/2001/XMLSchema" jaxb:version="2.0" elementFormDefault="qualified" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"')
57
63
  end
58
64
  end
59
65
 
@@ -1,3 +1,3 @@
1
1
  module DSLize
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 4
9
- version: 0.0.4
8
+ - 5
9
+ version: 0.0.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - redox
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2012-07-12 00:00:00 +02:00
17
+ date: 2012-07-13 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20