Changeset 10863
- Timestamp:
- 05/01/08 11:24:22 (5 years ago)
- Location:
- lang/ruby/atomutil/trunk
- Files:
-
- 3 modified
-
History.txt (modified) (1 diff)
-
lib/atomutil.rb (modified) (3 diffs)
-
spec/person_spec.rb (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/ruby/atomutil/trunk/History.txt
r10786 r10863 1 == 0.0.6 2008-05-01 2 3 Removed dependency on REXML::Formatters::Pretty, 4 because REXML::Formatters::Pretty inserts linebreaks into each tags... 5 But this isn't best solution. 6 1 7 == 0.0.5 2008-04-30 2 8 3 9 * bugfix: Atom::Content didn't work as expected with multibyte UTF-8 string. 4 Atom::Element::to_s didn't work well on ruby 1.8.6 or above. 10 Atom::Element::to_s didn't work well on ruby 1.8.6 or above, because 11 REXML::Document::to_s is deprecated and has a bug on 1.8.6 or 1.9 patched release. 5 12 require 'sha1' -> require 'digest/sha1' 6 13 -
lang/ruby/atomutil/trunk/lib/atomutil.rb
r10862 r10863 42 42 require 'rexml/document' 43 43 44 ATOM_CAN_PRETTY_INDENT = true45 begin46 require 'rexml/formatters/pretty'47 rescue LoadError48 ATOM_CAN_PRETTY_INDENT = false49 end50 51 44 # = Utilities for AtomPub / Atom Syndication Format 52 45 # … … 63 56 MAJOR = 0 64 57 MINOR = 0 65 TINY = 558 TINY = 6 66 59 STRING = [MAJOR, MINOR, TINY].join('.') 67 60 end … … 602 595 doc.add_element @elem.deep_clone 603 596 if indent 604 if ATOM_CAN_PRETTY_INDENT 605 result = "" 606 REXML::Formatters::Pretty.new(0, false).write(doc, result) 607 result 608 else 609 if RUBY_VERSION >= "1.8.6" 610 warn "REXML::Document::to_s( param ) is deprecated and has a bug under 1.8.6 or above." 611 end 612 doc.to_s(0) 613 end 597 doc.to_s(0) 614 598 else 615 599 doc.to_s -
lang/ruby/atomutil/trunk/spec/person_spec.rb
r7073 r10863 28 28 person_xml = @person.to_s 29 29 person_xml.should =~ /<author(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?>/ 30 person_xml.should =~ /<name(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?> \s*?Lyo Kato\s*?<\/name>/31 person_xml.should =~ /<email(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?> \s*?lyo\.kato\@gmail\.com\s*?<\/email>/30 person_xml.should =~ /<name(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?>Lyo Kato<\/name>/ 31 person_xml.should =~ /<email(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?>lyo\.kato\@gmail\.com<\/email>/ 32 32 end 33 33 … … 41 41 author_xml = author.to_s 42 42 author_xml.should =~ /<author(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?>/ 43 author_xml.should =~ /<name(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?> \s*?Lyo Kato\s*?<\/name>/44 author_xml.should =~ /<email(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?> \s*?lyo\.kato\@gmail\.com\s*?<\/email>/43 author_xml.should =~ /<name(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?>Lyo Kato<\/name>/ 44 author_xml.should =~ /<email(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?>lyo\.kato\@gmail\.com<\/email>/ 45 45 end 46 46 … … 54 54 contributor_xml = contributor.to_s 55 55 contributor_xml.should =~ /<contributor(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')>/ 56 contributor_xml.should =~ /<name(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?> \s*?Lyo Kato\s*?<\/name>/57 contributor_xml.should =~ /<email(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?> \s*?lyo\.kato\@gmail\.com\s*?<\/email>/56 contributor_xml.should =~ /<name(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?>Lyo Kato<\/name>/ 57 contributor_xml.should =~ /<email(?: xmlns='http:\/\/www\.w3\.org\/2005\/Atom')?>lyo\.kato\@gmail\.com<\/email>/ 58 58 end 59 59
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)