ffi-tracker 0.0.2 → 0.1.0
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.
- metadata +34 -86
- data/README.rdoc +0 -22
- data/Rakefile +0 -3
- data/lib/ffi-tracker.rb +0 -15
- data/tasks/notes.rake +0 -121
- data/tasks/rdoc.rake +0 -6
- data/tasks/setup.rb +0 -6
- data/tasks/test.rake +0 -25
- data/tasks/yardoc.rake +0 -6
- data/test/integration/load_test.rb +0 -9
- data/test/test_helper.rb +0 -7
- data/test/unit/tracker_sparql_cursor_test.rb +0 -13
metadata
CHANGED
@@ -1,111 +1,59 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: ffi-tracker
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 2
|
10
|
-
version: 0.0.2
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Matijs van Zuijlen
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2012-04-09 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: gir_ffi-tracker
|
16
|
+
requirement: &16890300 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
segments:
|
30
|
-
- 0
|
31
|
-
- 0
|
32
|
-
- 10
|
33
|
-
version: 0.0.10
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.1.0
|
34
22
|
type: :runtime
|
35
|
-
version_requirements: *id001
|
36
|
-
- !ruby/object:Gem::Dependency
|
37
|
-
name: minitest
|
38
23
|
prerelease: false
|
39
|
-
|
40
|
-
none: false
|
41
|
-
requirements:
|
42
|
-
- - ">="
|
43
|
-
- !ruby/object:Gem::Version
|
44
|
-
hash: 11
|
45
|
-
segments:
|
46
|
-
- 2
|
47
|
-
- 0
|
48
|
-
- 2
|
49
|
-
version: 2.0.2
|
50
|
-
type: :development
|
51
|
-
version_requirements: *id002
|
24
|
+
version_requirements: *16890300
|
52
25
|
description:
|
53
|
-
email:
|
26
|
+
email:
|
54
27
|
- matijs@matijs.net
|
55
28
|
executables: []
|
56
|
-
|
57
29
|
extensions: []
|
58
|
-
|
59
|
-
|
60
|
-
- README.rdoc
|
61
|
-
files:
|
62
|
-
- lib/ffi-tracker.rb
|
63
|
-
- test/test_helper.rb
|
64
|
-
- test/unit/tracker_sparql_cursor_test.rb
|
65
|
-
- test/integration/load_test.rb
|
66
|
-
- tasks/yardoc.rake
|
67
|
-
- tasks/rdoc.rake
|
68
|
-
- tasks/test.rake
|
69
|
-
- tasks/setup.rb
|
70
|
-
- tasks/notes.rake
|
71
|
-
- README.rdoc
|
72
|
-
- Rakefile
|
30
|
+
extra_rdoc_files: []
|
31
|
+
files: []
|
73
32
|
homepage: http://www.github.com/mvz/ffi-tracker
|
74
33
|
licenses: []
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
require_paths:
|
34
|
+
post_install_message: ! " #########################################################################\n\n
|
35
|
+
\ The gem ffi-tracker won't be updated anymore. Please use gir_ffi-tracker.\n\n
|
36
|
+
\ #########################################################################\n"
|
37
|
+
rdoc_options: []
|
38
|
+
require_paths:
|
81
39
|
- lib
|
82
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
83
41
|
none: false
|
84
|
-
requirements:
|
85
|
-
- -
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
88
|
-
|
89
|
-
- 0
|
90
|
-
version: "0"
|
91
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
47
|
none: false
|
93
|
-
requirements:
|
94
|
-
- -
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
|
97
|
-
segments:
|
98
|
-
- 0
|
99
|
-
version: "0"
|
48
|
+
requirements:
|
49
|
+
- - ! '>='
|
50
|
+
- !ruby/object:Gem::Version
|
51
|
+
version: '0'
|
100
52
|
requirements: []
|
101
|
-
|
102
53
|
rubyforge_project:
|
103
|
-
rubygems_version: 1.
|
54
|
+
rubygems_version: 1.8.11
|
104
55
|
signing_key:
|
105
56
|
specification_version: 3
|
106
57
|
summary: FFI-based binding to Tracker, using the GObject Introspection Repository
|
107
|
-
|
108
|
-
|
109
|
-
- test/test_helper.rb
|
110
|
-
- test/unit/tracker_sparql_cursor_test.rb
|
111
|
-
has_rdoc:
|
58
|
+
(deprecated)
|
59
|
+
test_files: []
|
data/README.rdoc
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
= ffi-tracker
|
2
|
-
|
3
|
-
by Matijs van Zuijlen
|
4
|
-
|
5
|
-
http://www.github.com/mvz/ffi-tracker
|
6
|
-
|
7
|
-
== Description
|
8
|
-
|
9
|
-
Ruby bindings for Tracker using GirFFI.
|
10
|
-
|
11
|
-
== Features
|
12
|
-
|
13
|
-
* Auto-generated bindings using GObject introspection.
|
14
|
-
* Adds overrides for introspection data bugs.
|
15
|
-
|
16
|
-
== License
|
17
|
-
|
18
|
-
Copyright (c) 2011 Matijs van Zuijlen
|
19
|
-
|
20
|
-
ffi-tracker is free software, distributed under the terms of the GNU Lesser
|
21
|
-
General Public License, version 2.1 or later. See the file COPYING.LIB for
|
22
|
-
more information.
|
data/Rakefile
DELETED
data/lib/ffi-tracker.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'gir_ffi'
|
2
|
-
|
3
|
-
GirFFI.setup :Tracker
|
4
|
-
|
5
|
-
module Tracker
|
6
|
-
SparqlCursor.class_eval do
|
7
|
-
def get_string_with_hidden_length column
|
8
|
-
result, length = *get_string_without_hidden_length(column)
|
9
|
-
result
|
10
|
-
end
|
11
|
-
|
12
|
-
alias get_string_without_hidden_length get_string
|
13
|
-
alias get_string get_string_with_hidden_length
|
14
|
-
end
|
15
|
-
end
|
data/tasks/notes.rake
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
# The following code is copied straight from Bones 2.5.1
|
2
|
-
#
|
3
|
-
|
4
|
-
module Bones
|
5
|
-
|
6
|
-
# A helper class used to find and display any annotations in a collection of
|
7
|
-
# project files.
|
8
|
-
#
|
9
|
-
class AnnotationExtractor
|
10
|
-
|
11
|
-
class Annotation < Struct.new(:line, :tag, :text)
|
12
|
-
# Returns a string representation of the annotation. If the
|
13
|
-
# <tt>:tag</tt> parameter is given as +true+, then the annotation tag
|
14
|
-
# will be included in the string.
|
15
|
-
#
|
16
|
-
def to_s( opts = {} )
|
17
|
-
s = "[%3d] " % line
|
18
|
-
s << "[#{tag}] " if opts[:tag]
|
19
|
-
s << text
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
# Enumerate all the annoations for the given _project_ and _tag_. This
|
24
|
-
# will search for all athe annotations and display them on standard
|
25
|
-
# output.
|
26
|
-
#
|
27
|
-
def self.enumerate tag, id = nil, opts = {}
|
28
|
-
extractor = new(tag, id)
|
29
|
-
extractor.display(extractor.find, opts)
|
30
|
-
end
|
31
|
-
|
32
|
-
attr_reader :tag, :id
|
33
|
-
|
34
|
-
# Creates a new annotation extractor configured to use the _project_ open
|
35
|
-
# strcut and to search for the given _tag_ (which can be more than one tag
|
36
|
-
# via a regular expression 'or' operation -- i.e. THIS|THAT|OTHER)
|
37
|
-
#
|
38
|
-
def initialize tag, id
|
39
|
-
@tag = tag
|
40
|
-
@id = @id_rgxp = nil
|
41
|
-
|
42
|
-
unless id.nil? or id.empty?
|
43
|
-
@id = id
|
44
|
-
@id_rgxp = Regexp.new(Regexp.escape(id), Regexp::IGNORECASE)
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
# Iterate over all the files in the project and extract annotations from
|
49
|
-
# the those files. Returns the results as a hash for display.
|
50
|
-
#
|
51
|
-
def find
|
52
|
-
results = {}
|
53
|
-
rgxp = %r/(#{tag}):?\s*(.*?)(?:\s*(?:-?%>|\*+\/))?$/o
|
54
|
-
|
55
|
-
files = Dir.glob("lib/**/*.rb")
|
56
|
-
files += Dir.glob("test/**/*.rb")
|
57
|
-
files.each do |fn|
|
58
|
-
results.update(extract_annotations_from(fn, rgxp))
|
59
|
-
end
|
60
|
-
|
61
|
-
results
|
62
|
-
end
|
63
|
-
|
64
|
-
# Extract any annotations from the given _file_ using the regular
|
65
|
-
# expression _pattern_ provided.
|
66
|
-
#
|
67
|
-
def extract_annotations_from( file, pattern )
|
68
|
-
lineno = 0
|
69
|
-
result = File.readlines(file).inject([]) do |list, line|
|
70
|
-
lineno += 1
|
71
|
-
next list unless m = pattern.match(line)
|
72
|
-
next list << Annotation.new(lineno, m[1], m[2]) unless id
|
73
|
-
|
74
|
-
text = m[2]
|
75
|
-
if text =~ @id_rgxp
|
76
|
-
list << Annotation.new(lineno, m[1], text)
|
77
|
-
end
|
78
|
-
list
|
79
|
-
end
|
80
|
-
result.empty? ? {} : { file => result }
|
81
|
-
end
|
82
|
-
|
83
|
-
# Print the results of the annotation extraction to the screen. If the
|
84
|
-
# <tt>:tags</tt> option is set to +true+, then the annotation tag will be
|
85
|
-
# displayed.
|
86
|
-
#
|
87
|
-
def display( results, opts = {} )
|
88
|
-
results.keys.sort.each do |file|
|
89
|
-
puts "#{file}:"
|
90
|
-
results[file].each do |note|
|
91
|
-
puts " * #{note.to_s(opts)}"
|
92
|
-
end
|
93
|
-
puts
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
end # class AnnotationExtractor
|
98
|
-
end # module Bones
|
99
|
-
|
100
|
-
note_tags = ["TODO", "FIXME", "OPTIMIZE"]
|
101
|
-
|
102
|
-
desc "Enumerate all annotations"
|
103
|
-
task :notes do |t|
|
104
|
-
id = if t.application.top_level_tasks.length > 1
|
105
|
-
t.application.top_level_tasks.slice!(1..-1).join(' ')
|
106
|
-
end
|
107
|
-
Bones::AnnotationExtractor.enumerate(
|
108
|
-
note_tags.join('|'), id, :tag => true)
|
109
|
-
end
|
110
|
-
|
111
|
-
namespace :notes do
|
112
|
-
note_tags.each do |tag|
|
113
|
-
desc "Enumerate all #{tag} annotations"
|
114
|
-
task tag.downcase.to_sym do |t|
|
115
|
-
id = if t.application.top_level_tasks.length > 1
|
116
|
-
t.application.top_level_tasks.slice!(1..-1).join(' ')
|
117
|
-
end
|
118
|
-
Bones::AnnotationExtractor.enumerate(tag, id)
|
119
|
-
end
|
120
|
-
end
|
121
|
-
end
|
data/tasks/rdoc.rake
DELETED
data/tasks/setup.rb
DELETED
data/tasks/test.rake
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
require 'rake/testtask'
|
2
|
-
|
3
|
-
namespace :test do
|
4
|
-
|
5
|
-
Rake::TestTask.new(:unit) do |t|
|
6
|
-
t.libs = ['lib']
|
7
|
-
t.test_files = FileList['test/unit/*_test.rb']
|
8
|
-
t.ruby_opts += ["-w"]
|
9
|
-
end
|
10
|
-
|
11
|
-
Rake::TestTask.new(:integration) do |t|
|
12
|
-
t.libs = ['lib']
|
13
|
-
t.test_files = FileList['test/integration/*_test.rb']
|
14
|
-
t.ruby_opts += ["-w"]
|
15
|
-
end
|
16
|
-
|
17
|
-
desc 'Run rcov for the entire test suite'
|
18
|
-
task :coverage do
|
19
|
-
rm_f "coverage"
|
20
|
-
system "rcov", "-Ilib", "--exclude", "\.gem\/,\/gems\/", *FileList['test/**/*_test.rb']
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
desc 'Run unit and integration tests'
|
25
|
-
task :test => ['test:unit', 'test:integration']
|
data/tasks/yardoc.rake
DELETED
data/test/test_helper.rb
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
require File.expand_path('../test_helper.rb', File.dirname(__FILE__))
|
2
|
-
|
3
|
-
describe Tracker::SparqlCursor do
|
4
|
-
describe "#get_string" do
|
5
|
-
it "returns just the string value" do
|
6
|
-
conn = Tracker::SparqlConnection.get_direct nil
|
7
|
-
cursor = conn.query "SELECT ?url WHERE { ?x a nie:InformationElement; nie:url ?url. }", nil
|
8
|
-
|
9
|
-
cursor.next nil
|
10
|
-
assert_instance_of String, cursor.get_string(0)
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|