sax_stream 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -18,7 +18,7 @@ Even slightly invalid XML is likely to cause an immediate exception.
18
18
 
19
19
  ## Installation
20
20
 
21
- Not yet packed as a gem, install it from github.
21
+ gem install 'sax_stream'
22
22
 
23
23
  ## Usage
24
24
 
@@ -11,13 +11,20 @@ module SaxStream
11
11
  if value && @parser
12
12
  value = @parser.parse(value)
13
13
  end
14
- object[@name] = value
14
+ if object.respond_to?(setter_method)
15
+ object.send(setter_method, value)
16
+ else
17
+ object[@name] = value
18
+ end
15
19
  end
16
20
 
17
21
  def handler_for(name, collector, handler_stack, parent_object)
18
22
  end
19
23
 
20
24
  private
25
+ def setter_method
26
+ "#{@name}=".to_sym
27
+ end
21
28
 
22
29
  def process_conversion_type(as)
23
30
  if as
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sax_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-04-07 00:00:00.000000000 Z
12
+ date: 2012-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
16
- requirement: &70166827474840 !ruby/object:Gem::Requirement
16
+ requirement: &70267973114600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,8 +21,9 @@ dependencies:
21
21
  version: 1.4.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70166827474840
25
- description:
24
+ version_requirements: *70267973114600
25
+ description: A streaming XML parser which builds objects and passes them to a collecter
26
+ as they are ready. Based upon Nokogiri SAX parsing functionality.
26
27
  email:
27
28
  - craig@craigambrose.com
28
29
  executables: []