ruby-xquery 0.0.1.160 → 0.0.2.177
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/README +2 -2
- data/lib/xml/xquery.rb +4 -4
- data/lib/xml/xquery/enhanced_find.rb +16 -1
- data/lib/xml/xquery/node.rb +4 -21
- data/lib/xml/xquery/node_set.rb +26 -38
- data/lib/xml/xquery/version.rb +1 -1
- data/lib/xml/xquery/{document.rb → xpath_object.rb} +4 -17
- metadata +8 -8
data/README
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
== VERSION
|
4
4
|
|
5
|
-
This documentation refers to ruby-xquery version 0.0.
|
5
|
+
This documentation refers to ruby-xquery version 0.0.2
|
6
6
|
|
7
7
|
|
8
8
|
== DESCRIPTION
|
@@ -17,7 +17,7 @@ TODO: well, the description... ;-)
|
|
17
17
|
|
18
18
|
== LICENSE AND COPYRIGHT
|
19
19
|
|
20
|
-
Copyright (C) 2007 Jens Wille
|
20
|
+
Copyright (C) 2007-2008 Jens Wille
|
21
21
|
|
22
22
|
ruby-xquery is free software: you can redistribute it and/or modify it under
|
23
23
|
the terms of the GNU General Public License as published by the Free Software
|
data/lib/xml/xquery.rb
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
# ruby-xquery -- Libxml's XPath support + plain ol' Ruby = XQuery (kind of... #
|
5
5
|
# ;-) #
|
6
6
|
# #
|
7
|
-
# Copyright (C) 2007 Jens Wille
|
7
|
+
# Copyright (C) 2007-2008 Jens Wille #
|
8
8
|
# #
|
9
9
|
# Authors: #
|
10
10
|
# Jens Wille <jens.wille@uni-koeln.de> #
|
@@ -32,6 +32,6 @@ require 'xml/libxml'
|
|
32
32
|
module XML::XQuery
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
require
|
37
|
-
|
35
|
+
Dir[File.join(File.dirname(__FILE__), 'xquery', '**', '*.rb')].each { |rb|
|
36
|
+
require rb
|
37
|
+
}
|
@@ -3,7 +3,7 @@
|
|
3
3
|
# #
|
4
4
|
# A component of ruby-xquery, mimicking XQuery in Ruby. #
|
5
5
|
# #
|
6
|
-
# Copyright (C) 2007 Jens Wille
|
6
|
+
# Copyright (C) 2007-2008 Jens Wille #
|
7
7
|
# #
|
8
8
|
# Authors: #
|
9
9
|
# Jens Wille <jens.wille@uni-koeln.de> #
|
@@ -37,6 +37,21 @@ module XML::XQuery
|
|
37
37
|
enhanced_find(xpath.to_s)
|
38
38
|
end
|
39
39
|
|
40
|
+
def self.included(base)
|
41
|
+
# overwrite original methods
|
42
|
+
instance_methods.each { |method|
|
43
|
+
base.send(:define_method, method, instance_method(method))
|
44
|
+
}
|
45
|
+
end
|
46
|
+
|
40
47
|
end
|
41
48
|
|
42
49
|
end
|
50
|
+
|
51
|
+
class XML::Document
|
52
|
+
include XML::XQuery::EnhancedFind
|
53
|
+
end
|
54
|
+
|
55
|
+
class XML::Node
|
56
|
+
include XML::XQuery::EnhancedFind
|
57
|
+
end
|
data/lib/xml/xquery/node.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# #
|
4
4
|
# A component of ruby-xquery, mimicking XQuery in Ruby. #
|
5
5
|
# #
|
6
|
-
# Copyright (C) 2007 Jens Wille
|
6
|
+
# Copyright (C) 2007-2008 Jens Wille #
|
7
7
|
# #
|
8
8
|
# Authors: #
|
9
9
|
# Jens Wille <jens.wille@uni-koeln.de> #
|
@@ -24,27 +24,10 @@
|
|
24
24
|
###############################################################################
|
25
25
|
#++
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
module XML::XQuery
|
30
|
-
|
31
|
-
module Node
|
32
|
-
|
33
|
-
include XML::XQuery::EnhancedFind
|
34
|
-
|
35
|
-
def to_s
|
36
|
-
content
|
37
|
-
end
|
38
|
-
|
39
|
-
def self.included(base)
|
40
|
-
# overwrite original "property reader"
|
41
|
-
base.send(:define_method, :[], instance_method(:[]))
|
42
|
-
end
|
27
|
+
class XML::Node
|
43
28
|
|
29
|
+
def to_s
|
30
|
+
content
|
44
31
|
end
|
45
32
|
|
46
33
|
end
|
47
|
-
|
48
|
-
class XML::Node
|
49
|
-
include XML::XQuery::Node
|
50
|
-
end
|
data/lib/xml/xquery/node_set.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# #
|
4
4
|
# A component of ruby-xquery, mimicking XQuery in Ruby. #
|
5
5
|
# #
|
6
|
-
# Copyright (C) 2007 Jens Wille
|
6
|
+
# Copyright (C) 2007-2008 Jens Wille #
|
7
7
|
# #
|
8
8
|
# Authors: #
|
9
9
|
# Jens Wille <jens.wille@uni-koeln.de> #
|
@@ -24,55 +24,43 @@
|
|
24
24
|
###############################################################################
|
25
25
|
#++
|
26
26
|
|
27
|
-
|
27
|
+
require 'forwardable'
|
28
28
|
|
29
|
-
|
29
|
+
class XML::Node::Set
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
31
|
+
# Object#dup gives a segmentation fault on #to_a (via Enumerable)!!
|
32
|
+
def dup
|
33
|
+
xpath.set
|
34
|
+
end
|
35
35
|
|
36
|
-
|
37
|
-
|
38
|
-
|
36
|
+
def uniq
|
37
|
+
dup.uniq!
|
38
|
+
end
|
39
39
|
|
40
|
-
|
41
|
-
|
42
|
-
|
40
|
+
def uniq!
|
41
|
+
# return unique when asked for array
|
42
|
+
@to_a = to_a.uniq
|
43
43
|
|
44
|
-
|
45
|
-
@to_a
|
46
|
-
end
|
44
|
+
class << self
|
47
45
|
|
48
|
-
|
49
|
-
def self.each(&block)
|
50
|
-
@to_a.each(&block)
|
51
|
-
end
|
52
|
-
def self.length
|
53
|
-
@to_a.length
|
54
|
-
end
|
55
|
-
def self.size
|
56
|
-
@to_a.size
|
57
|
-
end
|
46
|
+
extend Forwardable
|
58
47
|
|
59
|
-
|
60
|
-
end
|
48
|
+
attr_reader :to_a
|
61
49
|
|
62
|
-
|
63
|
-
|
64
|
-
i.content
|
65
|
-
}
|
66
|
-
end
|
50
|
+
# forward to unique array
|
51
|
+
def_delegators :@to_a, :each, :length, :size
|
67
52
|
|
68
|
-
def to_s
|
69
|
-
contents.join(' | ')
|
70
53
|
end
|
71
54
|
|
55
|
+
self
|
72
56
|
end
|
73
57
|
|
74
|
-
|
58
|
+
def contents
|
59
|
+
map { |i| i.content }
|
60
|
+
end
|
61
|
+
|
62
|
+
def to_s
|
63
|
+
contents.join(' | ')
|
64
|
+
end
|
75
65
|
|
76
|
-
class XML::Node::Set
|
77
|
-
include XML::XQuery::NodeSet
|
78
66
|
end
|
data/lib/xml/xquery/version.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# #
|
4
4
|
# A component of ruby-xquery, mimicking XQuery in Ruby. #
|
5
5
|
# #
|
6
|
-
# Copyright (C) 2007 Jens Wille
|
6
|
+
# Copyright (C) 2007-2008 Jens Wille #
|
7
7
|
# #
|
8
8
|
# Authors: #
|
9
9
|
# Jens Wille <jens.wille@uni-koeln.de> #
|
@@ -24,23 +24,10 @@
|
|
24
24
|
###############################################################################
|
25
25
|
#++
|
26
26
|
|
27
|
-
|
28
|
-
|
29
|
-
module XML::XQuery
|
30
|
-
|
31
|
-
module Document
|
32
|
-
|
33
|
-
include XML::XQuery::EnhancedFind
|
34
|
-
|
35
|
-
def self.included(base)
|
36
|
-
# overwrite original "property reader"
|
37
|
-
base.send(:define_method, :[], instance_method(:[]))
|
38
|
-
end
|
27
|
+
class XML::XPath::Object
|
39
28
|
|
29
|
+
def to_s
|
30
|
+
set.to_s
|
40
31
|
end
|
41
32
|
|
42
33
|
end
|
43
|
-
|
44
|
-
class XML::Document
|
45
|
-
include XML::XQuery::Document
|
46
|
-
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruby-xquery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2.177
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jens Wille
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-01-
|
12
|
+
date: 2008-01-17 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -25,8 +25,8 @@ extra_rdoc_files:
|
|
25
25
|
- ChangeLog
|
26
26
|
files:
|
27
27
|
- lib/xml/xquery/node_set.rb
|
28
|
+
- lib/xml/xquery/xpath_object.rb
|
28
29
|
- lib/xml/xquery/version.rb
|
29
|
-
- lib/xml/xquery/document.rb
|
30
30
|
- lib/xml/xquery/enhanced_find.rb
|
31
31
|
- lib/xml/xquery/node.rb
|
32
32
|
- lib/xml/xquery.rb
|
@@ -40,15 +40,15 @@ has_rdoc: true
|
|
40
40
|
homepage: http://prometheus.rubyforge.org/ruby-xquery
|
41
41
|
post_install_message:
|
42
42
|
rdoc_options:
|
43
|
-
- --line-numbers
|
44
|
-
- --all
|
45
|
-
- --inline-source
|
46
43
|
- --charset
|
47
44
|
- UTF-8
|
48
|
-
- --
|
49
|
-
- README
|
45
|
+
- --all
|
50
46
|
- --title
|
51
47
|
- ruby-xquery Application documentation
|
48
|
+
- --main
|
49
|
+
- README
|
50
|
+
- --line-numbers
|
51
|
+
- --inline-source
|
52
52
|
require_paths:
|
53
53
|
- lib
|
54
54
|
required_ruby_version: !ruby/object:Gem::Requirement
|