sxrb 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/sxrb/node.rb +4 -0
  2. data/lib/sxrb/parser.rb +4 -0
  3. metadata +19 -38
@@ -10,5 +10,9 @@ module SXRB
10
10
  node.parent = self
11
11
  @children << node
12
12
  end
13
+
14
+ def content
15
+ children.map {|child| child.is_a?(TextNode)? child.text : child.content}.flatten.join('')
16
+ end
13
17
  end
14
18
  end
@@ -12,6 +12,10 @@ module SXRB
12
12
  parser = case options[:mode]
13
13
  when :string
14
14
  LibXML::XML::SaxParser.string(input)
15
+ when :file
16
+ LibXML::XML::SaxParser.string(input)
17
+ when :io
18
+ LibXML::XML::SaxParser.string(input)
15
19
  end
16
20
 
17
21
  callbacks = Callbacks.new.tap do |cb|
metadata CHANGED
@@ -1,32 +1,22 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: sxrb
3
- version: !ruby/object:Gem::Version
4
- hash: 27
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 1
9
- - 0
10
- version: 0.1.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Bartek Borkowski
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2012-08-05 00:00:00 Z
12
+ date: 2012-08-06 00:00:00.000000000 Z
19
13
  dependencies: []
20
-
21
14
  description: Robust XML parser that allows defining desired behavior with fancy DSL
22
15
  email:
23
16
  executables: []
24
-
25
17
  extensions: []
26
-
27
18
  extra_rdoc_files: []
28
-
29
- files:
19
+ files:
30
20
  - lib/sxrb/text_node.rb
31
21
  - lib/sxrb/callbacks.rb
32
22
  - lib/sxrb/node.rb
@@ -36,36 +26,27 @@ files:
36
26
  - lib/sxrb.rb
37
27
  homepage: http://rubygems.org/gems/sxrb
38
28
  licenses: []
39
-
40
29
  post_install_message:
41
30
  rdoc_options: []
42
-
43
- require_paths:
31
+ require_paths:
44
32
  - lib
45
- required_ruby_version: !ruby/object:Gem::Requirement
33
+ required_ruby_version: !ruby/object:Gem::Requirement
46
34
  none: false
47
- requirements:
48
- - - ">="
49
- - !ruby/object:Gem::Version
50
- hash: 3
51
- segments:
52
- - 0
53
- version: "0"
54
- required_rubygems_version: !ruby/object:Gem::Requirement
35
+ requirements:
36
+ - - ! '>='
37
+ - !ruby/object:Gem::Version
38
+ version: '0'
39
+ required_rubygems_version: !ruby/object:Gem::Requirement
55
40
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- hash: 3
60
- segments:
61
- - 0
62
- version: "0"
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
63
45
  requirements: []
64
-
65
46
  rubyforge_project:
66
- rubygems_version: 1.8.24
47
+ rubygems_version: 1.8.21
67
48
  signing_key:
68
49
  specification_version: 3
69
50
  summary: Smart XML parser
70
51
  test_files: []
71
-
52
+ has_rdoc: