acts_as_indexed 0.7.3 → 0.7.5
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/CHANGELOG +7 -0
- data/README.rdoc +7 -2
- data/VERSION +1 -1
- data/acts_as_indexed.gemspec +14 -6
- data/lib/acts_as_indexed/class_methods.rb +3 -4
- data/lib/acts_as_indexed/configuration.rb +4 -15
- data/test/abstract_unit.rb +1 -1
- data/test/configuration_test.rb +1 -1
- metadata +14 -10
data/CHANGELOG
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
===0.7.4 [14th October 2011]
|
2
|
+
- Screwup fix release.
|
3
|
+
|
4
|
+
===0.7.4 [13th October 2011]
|
5
|
+
- Default index location is now in tmp directory. [parndt - Philip Arndt]
|
6
|
+
- Fixed a bug where namespaced models would have directory names containing colons. [ugisozols - Uģis Ozols]
|
7
|
+
|
1
8
|
===0.7.3 [3rd July 2011]
|
2
9
|
- Support for non-default primary keys. [ttoomey - Theron Toomey]
|
3
10
|
- Fixed issue with file-locking on JRuby. [banderso - Ben Anderson]
|
data/README.rdoc
CHANGED
@@ -158,8 +158,8 @@ A full rundown of the available configuration options can be found in
|
|
158
158
|
|
159
159
|
=== Heroku Support
|
160
160
|
|
161
|
-
Acts As Indexed
|
162
|
-
directory is
|
161
|
+
Acts As Indexed supports Heroku out-of-the-box. The index is created in the
|
162
|
+
tmp directory, which is the only writeable part of the Heroku dyno filesystem.
|
163
163
|
|
164
164
|
== RDoc Documentation
|
165
165
|
|
@@ -185,6 +185,11 @@ All of the above are most welcome. mailto:dougal.s@gmail.com
|
|
185
185
|
* Alex Coles
|
186
186
|
* Myles Eftos
|
187
187
|
* Edward Anderson
|
188
|
+
* Florent Guilleux
|
189
|
+
* Ben Anderson
|
190
|
+
* Theron Toomey
|
191
|
+
* Uģis Ozols
|
192
|
+
|
188
193
|
|
189
194
|
== Future Releases
|
190
195
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.7.
|
1
|
+
0.7.5
|
data/acts_as_indexed.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{acts_as_indexed}
|
8
|
-
s.version = "0.7.
|
8
|
+
s.version = "0.7.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = [
|
12
|
-
s.date = %q{2011-
|
11
|
+
s.authors = [%q{Douglas F Shearer}]
|
12
|
+
s.date = %q{2011-10-13}
|
13
13
|
s.description = %q{Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app}
|
14
14
|
s.email = %q{dougal.s@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -45,12 +45,20 @@ Gem::Specification.new do |s|
|
|
45
45
|
"test/search_index_test.rb"
|
46
46
|
]
|
47
47
|
s.homepage = %q{http://github.com/dougal/acts_as_indexed}
|
48
|
-
s.require_paths = [
|
49
|
-
s.rubygems_version = %q{1.
|
48
|
+
s.require_paths = [%q{lib}]
|
49
|
+
s.rubygems_version = %q{1.8.6}
|
50
50
|
s.summary = %q{Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app}
|
51
|
+
s.test_files = [
|
52
|
+
"test/abstract_unit.rb",
|
53
|
+
"test/acts_as_indexed_test.rb",
|
54
|
+
"test/configuration_test.rb",
|
55
|
+
"test/fixtures/post.rb",
|
56
|
+
"test/schema.rb",
|
57
|
+
"test/search_atom_test.rb",
|
58
|
+
"test/search_index_test.rb"
|
59
|
+
]
|
51
60
|
|
52
61
|
if s.respond_to? :specification_version then
|
53
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
54
62
|
s.specification_version = 3
|
55
63
|
|
56
64
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
@@ -19,9 +19,8 @@ module ActsAsIndexed
|
|
19
19
|
# shorter than this value are ignored in searches
|
20
20
|
# unless preceded by the '+' operator. Default is 3.
|
21
21
|
# index_file:: Sets the location for the index. By default this is
|
22
|
-
# RAILS_ROOT/index. Specify as an array.
|
23
|
-
# example would
|
24
|
-
# set as [Rails.root,'tmp','index]
|
22
|
+
# RAILS_ROOT/tmp/index. Specify as an array. The default, for
|
23
|
+
# example, would be set as [Rails.root,'tmp','index].
|
25
24
|
|
26
25
|
def acts_as_indexed(options = {})
|
27
26
|
class_eval do
|
@@ -52,7 +51,7 @@ module ActsAsIndexed
|
|
52
51
|
end
|
53
52
|
|
54
53
|
# Add the Rails environment and this model's name to the index file path.
|
55
|
-
self.aai_config.index_file = self.aai_config.index_file.join(Rails.env, self.name)
|
54
|
+
self.aai_config.index_file = self.aai_config.index_file.join(Rails.env, self.name.underscore)
|
56
55
|
end
|
57
56
|
|
58
57
|
# Adds the passed +record+ to the index. Index is built if it does not already exist. Clears the query cache.
|
@@ -7,9 +7,8 @@ module ActsAsIndexed
|
|
7
7
|
# Used to set up and modify settings for acts_as_indexed.
|
8
8
|
class Configuration
|
9
9
|
|
10
|
-
# Sets the location for the index. Specify as an array.
|
11
|
-
# example
|
12
|
-
# [Rails.root,'tmp','index']
|
10
|
+
# Sets the location for the index. Specify as an array. The default, for
|
11
|
+
# example, would be set as [Rails.root,'tmp','index].
|
13
12
|
attr_accessor :index_file
|
14
13
|
|
15
14
|
# Tuning value for the index partitioning. Larger values result in quicker
|
@@ -30,7 +29,7 @@ module ActsAsIndexed
|
|
30
29
|
# Set to true to enable.
|
31
30
|
# Default is false.
|
32
31
|
attr_accessor :case_sensitive
|
33
|
-
|
32
|
+
|
34
33
|
# Disable indexing, useful for large test suites.
|
35
34
|
# Set to false to disable.
|
36
35
|
# Default is false.
|
@@ -48,7 +47,7 @@ module ActsAsIndexed
|
|
48
47
|
# Since we cannot expect Rails to be available on load, it is best to put
|
49
48
|
# off setting the index_file attribute until as late as possible.
|
50
49
|
def index_file
|
51
|
-
@index_file ||=
|
50
|
+
@index_file ||= Rails.root.join('tmp', 'index')
|
52
51
|
end
|
53
52
|
|
54
53
|
def index_file=(file_path)
|
@@ -75,15 +74,5 @@ module ActsAsIndexed
|
|
75
74
|
@if_proc ||= Proc.new{true}
|
76
75
|
end
|
77
76
|
|
78
|
-
private
|
79
|
-
|
80
|
-
def default_index_file
|
81
|
-
if Rails.root.writable?
|
82
|
-
Rails.root.join('index')
|
83
|
-
else
|
84
|
-
Rails.root.join('tmp', 'index')
|
85
|
-
end
|
86
|
-
end
|
87
|
-
|
88
77
|
end
|
89
78
|
end
|
data/test/abstract_unit.rb
CHANGED
data/test/configuration_test.rb
CHANGED
@@ -4,7 +4,7 @@ include ActsAsIndexed
|
|
4
4
|
class ConfigurationTest < ActiveSupport::TestCase
|
5
5
|
|
6
6
|
def test_default_index_file_should_be_set
|
7
|
-
assert_equal Rails.root.join('index'), config.index_file
|
7
|
+
assert_equal Rails.root.join('tmp', 'index'), config.index_file
|
8
8
|
end
|
9
9
|
|
10
10
|
def test_default_index_file_depth_should_be_set
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_indexed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 9
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 5
|
10
|
+
version: 0.7.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Douglas F Shearer
|
@@ -15,8 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
19
|
-
default_executable:
|
18
|
+
date: 2011-10-13 00:00:00 Z
|
20
19
|
dependencies: []
|
21
20
|
|
22
21
|
description: Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app
|
@@ -55,7 +54,6 @@ files:
|
|
55
54
|
- test/schema.rb
|
56
55
|
- test/search_atom_test.rb
|
57
56
|
- test/search_index_test.rb
|
58
|
-
has_rdoc: true
|
59
57
|
homepage: http://github.com/dougal/acts_as_indexed
|
60
58
|
licenses: []
|
61
59
|
|
@@ -85,9 +83,15 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
83
|
requirements: []
|
86
84
|
|
87
85
|
rubyforge_project:
|
88
|
-
rubygems_version: 1.
|
86
|
+
rubygems_version: 1.8.6
|
89
87
|
signing_key:
|
90
88
|
specification_version: 3
|
91
89
|
summary: Acts As Indexed is a plugin which provides a pain-free way to add fulltext search to your Ruby on Rails app
|
92
|
-
test_files:
|
93
|
-
|
90
|
+
test_files:
|
91
|
+
- test/abstract_unit.rb
|
92
|
+
- test/acts_as_indexed_test.rb
|
93
|
+
- test/configuration_test.rb
|
94
|
+
- test/fixtures/post.rb
|
95
|
+
- test/schema.rb
|
96
|
+
- test/search_atom_test.rb
|
97
|
+
- test/search_index_test.rb
|