kind_dom 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,13 +1,26 @@
1
- KindDom: gracefully use XML content with node-type neutrality, content closure & default values.
1
+ # KindDom
2
+
3
+ Gracefully use XML content with node-type neutrality, content closure & default values.
2
4
 
3
5
  See the source code comments, rdoc or ri for usage details; the tests also demonstrate use cases.
4
6
 
5
- Project Home http://code.google.com/p/ruby-kind-dom/
7
+
8
+ ## Gem Dependencies
9
+
10
+ - libxml-ruby (now qualified with 1.1.3), http://libxml.rubyforge.org/
11
+ - active_support, part of Ruby on Rails http://www.rubyonrails.org/
12
+
13
+
14
+ ## Project Home
15
+
16
+ http://code.google.com/p/ruby-kind-dom/
17
+
18
+
6
19
 
7
20
 
8
21
  Licensed under The MIT License.
9
22
 
10
- Copyright (c) 2008 Scout Labs Inc. http://scoutlabs.com
23
+ Copyright (c) 2009 Scout Labs Inc. http://scoutlabs.com
11
24
 
12
25
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ‘Software’), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
13
26
 
@@ -52,8 +52,12 @@ module KindDom
52
52
  when xml_in.kind_of?(XML::Document), xml_in.kind_of?(XML::Node)
53
53
  @dom = xml_in
54
54
  when xml_in.kind_of?(String)
55
- parser = XML::Parser.new
56
- parser.string = xml_in
55
+ if XML::Parser.respond_to?(:string)
56
+ parser = XML::Parser.string(xml_in)
57
+ else # for old libxml-ruby compatibility
58
+ parser = XML::Parser.new
59
+ parser.string = xml_in
60
+ end
57
61
  @dom = parser.parse
58
62
  end
59
63
  end
@@ -112,8 +112,12 @@ class KindDomTest < Test::Unit::TestCase
112
112
  private
113
113
 
114
114
  def parse_xml(data)
115
- parser = XML::Parser.new
116
- parser.string = data
115
+ if XML::Parser.respond_to?(:string)
116
+ parser = XML::Parser.string(data)
117
+ else # for old libxml-ruby compatibility
118
+ parser = XML::Parser.new
119
+ parser.string = data
120
+ end
117
121
  parser.parse
118
122
  end
119
123
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kind_dom
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mars Hall
@@ -9,11 +9,12 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-10-09 00:00:00 -07:00
12
+ date: 2009-06-29 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport
17
+ type: :runtime
17
18
  version_requirement:
18
19
  version_requirements: !ruby/object:Gem::Requirement
19
20
  requirements:
@@ -23,6 +24,7 @@ dependencies:
23
24
  version:
24
25
  - !ruby/object:Gem::Dependency
25
26
  name: libxml-ruby
27
+ type: :runtime
26
28
  version_requirement:
27
29
  version_requirements: !ruby/object:Gem::Requirement
28
30
  requirements:
@@ -67,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
67
69
  requirements: []
68
70
 
69
71
  rubyforge_project: kind-dom
70
- rubygems_version: 1.0.1
72
+ rubygems_version: 1.3.1
71
73
  signing_key:
72
74
  specification_version: 2
73
75
  summary: Gracefully use XML content with node-type neutrality, content closure & default values