xapor 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/xapor/model_integration.rb +10 -10
- data/xapor.gemspec +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.6
|
@@ -16,7 +16,7 @@ module Xapor::XapianFuIntegration
|
|
16
16
|
attr_accessor :xapor_config
|
17
17
|
attr_accessor :xapor_db
|
18
18
|
end
|
19
|
-
|
19
|
+
|
20
20
|
include XapianFu
|
21
21
|
|
22
22
|
def self.search(query)
|
@@ -24,14 +24,14 @@ module Xapor::XapianFuIntegration
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def self.reset_index
|
27
|
-
if
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
if self.xapor_db
|
28
|
+
self.xapor_db.flush
|
29
|
+
self.xapor_db.ro.close
|
30
|
+
self.xapor_db.rw.close
|
31
31
|
end
|
32
|
-
|
32
|
+
self.xapor_db = ::XapianFu::XapianDb.new(self.xapor_config.xapian_fu_db.merge(:overwrite => true))
|
33
33
|
if block_given?
|
34
|
-
yield
|
34
|
+
yield self.xapor_db
|
35
35
|
end
|
36
36
|
end
|
37
37
|
|
@@ -45,10 +45,10 @@ module Xapor::XapianFuIntegration
|
|
45
45
|
self
|
46
46
|
end
|
47
47
|
self.xapor_config.search_fields.each do |field|
|
48
|
-
|
49
|
-
|
50
|
-
end
|
48
|
+
eigenclass.send(:define_method, :"search_by_#{field}") do |query|
|
49
|
+
self.search(query)
|
51
50
|
end
|
51
|
+
end
|
52
52
|
|
53
53
|
if defined? ActiveRecord && ancestors.includes(ActiveRecord::Base)
|
54
54
|
after_save :add_to_index
|
data/xapor.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{xapor}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.6"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David Workman"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-06-01}
|
13
13
|
s.description = %q{Rails plugin for Xapian search, built on XapianFu and DelayedJob.}
|
14
14
|
s.email = %q{workmad3@hedtek.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 6
|
9
|
+
version: 0.1.6
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- David Workman
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-06-01 00:00:00 +01:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|