ruby-xquery 0.0.1.109 → 0.0.1.160
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/Rakefile +16 -15
- metadata +51 -39
- data/specs/spec_helper.rb +0 -9
- data/specs/xml_node_set_spec.rb +0 -23
- data/specs/xquery_spec.rb +0 -47
data/Rakefile
CHANGED
@@ -1,19 +1,20 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require 'hen'
|
3
|
+
rescue LoadError
|
4
|
+
abort "Please install the 'hen' gem first."
|
5
|
+
end
|
2
6
|
|
3
|
-
|
4
|
-
RDOCS = %w[README COPYING ChangeLog]
|
5
|
-
OTHER = FileList['[A-Z]*', 'specs/*.rb', 'test_data/*'].to_a
|
7
|
+
require 'lib/xml/xquery/version'
|
6
8
|
|
7
|
-
|
8
|
-
:
|
9
|
-
|
10
|
-
}
|
9
|
+
Hen.lay! {{
|
10
|
+
:rubyforge => {
|
11
|
+
:package => 'ruby-xquery'
|
12
|
+
},
|
11
13
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
:extra_rdoc_files => RDOCS
|
14
|
+
:gem => {
|
15
|
+
:version => XML::XQuery::VERSION,
|
16
|
+
:summary => "Libxml's XPath support + plain ol' Ruby = XQuery (kind of... ;-)",
|
17
|
+
:files => FileList['lib/**/*.rb'].to_a,
|
18
|
+
:extra_files => FileList['[A-Z]*', 'specs/*.rb', 'test_data/*'].to_a
|
19
|
+
}
|
19
20
|
}}
|
metadata
CHANGED
@@ -1,33 +1,28 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.9.4
|
3
|
-
specification_version: 1
|
4
2
|
name: ruby-xquery
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0.1.
|
7
|
-
date: 2007-11-12 00:00:00 +01:00
|
8
|
-
summary: Libxml's XPath support + plain ol' Ruby = XQuery (kind of... ;-)
|
9
|
-
require_paths:
|
10
|
-
- lib
|
11
|
-
email: jens.wille@uni-koeln.de
|
12
|
-
homepage:
|
13
|
-
rubyforge_project:
|
14
|
-
description:
|
15
|
-
autorequire:
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: true
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
- - ">"
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: 0.0.0
|
24
|
-
version:
|
4
|
+
version: 0.0.1.160
|
25
5
|
platform: ruby
|
26
|
-
signing_key:
|
27
|
-
cert_chain:
|
28
|
-
post_install_message:
|
29
6
|
authors:
|
30
7
|
- Jens Wille
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-01-08 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Libxml's XPath support + plain ol' Ruby = XQuery (kind of... ;-)
|
17
|
+
email: jens.wille@uni-koeln.de
|
18
|
+
executables: []
|
19
|
+
|
20
|
+
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files:
|
23
|
+
- README
|
24
|
+
- COPYING
|
25
|
+
- ChangeLog
|
31
26
|
files:
|
32
27
|
- lib/xml/xquery/node_set.rb
|
33
28
|
- lib/xml/xquery/version.rb
|
@@ -39,24 +34,41 @@ files:
|
|
39
34
|
- README
|
40
35
|
- ChangeLog
|
41
36
|
- Rakefile
|
42
|
-
- specs/xquery_spec.rb
|
43
|
-
- specs/spec_helper.rb
|
44
|
-
- specs/xml_node_set_spec.rb
|
45
37
|
- test_data/play.dtd
|
46
38
|
- test_data/hamlet.xml
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
39
|
+
has_rdoc: true
|
40
|
+
homepage: http://prometheus.rubyforge.org/ruby-xquery
|
41
|
+
post_install_message:
|
42
|
+
rdoc_options:
|
43
|
+
- --line-numbers
|
44
|
+
- --all
|
45
|
+
- --inline-source
|
46
|
+
- --charset
|
47
|
+
- UTF-8
|
48
|
+
- --main
|
52
49
|
- README
|
53
|
-
-
|
54
|
-
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
50
|
+
- --title
|
51
|
+
- ruby-xquery Application documentation
|
52
|
+
require_paths:
|
53
|
+
- lib
|
54
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ">="
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: "0"
|
59
|
+
version:
|
60
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
+
requirements:
|
62
|
+
- - ">="
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: "0"
|
65
|
+
version:
|
59
66
|
requirements: []
|
60
67
|
|
61
|
-
|
68
|
+
rubyforge_project: prometheus
|
69
|
+
rubygems_version: 1.0.1
|
70
|
+
signing_key:
|
71
|
+
specification_version: 2
|
72
|
+
summary: Libxml's XPath support + plain ol' Ruby = XQuery (kind of... ;-)
|
73
|
+
test_files: []
|
62
74
|
|
data/specs/spec_helper.rb
DELETED
data/specs/xml_node_set_spec.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
-
|
3
|
-
describe XML::Node::Set, ' when extended by XML::XQuery' do
|
4
|
-
|
5
|
-
before :all do
|
6
|
-
@set = DOC['//ACT']
|
7
|
-
@set.should be_an_instance_of(XML::Node::Set)
|
8
|
-
end
|
9
|
-
|
10
|
-
it 'should be dup-able' do
|
11
|
-
dup = @set.dup
|
12
|
-
|
13
|
-
# not identical...
|
14
|
-
dup.should_not == @set
|
15
|
-
|
16
|
-
lambda {
|
17
|
-
# ...but equal
|
18
|
-
dup.to_a.should == @set.to_a
|
19
|
-
}.should_not raise_error
|
20
|
-
# (without segfaulting or anything)
|
21
|
-
end
|
22
|
-
|
23
|
-
end
|
data/specs/xquery_spec.rb
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
-
|
3
|
-
describe XML::XQuery do
|
4
|
-
|
5
|
-
it 'should find all acts' do
|
6
|
-
DOC['//ACT'].size.should == 5
|
7
|
-
end
|
8
|
-
|
9
|
-
it 'should find all acts with Hpricot-style syntax' do
|
10
|
-
(DOC/'//ACT').size.should == 5
|
11
|
-
end
|
12
|
-
|
13
|
-
it 'should find all speakers per act' do
|
14
|
-
DOC['//ACT'].map { |act|
|
15
|
-
act['descendant::node()/SPEAKER'].size
|
16
|
-
}.should == [259, 202, 252, 180, 257]
|
17
|
-
end
|
18
|
-
|
19
|
-
it 'should find all unique speakers per act' do
|
20
|
-
DOC['//ACT'].map { |act|
|
21
|
-
act['descendant::node()/SPEAKER'].uniq.size
|
22
|
-
}.should == [14, 10, 15, 15, 13]
|
23
|
-
end
|
24
|
-
|
25
|
-
it 'should find descendant::node() with abbreviated syntax' do
|
26
|
-
act = DOC['//ACT'].first
|
27
|
-
|
28
|
-
act['**/SPEAKER'].to_a.should == act['descendant::node()/SPEAKER'].to_a
|
29
|
-
end
|
30
|
-
|
31
|
-
it 'should not have any side-effects when using non-bang uniq' do
|
32
|
-
speakers = DOC['//ACT'].first['descendant::node()/SPEAKER']
|
33
|
-
|
34
|
-
lambda {
|
35
|
-
speakers.uniq
|
36
|
-
}.should_not change(speakers, :size)
|
37
|
-
end
|
38
|
-
|
39
|
-
it 'should indeed have side-effects when using bang uniq' do
|
40
|
-
speakers = DOC['//ACT'].first['descendant::node()/SPEAKER']
|
41
|
-
|
42
|
-
lambda {
|
43
|
-
speakers.uniq!
|
44
|
-
}.should change(speakers, :size)
|
45
|
-
end
|
46
|
-
|
47
|
-
end
|