== v1.0 (建設中) == v0.9.10 (26-12-2010) === Major changes: * New pull parser implementation: better performance under all tested platforms (especially under JRuby). You don't have to use the Tag class anymore, if you don't need to. The old implementation is not available anymore. Note that this is still slower than if it was fully implemented in C, of course. * New: SDL4R#dump(), SDL4R#load(), serialization/deserialization using Serializer (beta feature). top = SDL4R::load(<<-EOS) food name="chili con carne" { ingredient "beans" ingredient "chili" ingredient "cheese" score 8.9 } EOS puts top.food.name # >> "chili con carne" puts top.food.ingredient # >> ["beans", "chili", "cheese"] puts top.food.score # >> 8.9 * Unicode characters are now allowed in SDL identifiers as per the specification (supported where Unicode character classes are supported e.g. Ruby 1.9.2 or JRuby). * The methods SDL4R/Parser.new_date_time() have been removed and refactored into Reader.new_time(year, month, day, hour, min, sec, msec, timezone_code) SDL4R.new_time(year, month, day, hour, min, sec, msec, timezone_code) The objective was to allow the two following features. * Support of Time: if you want SDL4R to generate Time instances instead of DateTimes. SDL4R.use_datetime = false * Support of the TZInfo gem (http://tzinfo.rubyforge.org/) if you want a more complete support of timezones, DST, etc. For the time being, the code relies on implementation features of TZInfo and therefore, there is some risk using it as to future versions of that component. To use SDL4R with TZInfo enabled: require 'sdl4r_tzinfo' or (for more complex use cases) require 'sdl4r' require 'sdl4r/sdl4r_tzinfo' SDL4R::enable_tzinfo ... SDL4R::disable_tzinfo === Minor changes: * New: SDL4R#valid_identifier?() * Methods of class Tag now takes Symbols as well as Strings for namespaces, tag names and attribute names. You can now write: tag.child(:my_child) tag.attribute(:my_namespace, :my_attribute) * Fixed the formatting of date times so that the zone offset appears after a "-GMT" mention, which was missing before. Fixed the formatting of Time instances. * Fixed Tag#to_xml_string == v0.9.9 (19-11-2010) === Major changes: * SDL4R#to_attribute_map renamed to SDL4R#to_attribute_hash (as the doc stated previously). * Symbols are now converted to Strings when used as SDL values. It is therefore possible to write: tag.set_attribute("type", :square) #tag.attribute("type") => "square" === Minor changes: * New methods: Tag#has_attributes? and Tag#has_values? == v0.9.8 (16-sep-2010) === Major changes: * Bug fix: dollar ($) is now supported as a valid identifier character. === Minor changes: * New constants: SDL4R#ANONYMOUS_TAG_NAME and SDL4R#ROOT_TAG_NAME. * Bug fixes related to the error handling in the parser. == v0.9.7 (26-aug-2010) === Major changes: * It could prove a hassle to use the block idiom of Tag.new or Tag.new_child when handling another set of data. Therefore, if the given block takes a (not-optional) parameter, the context remains the context of the calling code. class Elephant def initialize @weight = 1000 end def to_sdl SDL4R::Tag.new("elephant") do |tag| tag.set_attribute("weight", @weight) tag << "I love pink ones." end end end puts Elephant.new.to_sdl.to_s # ==> elephant "I love pink ones." weight=1000 * Tag.to_xml_string() has been refactor to take an option Hash (backward incompatible): [:line_prefix] a text prefixing each line (default: "") [:uri_by_namespace] a Hash giving the URIs for the namespaces [:indent] text specifying one indentation (default: "\t") [:eol] end of line expression (default: "\n") [:omit_null_attributes] if true, null/nil attributes are not exported (default: false). Otherwise, they are exported as follows: tag attr="null" * Fixed the parsing of line continuations with anti-slashes. * Fixed the parsing of double-quoted strings. It is better at detecting badly formed strings, now. * Fixed the reporting of lines and columns in errors. Although the column might be slightly off sometimes, the line should be correct. === Minor changes: * The RDoc is now generated with the template Hanna[http://github.com/mislav/hanna/tree/master]. * Tag.<< now behaves with Enumerables (except Strings) as it does with Arrays. == v0.9.6 (10-aug-2010) === Major changes: * Tag.set_attribute(): fixed as it failed if the value was nil. * Tag.write(): now returns the given output (especially necessary if a String was given). * Tag.write(): fixed as it failed when writing children without including the root Tag. * Tag.write(): it is now possible to give a StringIO as an output == v0.9.5 (8-aug-2010) === Major changes: * Fixes in order to make SDL4R work in Ruby 1.9 (mainly concerning encodings and dates). * Commented out debug code (writing to files) inside sdl4r_test.rb. === Minor changes: * General & contact info in the README == v0.9.4 (6-aug-2010) === Major changes: * The use of BigDecimal (standard) has been preferred to Flt::DecNum. * "sdl4r/sdl.rb" has been renamed to "sdl4r/sdl4r.rb" * A sdl4r.rb has been added so that users can actually write (as the documentation pretended): require 'sdl4r' * SDL4R#coerce_or_fail has been implemented, which means that random objects cannot be added to a Tag as before. Rational instances are coerced using Rational#to_f. * Added usual time methods to SdlTimeSpan: day(), hour(), min(), sec(), usec() == v0.9.3 === Major changes * Tag: any method that use to take namespace/name parameters now follows the natural order "namespace" and then "name": Tag.new "ns1", "tag1" WARNING: this was the contrary before!!! Also, the "recursive" parameter should always be at the first place now. * It is now possible to override SDL4R::new_date_time in order to create Time instances when parsing rather than DateTime instances.