lib/onix.rb in onix-0.6.0 vs lib/onix.rb in onix-0.7.0

- old
+ new

@@ -1,30 +1,34 @@ +# coding: utf-8 + require 'rubygems' require 'bigdecimal' require 'cgi' # ensure we load the correct gem versions -gem 'roxml', '2.5.2' +gem 'roxml', '2.5.3' gem 'andand' # and now load the actual gems require 'roxml' require 'andand' module ONIX module Version #:nodoc: Major = 0 - Minor = 6 + Minor = 7 Tiny = 0 String = [Major, Minor, Tiny].join('.') end class Formatters def self.decimal lambda do |val| - if val.kind_of?(BigDecimal) + if val.nil? + nil + elsif val.kind_of?(BigDecimal) val.to_s("F") else val.to_s end end @@ -55,10 +59,14 @@ end end end # silence some warnings from ROXML -ROXML::SILENCE_XML_NAME_WARNING = true +unless ROXML.const_defined?("SILENCE_XML_NAME_WARNING") + ROXML::SILENCE_XML_NAME_WARNING = true +end + +require File.join(File.dirname(__FILE__), "onix", "common") # core files # - ordering is important, classes need to be defined before any # other class can use them require File.join(File.dirname(__FILE__), "onix", "sender_identifier")