gir_ffi-tracker 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -1,8 +1,10 @@
1
- = ffi-tracker
1
+ = gir_ffi-tracker
2
2
 
3
3
  by Matijs van Zuijlen
4
4
 
5
- http://www.github.com/mvz/ffi-tracker
5
+ http://www.github.com/mvz/gir_ffi-tracker
6
+
7
+ {<img src="https://secure.travis-ci.org/mvz/gir_ffi-tracker.png" />}[http://travis-ci.org/mvz/gir_ffi-tracker]
6
8
 
7
9
  == Description
8
10
 
@@ -17,6 +19,6 @@ Ruby bindings for Tracker using GirFFI.
17
19
 
18
20
  Copyright (c) 2011 Matijs van Zuijlen
19
21
 
20
- ffi-tracker is free software, distributed under the terms of the GNU Lesser
22
+ gir_ffi-tracker is free software, distributed under the terms of the GNU Lesser
21
23
  General Public License, version 2.1 or later. See the file COPYING.LIB for
22
24
  more information.
@@ -0,0 +1,19 @@
1
+ require 'gir_ffi'
2
+
3
+ GirFFI.setup :Tracker
4
+
5
+ module Tracker
6
+ load_class :SparqlCursor
7
+
8
+ class SparqlCursor
9
+ _setup_instance_method "get_string"
10
+
11
+ def get_string_with_hidden_length column
12
+ result, _ = *get_string_without_hidden_length(column)
13
+ result
14
+ end
15
+
16
+ alias get_string_without_hidden_length get_string
17
+ alias get_string get_string_with_hidden_length
18
+ end
19
+ end
@@ -2,12 +2,20 @@ require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
2
2
 
3
3
  describe Tracker::SparqlCursor do
4
4
  describe "#get_string" do
5
- it "returns just the string value" do
5
+ before do
6
6
  conn = Tracker::SparqlConnection.get_direct nil
7
- cursor = conn.query "SELECT ?url WHERE { ?x a nie:InformationElement; nie:url ?url. }", nil
7
+ @cursor = conn.query "SELECT 'Foo' { }", nil
8
+
9
+ @cursor.next nil
10
+ end
11
+
12
+ it "returns just the string value" do
13
+ @cursor.get_string(0).must_equal "Foo"
14
+ end
8
15
 
9
- cursor.next nil
10
- assert_instance_of String, cursor.get_string(0)
16
+ it "can safely be called twice" do
17
+ @cursor.get_string(0)
18
+ @cursor.get_string(0).must_equal "Foo"
11
19
  end
12
20
  end
13
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gir_ffi-tracker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: gir_ffi
16
- requirement: &13684780 !ruby/object:Gem::Requirement
16
+ requirement: &10899540 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 0.3.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *13684780
24
+ version_requirements: *10899540
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: minitest
27
- requirement: &13684280 !ruby/object:Gem::Requirement
27
+ requirement: &10899040 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 2.0.2
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *13684280
35
+ version_requirements: *10899040
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &13683800 !ruby/object:Gem::Requirement
38
+ requirement: &10898560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: 0.9.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *13683800
46
+ version_requirements: *10898560
47
47
  description:
48
48
  email:
49
49
  - matijs@matijs.net
@@ -52,6 +52,7 @@ extensions: []
52
52
  extra_rdoc_files:
53
53
  - README.rdoc
54
54
  files:
55
+ - lib/gir_ffi-tracker.rb
55
56
  - lib/ffi-tracker.rb
56
57
  - test/test_helper.rb
57
58
  - test/unit/tracker_sparql_cursor_test.rb
@@ -63,7 +64,7 @@ files:
63
64
  - tasks/notes.rake
64
65
  - README.rdoc
65
66
  - Rakefile
66
- homepage: http://www.github.com/mvz/ffi-tracker
67
+ homepage: http://www.github.com/mvz/gir_ffi-tracker
67
68
  licenses: []
68
69
  post_install_message:
69
70
  rdoc_options: