activegroonga 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.ja.rdoc +6 -0
- data/NEWS.rdoc +6 -0
- data/README.ja.rdoc +4 -4
- data/README.rdoc +4 -4
- data/Rakefile +19 -1
- data/lib/active_groonga/base.rb +3 -1
- data/lib/active_groonga/persistence.rb +1 -1
- data/lib/active_groonga/result_set.rb +17 -0
- data/lib/active_groonga/version.rb +1 -1
- data/lib/active_groonga.rb +1 -7
- data/test/active-groonga-test-utils.rb +1 -0
- data/test/test-schema.rb +3 -1
- metadata +6 -6
data/NEWS.ja.rdoc
CHANGED
data/NEWS.rdoc
CHANGED
data/README.ja.rdoc
CHANGED
@@ -12,10 +12,10 @@ groongaは全文検索機能とカラムストアの機能を提供していま
|
|
12
12
|
ActiveRecordとRDBの組み合わせの代わりに、ActiveGroongaと
|
13
13
|
groongaの組み合わせを使うことができます。
|
14
14
|
|
15
|
-
|
16
|
-
|
15
|
+
rroongaをベースとしています。rroongaとgroongaに関する情報は以
|
16
|
+
下を参照して下さい。
|
17
17
|
|
18
|
-
*
|
18
|
+
* rroonga: http://groonga.rubyforge.org/
|
19
19
|
* groonga: http://groonga.org/
|
20
20
|
|
21
21
|
== 作者
|
@@ -39,7 +39,7 @@ LGPL 2.1です。詳しくはlicense/LGPLを見てください。
|
|
39
39
|
|
40
40
|
== ドキュメント
|
41
41
|
|
42
|
-
http://groonga.rubyforge.org/
|
42
|
+
http://groonga.rubyforge.org/activegroonga/
|
43
43
|
|
44
44
|
== メーリングリスト
|
45
45
|
|
data/README.rdoc
CHANGED
@@ -12,10 +12,10 @@ groonga provides both of full text search and column store
|
|
12
12
|
features. ActiveGroonga + groonga can be used as an
|
13
13
|
alternative of ActiveRecord + RDB.
|
14
14
|
|
15
|
-
ActiveGroonga is based on
|
16
|
-
|
15
|
+
ActiveGroonga is based on rroonga. See the following URLs
|
16
|
+
about rroonga and groonga.
|
17
17
|
|
18
|
-
*
|
18
|
+
* rroonga: http://groonga.rubyforge.org/
|
19
19
|
* groonga: http://groonga.org/
|
20
20
|
|
21
21
|
== Author
|
@@ -41,7 +41,7 @@ contributed patches.)
|
|
41
41
|
|
42
42
|
Japanese only. Sorry.
|
43
43
|
|
44
|
-
http://groonga.rubyforge.org/
|
44
|
+
http://groonga.rubyforge.org/activegroonga/
|
45
45
|
|
46
46
|
== Mailing list
|
47
47
|
|
data/Rakefile
CHANGED
@@ -121,7 +121,7 @@ Hoe.spec('activegroonga') do |_project|
|
|
121
121
|
description = cleanup_white_space(entries[entries.index("Description") + 1])
|
122
122
|
project.summary, project.description, = description.split(/\n\n+/, 3)
|
123
123
|
|
124
|
-
project.remote_rdoc_dir = "
|
124
|
+
project.remote_rdoc_dir = "activegroonga"
|
125
125
|
end
|
126
126
|
|
127
127
|
project.spec.dependencies.delete_if {|dependency| dependency.name == "hoe"}
|
@@ -182,6 +182,24 @@ task :prepare_docs_for_publishing do
|
|
182
182
|
end
|
183
183
|
end
|
184
184
|
|
185
|
+
namespace :backward_compatibility do
|
186
|
+
desc "Publish HTML for backward compatibility."
|
187
|
+
task :publish_html do
|
188
|
+
config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
|
189
|
+
host = "#{config["username"]}@rubyforge.org"
|
190
|
+
|
191
|
+
rsync_args = "-av --exclude .svn --delete"
|
192
|
+
remote_dir = "/var/www/gforge-projects/#{project.rubyforge_name}/"
|
193
|
+
mkdir_p "active_groonga"
|
194
|
+
File.open("active_groonga/.htaccess", "w") do |htaccess|
|
195
|
+
htaccess.puts(<<-EOH)
|
196
|
+
Redirect permanent / http://groonga.rubyforge.org/activegroonga/
|
197
|
+
EOH
|
198
|
+
end
|
199
|
+
sh "rsync #{rsync_args} active_groonga/ #{host}:#{remote_dir}"
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
185
203
|
desc "Tag the current revision."
|
186
204
|
task :tag do
|
187
205
|
sh("git tag -a #{version} -m 'release #{version}!!!'")
|
data/lib/active_groonga/base.rb
CHANGED
@@ -33,6 +33,8 @@ module ActiveGroonga
|
|
33
33
|
cattr_accessor :configurations
|
34
34
|
|
35
35
|
@@context = nil
|
36
|
+
cattr_writer :context, :instance_writer => false
|
37
|
+
|
36
38
|
@@encoding = "utf8"
|
37
39
|
cattr_reader :encoding, :instance_reader => false
|
38
40
|
|
@@ -110,7 +112,7 @@ module ActiveGroonga
|
|
110
112
|
end
|
111
113
|
|
112
114
|
def context
|
113
|
-
Groonga::Context.default
|
115
|
+
@@context ||= Groonga::Context.default
|
114
116
|
end
|
115
117
|
|
116
118
|
def encoding=(new_encoding)
|
@@ -31,6 +31,7 @@ module ActiveGroonga
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def paginate(sort_keys, options={})
|
34
|
+
options[:page] = normalize_page_value(options[:page])
|
34
35
|
records = @records.paginate(sort_keys, options)
|
35
36
|
set = self.class.new(records, @klass,
|
36
37
|
:expression => @expression)
|
@@ -81,12 +82,28 @@ module ActiveGroonga
|
|
81
82
|
end
|
82
83
|
end
|
83
84
|
|
85
|
+
def normalize_page_value(page)
|
86
|
+
if page.blank?
|
87
|
+
1
|
88
|
+
else
|
89
|
+
begin
|
90
|
+
Integer(page)
|
91
|
+
rescue ArgumentError
|
92
|
+
1
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
|
84
97
|
module PaginationProxy
|
85
98
|
Groonga::Pagination.instance_methods.each do |method_name|
|
86
99
|
define_method(method_name) do
|
87
100
|
@records.send(method_name)
|
88
101
|
end
|
89
102
|
end
|
103
|
+
|
104
|
+
# For kaminari.
|
105
|
+
alias_method :num_pages, :n_pages
|
106
|
+
alias_method :limit_value, :page_size
|
90
107
|
end
|
91
108
|
end
|
92
109
|
end
|
data/lib/active_groonga.rb
CHANGED
@@ -17,13 +17,6 @@ require 'pathname'
|
|
17
17
|
|
18
18
|
require 'active_model'
|
19
19
|
|
20
|
-
base_dir = Pathname(__FILE__).dirname
|
21
|
-
rroonga_dir = (base_dir + "../../groonga").expand_path
|
22
|
-
if rroonga_dir.exist?
|
23
|
-
$LOAD_PATH.unshift(rroonga_dir + "ext" + "groonga")
|
24
|
-
$LOAD_PATH.unshift(rroonga_dir + "lib")
|
25
|
-
end
|
26
|
-
|
27
20
|
require 'groonga'
|
28
21
|
|
29
22
|
module ActiveGroonga
|
@@ -48,4 +41,5 @@ module ActiveGroonga
|
|
48
41
|
end
|
49
42
|
end
|
50
43
|
|
44
|
+
base_dir = Pathname(__FILE__).dirname
|
51
45
|
I18n.load_path << (base_dir + 'active_groonga/locale/en.yml').to_s
|
data/test/test-schema.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Copyright (C) 2009-
|
1
|
+
# Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
|
2
2
|
#
|
3
3
|
# This library is free software; you can redistribute it and/or
|
4
4
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -118,6 +118,7 @@ ActiveGroonga::Schema.define(:version => 0) do |schema|
|
|
118
118
|
create_table("terms",
|
119
119
|
:type => :patricia_trie,
|
120
120
|
:key_type => "ShortText",
|
121
|
+
:default_tokenizer => "TokenBigram",
|
121
122
|
:force => true) do |table|
|
122
123
|
end
|
123
124
|
|
@@ -131,6 +132,7 @@ ActiveGroonga::Schema.define(:version => 0) do |schema|
|
|
131
132
|
end
|
132
133
|
|
133
134
|
change_table("terms") do |table|
|
135
|
+
table.index("bookmarks", "comment", :name => "bookmarks_comment")
|
134
136
|
table.index("bookmarks", "content", :name => "bookmarks_content")
|
135
137
|
end
|
136
138
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activegroonga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 31
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 1.0.
|
9
|
+
- 4
|
10
|
+
version: 1.0.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kouhei Sutou
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date:
|
18
|
+
date: 2011-03-31 00:00:00 +09:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
255
255
|
requirements: []
|
256
256
|
|
257
257
|
rubyforge_project: groonga
|
258
|
-
rubygems_version: 1.
|
258
|
+
rubygems_version: 1.6.2
|
259
259
|
signing_key:
|
260
260
|
specification_version: 3
|
261
261
|
summary: A library to use groonga with ActiveRecord like API.
|