xamplr 1.2.0 → 1.3.15
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.gitignore +12 -0
- data/CHANGES.txt +37 -0
- data/COPYING +661 -0
- data/Makefile +13 -0
- data/README.rdoc +24 -4
- data/Rakefile +2 -2
- data/VERSION.yml +3 -2
- data/bin/xampl-gen +17 -0
- data/docs/intro/.gitignore +1 -0
- data/docs/intro/example1/example1.rb +6 -0
- data/docs/intro/example1/xml/hello.xml +1 -0
- data/docs/intro/example2/example2.rb +38 -0
- data/docs/intro/example2/project-generator.rb +22 -0
- data/docs/intro/example2/xml/hello.xml +2 -0
- data/docs/intro/example3/example3.rb +30 -0
- data/docs/intro/example3/example3a.rb +16 -0
- data/docs/intro/example3/generated.png +0 -0
- data/docs/intro/example3/grab-yuml.rb +10 -0
- data/docs/intro/example3/greeter.rb +15 -0
- data/docs/intro/example3/greeting.rb +9 -0
- data/docs/intro/example3/project-generator.rb +25 -0
- data/docs/intro/example3/xml/greeter.xml +6 -0
- data/docs/intro/example4/example4.rb +27 -0
- data/docs/intro/example4/example4a.rb +19 -0
- data/docs/intro/example4/grab-yuml.rb +10 -0
- data/docs/intro/example4/greeter.rb +15 -0
- data/docs/intro/example4/greeting.rb +9 -0
- data/docs/intro/example4/project-generator.rb +25 -0
- data/docs/intro/example4/xml/greeter.xml +6 -0
- data/docs/intro/grab-yuml.rb +10 -0
- data/docs/intro/project-generator.rb +51 -0
- data/docs/intro/xampl.lyx +1494 -0
- data/docs/intro/xampl.pdf +0 -0
- data/examples/employees/final/xampl-gen.rb +38 -0
- data/examples/employees/final/xml/ddd-final.xml +86 -0
- data/examples/employees/final-xampl/xampl-gen.rb +38 -0
- data/examples/employees/final-xampl/xml/ddd-final-xampl.xml +86 -0
- data/examples/employees/first/xampl-gen.rb +38 -0
- data/examples/employees/first/xml/ddd-first.xml +48 -0
- data/examples/employees/twist/twist.graphml +333 -0
- data/examples/employees/twist/xampl-gen.rb +38 -0
- data/examples/employees/twist/xml/twist.xml +90 -0
- data/examples/employees/xamplr-twist.xml +2 -0
- data/examples/employees/yuml-diagrams/DDD-final-approach.graphml +393 -0
- data/examples/employees/yuml-diagrams/DDD-final-xampl-approach.graphml +265 -0
- data/examples/employees/yuml-diagrams/DDD-ideal-final-approach.graphml +357 -0
- data/examples/employees/yuml-diagrams/ddd-final.png +0 -0
- data/examples/employees/yuml-diagrams/ddd-final.yuml +8 -0
- data/examples/employees/yuml-diagrams/ddd-first.png +0 -0
- data/examples/employees/yuml-diagrams/ddd-first.yuml +7 -0
- data/examples/employees/yuml-diagrams/final-yed.png +0 -0
- data/examples/employees/yuml-diagrams/first-yed.png +0 -0
- data/examples/employees/yuml-diagrams/twist.png +0 -0
- data/examples/employees/yuml-diagrams/twist.yuml +12 -0
- data/examples/employees/yuml-diagrams/xamplr-final-no-mixins.png +0 -0
- data/examples/employees/yuml-diagrams/xamplr-final-simplified.png +0 -0
- data/examples/employees/yuml-diagrams/xamplr-final-with-mixins.png +0 -0
- data/examples/employees/yuml-diagrams/yuml-simplified.txt +19 -0
- data/examples/employees/yuml-diagrams/yuml-with-mixins.txt +53 -0
- data/examples/employees/yuml-diagrams/yuml.txt +27 -0
- data/examples/hobbies/Makefile +5 -0
- data/examples/hobbies/hobbies.rb +193 -0
- data/examples/hobbies/project-generator.rb +25 -0
- data/examples/hobbies/xampl-gen.rb +38 -0
- data/examples/hobbies/xml/hobby.xml +3 -0
- data/examples/hobbies/xml/people.xml +5 -0
- data/examples/random-people/.gitignore +2 -0
- data/examples/random-people/Makefile +5 -1
- data/examples/random-people/xampl-gen.rb +5 -2
- data/examples/random-people-shared-addresses/.gitignore +2 -0
- data/examples/random-people-shared-addresses/Makefile +8 -9
- data/examples/random-people-shared-addresses/batch-load-users-profiled.rb +91 -0
- data/examples/random-people-shared-addresses/batch-load-users-safe.rb +81 -0
- data/examples/random-people-shared-addresses/batch-load-users.rb +59 -63
- data/examples/random-people-shared-addresses/xampl-gen.rb +2 -0
- data/examples/read-testing/.gitignore +2 -0
- data/examples/read-testing/rrr.rb +2 -1
- data/examples/read-testing/xampl-gen.rb +2 -0
- data/examples/tokyo-cabinet-experimental/.gitignore +2 -0
- data/examples/tokyo-cabinet-experimental/xampl-gen.rb +2 -0
- data/examples/write-testing/README +4 -0
- data/examples/write-testing/RESULTS.home +33 -0
- data/examples/write-testing/RESULTS.raconteur +33 -0
- data/examples/write-testing/write-speed-test.rb +40 -0
- data/lib/xamplr/.cvsignore +1 -0
- data/lib/xamplr/TODO +2 -1
- data/lib/xamplr/exceptions.rb +24 -1
- data/lib/xamplr/from-xml.rb +13 -5
- data/lib/xamplr/graphml-out.rb +6 -25
- data/lib/xamplr/indexed-array.rb +10 -2
- data/lib/xamplr/persist-to-xml.rb +6 -7
- data/lib/xamplr/persistence.rb +132 -48
- data/lib/xamplr/persister.rb +48 -25
- data/lib/xamplr/persisters/filesystem.rb +8 -2
- data/lib/xamplr/persisters/tokyo-cabinet.rb +243 -63
- data/lib/xamplr/persisters/tokyo-cabinet.rb.1-DB +694 -0
- data/lib/xamplr/persisters/tokyo-cabinet.rb.N-DB +692 -0
- data/lib/xamplr/persisters/tokyo-cabinet.rb.NICE-TRY +807 -0
- data/lib/xamplr/templates/.cvsignore +3 -0
- data/lib/xamplr/templates/child_indexed.template +6 -6
- data/lib/xamplr/templates/element_data.template +2 -1
- data/lib/xamplr/templates/element_empty.template +2 -10
- data/lib/xamplr/templates/element_mixed.template +2 -1
- data/lib/xamplr/templates/element_simple.template +2 -1
- data/lib/xamplr/templates/package.template +13 -1
- data/lib/xamplr/visitor.rb +7 -6
- data/lib/xamplr/visitors.rb +2 -1
- data/lib/xamplr/xampl-cl-gen.rb +89 -0
- data/lib/xamplr/xampl-generator.rb +86 -50
- data/lib/xamplr/xampl-object.rb +51 -0
- data/lib/xamplr/xampl-persisted-object.rb +13 -4
- data/lib/xamplr/yuml-out.rb +129 -0
- data/lib/xamplr-generator.rb +0 -1
- data/lib/xamplr.rb +18 -18
- data/regression/tc-indexes-crossing-pid-boundaries/Makefile +14 -0
- data/regression/tc-indexes-crossing-pid-boundaries/bad-idea.rb +40 -0
- data/regression/tc-indexes-crossing-pid-boundaries/fail-badly.rb +17 -0
- data/regression/tc-indexes-crossing-pid-boundaries/fail.rb +11 -0
- data/regression/tc-indexes-crossing-pid-boundaries/fucking-bad-idea.rb +44 -0
- data/regression/tc-indexes-crossing-pid-boundaries/setup.rb +15 -0
- data/regression/tc-indexes-crossing-pid-boundaries/xml/bad-idea.xml +4 -0
- data/regression/tightly-nested-mutual-mentions/Makefile +14 -0
- data/regression/tightly-nested-mutual-mentions/build.rb +31 -0
- data/regression/tightly-nested-mutual-mentions/load.rb +21 -0
- data/regression/tightly-nested-mutual-mentions/repo-keep.tgz +0 -0
- data/regression/tightly-nested-mutual-mentions/setup.rb +8 -0
- data/regression/tightly-nested-mutual-mentions/xampl-gen.rb +36 -0
- data/regression/tightly-nested-mutual-mentions/xml/stuff.xml +7 -0
- data/xamplr.gemspec +322 -0
- metadata +116 -13
- data/test/test_helper.rb +0 -10
- data/test/xamplr_test.rb +0 -7
data/README.rdoc
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
xamplr is a set of software tools that supports development of ruby applications.
|
4
4
|
|
5
|
-
Features:
|
5
|
+
== Features:
|
6
|
+
|
6
7
|
- supports Domain Driven Design in Ruby
|
7
8
|
- persistence ignornace
|
8
9
|
- clusters, entities, 'regular' objects, and repositories (corresponding approximately to DDD's aggregates, entities, value objects, and repositories)
|
@@ -12,15 +13,34 @@ Features:
|
|
12
13
|
- fast development, fast execution
|
13
14
|
- has been in use in commercial software since 2004, a Java version has been in use since 1998.
|
14
15
|
|
15
|
-
Anti-Features:
|
16
|
+
== Anti-Features:
|
17
|
+
|
16
18
|
- absymal lack of documentation. If you are brave and willing to wade through (old) blog entries, you might try looking at:
|
17
19
|
|
18
20
|
http://recursive.ca/hutch/category/software/tools-i-use/xampl/
|
19
21
|
|
20
|
-
|
22
|
+
== Installation:
|
23
|
+
|
24
|
+
The stable release is hosted on rubyforge as a gem, so:
|
25
|
+
|
26
|
+
[sudo] gem install xamplr
|
27
|
+
|
28
|
+
The most recent release is hosted on github, also as a gem, so:
|
29
|
+
|
30
|
+
gem sources -a http://gems.github.com
|
31
|
+
[sudo] gem install hutch-xamplr
|
32
|
+
|
33
|
+
The most recent code is in the repository, so clone the github project and either
|
34
|
+
use it directly (with a little fooling about with load paths), or build it as a gem
|
35
|
+
and install locally.
|
36
|
+
|
37
|
+
== License:
|
38
|
+
|
39
|
+
For the moment it is AGPLv3 (see COPYING). An alternative license
|
21
40
|
may be negotiated, contact me. In the near future this license will be
|
22
41
|
relaxed.
|
23
42
|
|
24
|
-
|
43
|
+
Copyright Info:
|
25
44
|
|
26
45
|
Copyright (c) 2009 Bob Hutchison. See LICENSE and COPYING for details.
|
46
|
+
|
data/Rakefile
CHANGED
@@ -11,8 +11,8 @@ begin
|
|
11
11
|
gem.authors = ["Bob Hutchison"]
|
12
12
|
gem.rubyforge_project = 'xampl'
|
13
13
|
|
14
|
-
gem.add_dependency('
|
15
|
-
gem.add_dependency('libxml-ruby',
|
14
|
+
gem.add_dependency('xamplr-pp', '>=1.1.2')
|
15
|
+
gem.add_dependency('libxml-ruby', '>=1.1.3')
|
16
16
|
|
17
17
|
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
18
18
|
end
|
data/VERSION.yml
CHANGED
data/bin/xampl-gen
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#!/usr/bin/env ruby -w -I..
|
3
|
+
|
4
|
+
require 'xamplr-generator'
|
5
|
+
require 'xamplr/xampl-cl-gen'
|
6
|
+
|
7
|
+
include XamplGenerator
|
8
|
+
include Xampl
|
9
|
+
|
10
|
+
project_specialisations = File.join(%w{ . project-generator.rb })
|
11
|
+
if File.exists?(project_specialisations) then
|
12
|
+
load project_specialisations
|
13
|
+
end
|
14
|
+
|
15
|
+
generator = ProjectGenerator.new
|
16
|
+
generator.generate
|
17
|
+
|
@@ -0,0 +1 @@
|
|
1
|
+
*.yuml
|
@@ -0,0 +1 @@
|
|
1
|
+
<hello-world/>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'xampl_generated_code/Example2.rb'
|
2
|
+
|
3
|
+
include Example2
|
4
|
+
|
5
|
+
class Hello
|
6
|
+
def to_s
|
7
|
+
"Hello #{ who ? who : 'hello?' }!"
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
Xampl.transaction("example2") do
|
12
|
+
h = Hello.new
|
13
|
+
|
14
|
+
puts "haven't set the who attribute yet..."
|
15
|
+
puts h.to_xml
|
16
|
+
puts h
|
17
|
+
|
18
|
+
h.who = 'world'
|
19
|
+
|
20
|
+
puts "\nhave set the who attribute to 'world'..."
|
21
|
+
puts h.to_xml
|
22
|
+
puts h.pp_xml
|
23
|
+
puts h
|
24
|
+
|
25
|
+
h2 = Hello.new
|
26
|
+
h2.who = 'there'
|
27
|
+
|
28
|
+
all = [ h, h2 ]
|
29
|
+
|
30
|
+
puts "\nthere are two Hello things now..."
|
31
|
+
puts h
|
32
|
+
puts h2
|
33
|
+
|
34
|
+
puts "\nprint an array of the two Hello things..."
|
35
|
+
puts all
|
36
|
+
puts "\ninspect an array of the two Hello things..."
|
37
|
+
puts all.inspect
|
38
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
class ProjectGenerator
|
2
|
+
|
3
|
+
def resolve_namespaces
|
4
|
+
# any array of arrays
|
5
|
+
# each sub-array:
|
6
|
+
# 0: a string or an array of strings, containing xml namespaces found
|
7
|
+
# in the example xml files an empty string is the default namespace
|
8
|
+
# 1: a ruby Module name (get the character cases right)
|
9
|
+
# 2: a namespace prefix used when writing xml, optional. A generated
|
10
|
+
# prefix will be used otherwise.
|
11
|
+
|
12
|
+
#[]
|
13
|
+
|
14
|
+
[
|
15
|
+
[ 'com.xampl.intro.example2', 'Example2', 'ex2']
|
16
|
+
]
|
17
|
+
|
18
|
+
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'greeter'
|
2
|
+
require 'greeting'
|
3
|
+
|
4
|
+
##include Example3 -- nope, not this time
|
5
|
+
|
6
|
+
Xampl.transaction("example3") do
|
7
|
+
greeter = Example3::Greeter.new
|
8
|
+
|
9
|
+
greeting1 = Example3::Greeting.new('has-name')
|
10
|
+
greeting1.content = "Hello $$$, how are you?"
|
11
|
+
greeter << greeting1
|
12
|
+
|
13
|
+
greeter.new_who.name = 'world'
|
14
|
+
greeter.new_who.name = 'there'
|
15
|
+
|
16
|
+
greeting2 = greeter.new_greeting('no-name')
|
17
|
+
greeting2.content = "Hello hello? Someone there?"
|
18
|
+
|
19
|
+
greeter.new_who
|
20
|
+
|
21
|
+
puts greeter.to_xml
|
22
|
+
puts greeter.pp_xml
|
23
|
+
|
24
|
+
puts "\nAnd now extend our greetings..."
|
25
|
+
|
26
|
+
greeter.extend_greetings
|
27
|
+
|
28
|
+
puts "\nwriting the xml representation of our greeter..."
|
29
|
+
File.open('greeter.xml', 'w') { |f| f.write greeter.to_xml }
|
30
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'greeter'
|
2
|
+
require 'greeting'
|
3
|
+
|
4
|
+
unless File.exists? "greeter.xml" then
|
5
|
+
puts "run example3 before running this one"
|
6
|
+
exit
|
7
|
+
end
|
8
|
+
|
9
|
+
xml = File.open("greeter.xml") { | f | f.read }
|
10
|
+
|
11
|
+
Xampl.transaction("example3") do
|
12
|
+
greeter = Xampl.from_xml_string(xml)
|
13
|
+
|
14
|
+
puts "\nAnd now extend our greetings..."
|
15
|
+
greeter.extend_greetings
|
16
|
+
end
|
Binary file
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
diagram = ""
|
3
|
+
File.open("./generated.yuml") do | f |
|
4
|
+
f.each do | line |
|
5
|
+
diagram << line.chomp
|
6
|
+
end
|
7
|
+
end
|
8
|
+
wget = "wget 'http://yuml.me/diagram/scruffy/class/#{diagram}' -O 'generated.png'"
|
9
|
+
#wget = "wget 'http://yuml.me/diagram/scruffy/class/#{diagram}.pdf' -O 'generated.pdf'"
|
10
|
+
`#{wget}`
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'xampl_generated_code/Example3.rb'
|
2
|
+
|
3
|
+
module Example3
|
4
|
+
class Greeter
|
5
|
+
def extend_greetings
|
6
|
+
who.each do | who |
|
7
|
+
if who.name then
|
8
|
+
puts greeting['has-name'].extend_greeting(who.name)
|
9
|
+
else
|
10
|
+
puts greeting['no-name'].extend_greeting
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class ProjectGenerator
|
2
|
+
|
3
|
+
def print_options
|
4
|
+
# return an array containing any (or none) of:
|
5
|
+
# :schema -- a schema-like xml representation of the generated code
|
6
|
+
# :graphml -- a graphml file describing the class model (compatible with yEd)
|
7
|
+
# :yuml -- a yuml file that represents a simplified class model (compatible with yUML)
|
8
|
+
|
9
|
+
[ :yuml ]
|
10
|
+
end
|
11
|
+
|
12
|
+
def resolve_namespaces
|
13
|
+
# any array of arrays
|
14
|
+
# each sub-array:
|
15
|
+
# 0: a string or an array of strings, containing xml namespaces found
|
16
|
+
# in the example xml files an empty string is the default namespace
|
17
|
+
# 1: a ruby Module name (get the character cases right)
|
18
|
+
# 2: a namespace prefix used when writing xml, optional. A generated
|
19
|
+
# prefix will be used otherwise.
|
20
|
+
|
21
|
+
[
|
22
|
+
[ 'com.xampl.intro.example3', 'Example3', 'ex3']
|
23
|
+
]
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'greeter'
|
2
|
+
require 'greeting'
|
3
|
+
|
4
|
+
##include Example3 -- nope, not this time
|
5
|
+
|
6
|
+
Xampl.transaction("example3") do
|
7
|
+
greeter = Example3::Greeter.new
|
8
|
+
|
9
|
+
greeting1 = Example3::Greeting.new('has-name')
|
10
|
+
greeting1.content = "Hello $$$, how are you?"
|
11
|
+
greeter << greeting1
|
12
|
+
|
13
|
+
greeter.new_who.name = 'world'
|
14
|
+
greeter.new_who.name = 'there'
|
15
|
+
|
16
|
+
greeting2 = greeter.new_greeting('no-name')
|
17
|
+
greeting2.content = "Hello hello? Someone there?"
|
18
|
+
|
19
|
+
greeter.new_who
|
20
|
+
|
21
|
+
puts greeter.to_xml
|
22
|
+
puts greeter.pp_xml
|
23
|
+
|
24
|
+
puts "\nAnd now extend our greetings..."
|
25
|
+
|
26
|
+
greeter.extend_greetings
|
27
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'greeter'
|
2
|
+
require 'greeting'
|
3
|
+
|
4
|
+
xml = <<EOX
|
5
|
+
<ex3:greeter xmlns:ex3='com.xampl.intro.example3'>
|
6
|
+
<ex3:greeting id='has-name'>Hello $$$, how are you?</ex3:greeting>
|
7
|
+
<ex3:who name='world'/>
|
8
|
+
<ex3:who name='there'/>
|
9
|
+
<ex3:greeting id='no-name'>Hello hello? Someone there?</ex3:greeting>
|
10
|
+
<ex3:who/></ex3:greeter>
|
11
|
+
EOX
|
12
|
+
|
13
|
+
Xampl.transaction("example3") do
|
14
|
+
greeter = Xampl.from_xml_string(xml)
|
15
|
+
puts greeter.pp_xml
|
16
|
+
|
17
|
+
puts "\nAnd now extend our greetings..."
|
18
|
+
greeter.extend_greetings
|
19
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
diagram = ""
|
3
|
+
File.open("./generated.yuml") do | f |
|
4
|
+
f.each do | line |
|
5
|
+
diagram << line.chomp
|
6
|
+
end
|
7
|
+
end
|
8
|
+
wget = "wget 'http://yuml.me/diagram/scruffy/class/#{diagram}' -O 'generated.png'"
|
9
|
+
#wget = "wget 'http://yuml.me/diagram/scruffy/class/#{diagram}.pdf' -O 'generated.pdf'"
|
10
|
+
`#{wget}`
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'xampl_generated_code/Example3.rb'
|
2
|
+
|
3
|
+
module Example3
|
4
|
+
class Greeter
|
5
|
+
def extend_greetings
|
6
|
+
who.each do | who |
|
7
|
+
if who.name then
|
8
|
+
puts greeting['has-name'].extend_greeting(who.name)
|
9
|
+
else
|
10
|
+
puts greeting['no-name'].extend_greeting
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class ProjectGenerator
|
2
|
+
|
3
|
+
def print_options
|
4
|
+
# return an array containing any (or none) of:
|
5
|
+
# :schema -- a schema-like xml representation of the generated code
|
6
|
+
# :graphml -- a graphml file describing the class model (compatible with yEd)
|
7
|
+
# :yuml -- a yuml file that represents a simplified class model (compatible with yUML)
|
8
|
+
|
9
|
+
[ :yuml ]
|
10
|
+
end
|
11
|
+
|
12
|
+
def resolve_namespaces
|
13
|
+
# any array of arrays
|
14
|
+
# each sub-array:
|
15
|
+
# 0: a string or an array of strings, containing xml namespaces found
|
16
|
+
# in the example xml files an empty string is the default namespace
|
17
|
+
# 1: a ruby Module name (get the character cases right)
|
18
|
+
# 2: a namespace prefix used when writing xml, optional. A generated
|
19
|
+
# prefix will be used otherwise.
|
20
|
+
|
21
|
+
[
|
22
|
+
[ 'com.xampl.intro.example3', 'Example3', 'ex3']
|
23
|
+
]
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
|
2
|
+
diagram = ""
|
3
|
+
File.open("./generated-elements.yuml") do | f |
|
4
|
+
f.each do | line |
|
5
|
+
diagram << line.chomp
|
6
|
+
end
|
7
|
+
end
|
8
|
+
wget = "wget 'http://yuml.me/diagram/scruffy/class/#{diagram}' -O 'generated-elements.png'"
|
9
|
+
#wget = "wget 'http://yuml.me/diagram/scruffy/class/#{diagram}.pdf' -O 'generated-elements.pdf'"
|
10
|
+
`#{wget}`
|
@@ -0,0 +1,51 @@
|
|
1
|
+
class ProjectGenerator
|
2
|
+
|
3
|
+
# def directory
|
4
|
+
# File.join(%w{ . xampl_generated_code })
|
5
|
+
# end
|
6
|
+
#
|
7
|
+
# def filenames
|
8
|
+
# Dir.glob("./xml/**/*.xml")
|
9
|
+
# end
|
10
|
+
#
|
11
|
+
# def print_base_filename
|
12
|
+
# File.join(%w{ . generated })
|
13
|
+
# end
|
14
|
+
#
|
15
|
+
# def print_options
|
16
|
+
# # return an array containing any (or none) of:
|
17
|
+
# # :schema -- a schema-like xml representation of the generated code
|
18
|
+
# # :graphml -- a graphml file describing the class model (compatible with yEd)
|
19
|
+
# # :yuml -- a yuml file that represents a simplified class model (compatible with yUML)
|
20
|
+
#
|
21
|
+
# # [:schema, :graphml, :yuml]
|
22
|
+
# []
|
23
|
+
# end
|
24
|
+
#
|
25
|
+
# def persisted_attributes
|
26
|
+
# %w{ pid }
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# def indexed_attributes
|
30
|
+
# %w{ id }
|
31
|
+
# end
|
32
|
+
|
33
|
+
def resolve_namespaces
|
34
|
+
# any array of arrays
|
35
|
+
# each sub-array:
|
36
|
+
# 0: a string or an array of strings, containing xml namespaces found in the example xml files
|
37
|
+
# an empty string is the default namespace
|
38
|
+
# 1: a ruby Module name (get the character cases right)
|
39
|
+
# 2: a namespace prefix used when writing xml, optional. A generated prefix will be used otherwise.
|
40
|
+
|
41
|
+
#[]
|
42
|
+
|
43
|
+
[
|
44
|
+
[ '', 'Example1']
|
45
|
+
]
|
46
|
+
|
47
|
+
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
|