Permalink
Browse files

various small fixes

  - added gem deps, dev deps, and executables
  - renamed executables (dropped .rb extension)
  - bit more documentation
  - moved String::to_a to String::to_xa to prevent clashes
  - bumped version to 0.4
  • Loading branch information...
1 parent 40ce50a commit d8afbecca467173b7b4afe0d4a81925d37e18c99 @movitto movitto committed Sep 5, 2010
Showing with 18 additions and 11 deletions.
  1. +7 −3 Rakefile
  2. +4 −2 TODO
  3. +2 −2 bin/{rxsd-test.rb → rxsd_test}
  4. +3 −3 bin/{gen_ruby_definitions.rb → xsd_to_ruby}
  5. +1 −1 lib/rxsd/builtin_types.rb
  6. +1 −0 lib/rxsd/resolver.rb
View
10 Rakefile
@@ -9,7 +9,7 @@ require 'rake/gempackagetask'
GEM_NAME="rxsd"
-PKG_VERSION='0.3'
+PKG_VERSION='0.4'
desc "Run all specs"
Spec::Rake::SpecTask.new('spec') do |t|
@@ -22,19 +22,23 @@ Rake::RDocTask.new do |rd|
rd.rdoc_files.include("README.rdoc", "lib/**/*.rb")
end
-PKG_FILES = FileList['bin/**/*', 'lib/**/*.rb', 'COPYING', 'LICENSE', 'Rakefile', 'README.rdoc', 'spec/**/*.rb' ]
+PKG_FILES = FileList['lib/**/*.rb', 'COPYING', 'LICENSE', 'Rakefile', 'README.rdoc', 'spec/**/*.rb' ]
SPEC = Gem::Specification.new do |s|
s.name = GEM_NAME
s.version = PKG_VERSION
s.files = PKG_FILES
+ s.executables << 'xsd_to_ruby' << 'rxsd_test'
s.required_ruby_version = '>= 1.8.1'
s.required_rubygems_version = Gem::Requirement.new(">= 1.3.3")
+ s.add_dependency('libxml-ruby', '~> 1.1.4')
+ s.add_development_dependency('rspec', '~> 1.3.0')
+
s.author = "Mohammed Morsi"
s.email = "movitto@yahoo.com"
- s.date = %q{2010-03-18}
+ s.date = %q{2010-09-04}
s.description = %q{A library to translate xsd schemas and xml implementations into ruby classes/objects}
s.summary = %q{A library to translate xsd schemas and xml implementations into ruby classes/objects}
s.homepage = %q{http://morsi.org/projects/RXSD}
View
6 TODO
@@ -1,10 +1,12 @@
Task list
- * more tests, bugfixes, enhancements
* Support for missing XSD constructs (complete w/ tests):
- all / annotation / any / anyAttribute / appInfo / documentation / field /
import / include / key / keyref / notation / redefine / selector / union / unique
+ - add restrictions semantics
- add remote uri support to Loader, use in conjunction w/ import/include
- * Additional builtin / native type support
+ * Complete builtin / native type support
+ * integration testing, test rxsd against many various actual xsd specs / xml impls
+ * more exceptions, logging, tests, bugfixes, enhancements
* Additional builder support
* Support for ruby class/obj -> xsd/xml
View
4 bin/rxsd-test.rb → bin/rxsd_test
@@ -1,7 +1,7 @@
#!/usr/bin/ruby
# Simple rxsd test utility
#
-# Usage rxsd-test.rb uri-to-schema uri-to-xml-instance
+# Usage rxsd_test uri-to-schema uri-to-xml-instance
#
# Copyright (C) 2010 Mohammed Morsi <movitto@yahoo.com>
# See COPYING for the License of this software
@@ -10,7 +10,7 @@
if ARGV.size < 2
puts "missing required arguments"
- puts "usage: rxsd-test xsd_uri xml_uri"
+ puts "usage: rxsd_test xsd_uri xml_uri"
exit
end
View
6 bin/gen_ruby_definitions.rb → bin/xsd_to_ruby
@@ -1,7 +1,7 @@
#!/usr/bin/ruby
-# Simple rxsd test utility
+# XSD to Ruby class converted
#
-# Usage rxsd-test.rb uri-to-schema uri-to-xml-instance
+# Usage xsd_to_ruby xsd_uri output_dir
#
# Copyright (C) 2010 Mohammed Morsi <movitto@yahoo.com>
# See COPYING for the License of this software
@@ -11,7 +11,7 @@
if ARGV.size < 2
puts "missing required arguments"
- puts "usage: gen_ruby_definitions xsd_uri output_dir"
+ puts "usage: xsd_to_ruby xsd_uri output_dir"
exit
end
View
2 lib/rxsd/builtin_types.rb
@@ -41,7 +41,7 @@ def self.from_s(str)
end
# Helper to convert string to array of specified type.
- def to_a(args = {})
+ def to_xa(args = {})
arr = []
item_type = args[:type]
delim = args.has_key?(:delim) ? args[:delim] : ' '
View
1 lib/rxsd/resolver.rb
@@ -16,6 +16,7 @@ def self.node_objects(node_obj, args = {})
if args.has_key? :node_objs
node_objs = args[:node_objs]
else
+ # TODO auto generate keys from classes defined under the XSD module
node_objs = {XSD::Attribute => [], XSD::AttributeGroup => [], XSD::Choice => [],
XSD::ComplexContent => [], XSD::ComplexType => [], XSD::Element => [],
XSD::Extension => [], XSD::Group => [], XSD::List => [], XSD::Restriction => [],

0 comments on commit d8afbec

Please sign in to comment.