activegroonga 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.ja.rdoc +4 -0
- data/NEWS.rdoc +4 -0
- data/Rakefile +12 -3
- data/lib/active_groonga.rb +2 -2
- data/lib/active_groonga/base.rb +7 -3
- data/lib/active_groonga/column.rb +2 -2
- data/lib/active_groonga/schema.rb +7 -7
- data/lib/active_groonga/version.rb +1 -1
- data/test/active-groonga-test-utils.rb +5 -6
- metadata +13 -3
data/NEWS.ja.rdoc
CHANGED
data/NEWS.rdoc
CHANGED
data/Rakefile
CHANGED
@@ -27,7 +27,7 @@ require 'hoe'
|
|
27
27
|
|
28
28
|
ENV["NODOT"] = "yes"
|
29
29
|
|
30
|
-
Hoe::SUPPORTED_TEST_FRAMEWORKS[:testunit2] = "test/run-test.rb"
|
30
|
+
Hoe::Test::SUPPORTED_TEST_FRAMEWORKS[:testunit2] = "test/run-test.rb"
|
31
31
|
|
32
32
|
base_dir = File.join(File.dirname(__FILE__))
|
33
33
|
truncate_base_dir = Proc.new do |x|
|
@@ -85,7 +85,10 @@ end
|
|
85
85
|
|
86
86
|
ENV["VERSION"] ||= guess_version
|
87
87
|
version = ENV["VERSION"]
|
88
|
-
project =
|
88
|
+
project = nil
|
89
|
+
Hoe.spec('activegroonga') do |_project|
|
90
|
+
project = _project
|
91
|
+
project.version = version
|
89
92
|
project.rubyforge_name = 'groonga'
|
90
93
|
authors = File.join(base_dir, "AUTHORS")
|
91
94
|
project.author = File.readlines(authors).collect do |line|
|
@@ -104,7 +107,7 @@ project = Hoe.new('activegroonga', version) do |project|
|
|
104
107
|
:extra_rdoc_files => Dir.glob("*.rdoc"),
|
105
108
|
}
|
106
109
|
project.readme_file = "README.ja.rdoc"
|
107
|
-
project.extra_deps = [["activerecord", "=2.3.2"]]
|
110
|
+
project.extra_deps = [["groonga", "=#{version}"], ["activerecord", "=2.3.2"]]
|
108
111
|
|
109
112
|
news_of_current_release = File.read("NEWS.rdoc").split(/^==\s.*$/)[1]
|
110
113
|
project.changes = cleanup_white_space(news_of_current_release)
|
@@ -173,3 +176,9 @@ task :prepare_docs_for_publishing do
|
|
173
176
|
end
|
174
177
|
end
|
175
178
|
end
|
179
|
+
|
180
|
+
task :tag do
|
181
|
+
repository = "svn+ssh://rubyforge.org/var/svn/groonga/activegroonga"
|
182
|
+
sh("svn cp -m 'release #{version}!!!' " +
|
183
|
+
"#{repository}/trunk #{repository}/tags/#{version}")
|
184
|
+
end
|
data/lib/active_groonga.rb
CHANGED
@@ -21,8 +21,8 @@ base_dir = File.dirname(__FILE__)
|
|
21
21
|
ruby_groonga_dir = File.join(base_dir, "..", "..", "groonga")
|
22
22
|
ruby_groonga_dir = File.expand_path(ruby_groonga_dir)
|
23
23
|
if File.exist?(ruby_groonga_dir)
|
24
|
-
$LOAD_PATH.unshift(File.join(ruby_groonga_dir, "
|
25
|
-
$LOAD_PATH.unshift(File.join(ruby_groonga_dir, "
|
24
|
+
$LOAD_PATH.unshift(File.join(ruby_groonga_dir, "ext"))
|
25
|
+
$LOAD_PATH.unshift(File.join(ruby_groonga_dir, "lib"))
|
26
26
|
end
|
27
27
|
require 'groonga'
|
28
28
|
|
data/lib/active_groonga/base.rb
CHANGED
@@ -590,9 +590,9 @@ module ActiveGroonga
|
|
590
590
|
end
|
591
591
|
database_file = File.join(database_directory, "database.groonga")
|
592
592
|
if File.exist?(database_file)
|
593
|
-
Groonga::Database.new(database_file)
|
593
|
+
@@database = Groonga::Database.new(database_file)
|
594
594
|
else
|
595
|
-
Groonga::Database.create(:path => database_file)
|
595
|
+
@@database = Groonga::Database.create(:path => database_file)
|
596
596
|
end
|
597
597
|
self.database_directory = database_directory
|
598
598
|
end
|
@@ -648,7 +648,11 @@ module ActiveGroonga
|
|
648
648
|
end
|
649
649
|
end
|
650
650
|
if index_records
|
651
|
-
sorted_records = index_records.sort([
|
651
|
+
sorted_records = index_records.sort([
|
652
|
+
:key => ".:score",
|
653
|
+
:order => :descending,
|
654
|
+
],
|
655
|
+
:limit => limit)
|
652
656
|
limit = sorted_records.size
|
653
657
|
target_records = sorted_records.records(:order => :ascending).collect do |record|
|
654
658
|
index_record_id = record.value.unpack("i")[0]
|
@@ -80,9 +80,9 @@ module ActiveGroonga
|
|
80
80
|
case @column.range
|
81
81
|
when Groonga::Type
|
82
82
|
case @column.range.id
|
83
|
-
when Groonga::Type::
|
83
|
+
when Groonga::Type::INT32
|
84
84
|
:integer
|
85
|
-
when Groonga::Type::
|
85
|
+
when Groonga::Type::UINT32, Groonga::Type::UINT64
|
86
86
|
:unsigned_integer
|
87
87
|
when Groonga::Type::INT64
|
88
88
|
:decimal
|
@@ -106,13 +106,12 @@ module ActiveGroonga
|
|
106
106
|
|
107
107
|
name = "#{table_name}/#{column_name}"
|
108
108
|
path = File.join(base_dir, "#{column_name}.groonga")
|
109
|
-
index_column = index_table.
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
:with_position => true)
|
109
|
+
index_column = index_table.define_index_column(name, table,
|
110
|
+
:path => path,
|
111
|
+
:compress => "zlib",
|
112
|
+
# :with_section => true,
|
113
|
+
# :with_weight => true,
|
114
|
+
:with_position => true)
|
116
115
|
index_column.source = column
|
117
116
|
|
118
117
|
record = index_management_table.add
|
@@ -197,6 +196,7 @@ module ActiveGroonga
|
|
197
196
|
# :key_with_sis => true,
|
198
197
|
# :key_normalize => true,
|
199
198
|
:path => table_file)
|
199
|
+
table.default_tokenizer = "<token:bigram>"
|
200
200
|
|
201
201
|
base_dir = File.join(Base.metadata_directory, table_name)
|
202
202
|
FileUtils.mkdir_p(base_dir)
|
@@ -143,12 +143,11 @@ module ActiveGroongaTestUtils
|
|
143
143
|
bookmarks_index_dir + "content.groonga"
|
144
144
|
path = @bookmarks_content_index_column_path.to_s
|
145
145
|
@bookmarks_content_index_column =
|
146
|
-
@index.
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
:path => path)
|
146
|
+
@index.define_index_column("bookmarks/content", @bookmarks,
|
147
|
+
:with_section => true,
|
148
|
+
:with_weight => true,
|
149
|
+
:with_position => true,
|
150
|
+
:path => path)
|
152
151
|
@bookmarks_content_index_column.source = @content_column
|
153
152
|
|
154
153
|
record = ActiveGroonga::Schema.index_management_table.add
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activegroonga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,9 +9,19 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-06-05 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: groonga
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - "="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.0.2
|
24
|
+
version:
|
15
25
|
- !ruby/object:Gem::Dependency
|
16
26
|
name: activerecord
|
17
27
|
type: :runtime
|
@@ -184,7 +194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
194
|
requirements: []
|
185
195
|
|
186
196
|
rubyforge_project: groonga
|
187
|
-
rubygems_version: 1.3.
|
197
|
+
rubygems_version: 1.3.3
|
188
198
|
signing_key:
|
189
199
|
specification_version: 3
|
190
200
|
summary: A library to use groonga with ActiveRecord like API.
|