ruby-xquery 0.2.1.297 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  == VERSION
4
4
 
5
- This documentation refers to ruby-xquery version 0.2.1
5
+ This documentation refers to ruby-xquery version 0.2.2
6
6
 
7
7
 
8
8
  == DESCRIPTION
@@ -10,6 +10,15 @@ This documentation refers to ruby-xquery version 0.2.1
10
10
  TODO: well, the description... ;-)
11
11
 
12
12
 
13
+ == LINKS
14
+
15
+ <b></b>
16
+ Documentation:: <http://prometheus.rubyforge.org/ruby-xquery>
17
+ Source code (old):: <http://prometheus.rubyforge.org/svn/scratch/ruby-xquery>
18
+ Source code:: <http://github.com/blackwinter/ruby-xquery>
19
+ Rubyforge project:: <http://rubyforge.org/projects/prometheus>
20
+
21
+
13
22
  == AUTHORS
14
23
 
15
24
  * Jens Wille <mailto:jens.wille@uni-koeln.de>
data/Rakefile CHANGED
@@ -15,7 +15,7 @@ Hen.lay! {{
15
15
  :version => LibXML::XML::XQuery::VERSION,
16
16
  :summary => "Libxml's XPath support + plain ol' Ruby = XQuery (kind of... ;-)",
17
17
  :files => FileList['lib/**/*.rb'].to_a,
18
- :extra_files => FileList['[A-Z]*', 'specs/*.rb', 'test_data/*'].to_a,
18
+ :extra_files => FileList['[A-Z]*', 'spec/**/*.rb', 'test_data/**/*'].to_a,
19
19
  :dependencies => [['libxml-ruby', '>= 0.9.3']]
20
20
  }
21
21
  }}
@@ -8,7 +8,7 @@ module LibXML
8
8
 
9
9
  MAJOR = 0
10
10
  MINOR = 2
11
- TINY = 1
11
+ TINY = 2
12
12
 
13
13
  class << self
14
14
 
@@ -0,0 +1,7 @@
1
+ BASE = File.join(File.dirname(__FILE__), '..') unless Object.const_defined?(:BASE)
2
+
3
+ $: << File.join(BASE, 'lib')
4
+
5
+ require 'libxml/xquery'
6
+
7
+ DOC = LibXML::XML::Document.file(File.join(BASE, 'test_data', 'hamlet.xml')) unless Object.const_defined?(:DOC)
@@ -0,0 +1,47 @@
1
+ require File.join(File.dirname(__FILE__), 'spec_helper')
2
+
3
+ describe LibXML::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
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.2.1.297
4
+ version: 0.2.2
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-12-02 00:00:00 +01:00
12
+ date: 2008-12-13 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -33,31 +33,33 @@ extra_rdoc_files:
33
33
  - ChangeLog
34
34
  - README
35
35
  files:
36
+ - lib/libxml/xquery.rb
36
37
  - lib/libxml/xquery/uniqueness.rb
38
+ - lib/libxml/xquery/string_representation.rb
37
39
  - lib/libxml/xquery/version.rb
38
40
  - lib/libxml/xquery/namespaces.rb
39
- - lib/libxml/xquery/string_representation.rb
40
41
  - lib/libxml/xquery/enhanced_find.rb
41
- - lib/libxml/xquery.rb
42
42
  - lib/xml/xquery.rb
43
43
  - COPYING
44
+ - Rakefile
44
45
  - README
45
46
  - ChangeLog
46
- - Rakefile
47
+ - spec/spec_helper.rb
48
+ - spec/xquery_spec.rb
47
49
  - test_data/play.dtd
48
50
  - test_data/hamlet.xml
49
51
  has_rdoc: true
50
- homepage: http://prometheus.rubyforge.org/ruby-xquery
52
+ homepage: http://prometheus.rubyforge.org/doc
51
53
  post_install_message:
52
54
  rdoc_options:
53
55
  - --inline-source
56
+ - --all
54
57
  - --title
55
58
  - ruby-xquery Application documentation
56
- - --charset
57
- - UTF-8
58
59
  - --main
59
60
  - README
60
- - --all
61
+ - --charset
62
+ - UTF-8
61
63
  - --line-numbers
62
64
  require_paths:
63
65
  - lib