athena 0.0.3.58 → 0.0.4.59
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 +1 -1
- data/bin/athena +0 -0
- data/lib/athena/formats/dbm.rb +1 -1
- data/lib/athena/formats/ferret.rb +10 -14
- data/lib/athena/version.rb +1 -1
- metadata +9 -7
data/README
CHANGED
data/bin/athena
CHANGED
|
File without changes
|
data/lib/athena/formats/dbm.rb
CHANGED
|
@@ -51,12 +51,17 @@ class Athena::Formats
|
|
|
51
51
|
|
|
52
52
|
@config = config
|
|
53
53
|
@parser = parser
|
|
54
|
-
|
|
55
|
-
@match_all_query = ::Ferret::Search::MatchAllQuery.new
|
|
56
54
|
end
|
|
57
55
|
|
|
58
56
|
def parse(source)
|
|
59
|
-
|
|
57
|
+
path = source.path
|
|
58
|
+
raise "index not found: #{path}" unless File.readable?(File.join(path, 'segments'))
|
|
59
|
+
|
|
60
|
+
index = ::Ferret::Index::IndexReader.new(path)
|
|
61
|
+
|
|
62
|
+
0.upto(index.max_doc - 1) { |i|
|
|
63
|
+
doc = index[i]
|
|
64
|
+
|
|
60
65
|
record = Athena::Record.new(parser.block, doc[record_element])
|
|
61
66
|
|
|
62
67
|
config.each { |element, field_config|
|
|
@@ -65,21 +70,12 @@ class Athena::Formats
|
|
|
65
70
|
|
|
66
71
|
record.close
|
|
67
72
|
}
|
|
73
|
+
|
|
74
|
+
index.num_docs
|
|
68
75
|
end
|
|
69
76
|
|
|
70
77
|
private
|
|
71
78
|
|
|
72
|
-
def search_all(source)
|
|
73
|
-
index = ::Ferret::Index::Index.new(
|
|
74
|
-
:path => source.path,
|
|
75
|
-
:create_if_missing => false
|
|
76
|
-
).searcher
|
|
77
|
-
|
|
78
|
-
index.search_each(match_all_query, :limit => :all) { |doc_id, _|
|
|
79
|
-
yield index[doc_id] if block_given?
|
|
80
|
-
}
|
|
81
|
-
end
|
|
82
|
-
|
|
83
79
|
class NoRecordElementError < StandardError
|
|
84
80
|
end
|
|
85
81
|
|
data/lib/athena/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: athena
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.4.59
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jens Wille
|
|
@@ -9,11 +9,12 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2008-
|
|
12
|
+
date: 2008-11-19 00:00:00 +01:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: xmlstreamin
|
|
17
|
+
type: :runtime
|
|
17
18
|
version_requirement:
|
|
18
19
|
version_requirements: !ruby/object:Gem::Requirement
|
|
19
20
|
requirements:
|
|
@@ -23,6 +24,7 @@ dependencies:
|
|
|
23
24
|
version:
|
|
24
25
|
- !ruby/object:Gem::Dependency
|
|
25
26
|
name: ruby-nuggets
|
|
27
|
+
type: :runtime
|
|
26
28
|
version_requirement:
|
|
27
29
|
version_requirements: !ruby/object:Gem::Requirement
|
|
28
30
|
requirements:
|
|
@@ -64,15 +66,15 @@ has_rdoc: true
|
|
|
64
66
|
homepage: http://prometheus.rubyforge.org/athena
|
|
65
67
|
post_install_message:
|
|
66
68
|
rdoc_options:
|
|
69
|
+
- --line-numbers
|
|
70
|
+
- --inline-source
|
|
67
71
|
- --title
|
|
68
72
|
- athena Application documentation
|
|
69
|
-
- --charset
|
|
70
|
-
- UTF-8
|
|
71
73
|
- --main
|
|
72
74
|
- README
|
|
73
|
-
- --line-numbers
|
|
74
75
|
- --all
|
|
75
|
-
- --
|
|
76
|
+
- --charset
|
|
77
|
+
- UTF-8
|
|
76
78
|
require_paths:
|
|
77
79
|
- lib
|
|
78
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
@@ -90,7 +92,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
90
92
|
requirements: []
|
|
91
93
|
|
|
92
94
|
rubyforge_project: prometheus
|
|
93
|
-
rubygems_version: 1.
|
|
95
|
+
rubygems_version: 1.3.1
|
|
94
96
|
signing_key:
|
|
95
97
|
specification_version: 2
|
|
96
98
|
summary: Convert database files to various formats.
|