mongoid-fts 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/LICENSE +1 -0
- data/README.md +12 -7
- data/Rakefile +7 -1
- data/lib/mongoid-fts.rb +4 -2
- data/mongoid-fts.gemspec +4 -2
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTM5ZGRmMDc2YzhiZGE5NmJiMjA2YzdiNGQ4ZmNiZDIzODNmNDExZA==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZmFlZTVjYWJkYzdjNzA3NzUyNzZiNDJjYjQ0YjY0YmE4ZDAyMjNiNQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NDc3ZTNkNGVhNWQ5NjlhMGEyMzQ4YWI1NDNmYzliNDkzZDQzZjllYzEzOWEx
|
10
|
+
Mzk2NjlkNmI1MmQ0YWE4ZWExMzYwNjgxMDhjYWVmNTQxYzgxNGMyNmIzYmFk
|
11
|
+
ZGEyZGQ4MmZjYzQ0OWM5ZmRlZjQ0ZmZhMTY2MmYxNjgxNTI3NTk=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NWNmNWI4ZTEwYjk4Y2Q4OTdjOGQ4M2MyMmJiOWU5ZWVhNmUyYmM5ZWQyNzBk
|
14
|
+
NmQ0NDUzMDg4OGQ4ZDZlNzFiMzU3MzU0NDVkMzJlM2YxODkzMmFkMmRmMTNk
|
15
|
+
NzU1OTZlZDA4MzY5MWJlNjJiMjRhOGU0YTIyMDIxM2EyMjYwNGY=
|
data/LICENSE
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
same as ruby's
|
data/README.md
CHANGED
@@ -1,19 +1,23 @@
|
|
1
1
|
NAME
|
2
|
+
------------------
|
2
3
|
|
3
4
|
mongoid-fts.rb
|
4
5
|
|
5
6
|
DESCRIPTION
|
7
|
+
------------------
|
6
8
|
|
7
|
-
|
9
|
+
enable mongodb's new fulltext simply and quickly on your mongoid models.
|
8
10
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
supports
|
12
|
+
|
13
|
+
* pagination
|
14
|
+
* strict literal searching (including stopwords)
|
15
|
+
* cross models searching
|
16
|
+
* index is automatically kept in sync
|
17
|
+
* customize ranking with #to_search
|
15
18
|
|
16
19
|
INSTALL
|
20
|
+
------------------
|
17
21
|
|
18
22
|
````ruby
|
19
23
|
|
@@ -36,6 +40,7 @@ INSTALL
|
|
36
40
|
````
|
37
41
|
|
38
42
|
SYNOPSIS
|
43
|
+
------------------
|
39
44
|
|
40
45
|
````ruby
|
41
46
|
|
data/Rakefile
CHANGED
@@ -13,10 +13,14 @@ This.setup!
|
|
13
13
|
|
14
14
|
|
15
15
|
|
16
|
-
task :default do
|
16
|
+
task :default => :license do
|
17
17
|
puts((Rake::Task.tasks.map{|task| task.name.gsub(/::/,':')} - ['default']).sort)
|
18
18
|
end
|
19
19
|
|
20
|
+
task :license do
|
21
|
+
open('LICENSE', 'w'){|fd| fd.puts "same as ruby's"}
|
22
|
+
end
|
23
|
+
|
20
24
|
task :test do
|
21
25
|
This.run_tests!
|
22
26
|
end
|
@@ -99,6 +103,7 @@ task :gemspec do
|
|
99
103
|
test_files = test(?e, "test/#{ lib }.rb") ? "test/#{ lib }.rb" : nil
|
100
104
|
summary = This.summary || This.synopsis || "#{ lib } kicks the ass"
|
101
105
|
description = This.description || summary
|
106
|
+
license = object.respond_to?(:license) ? object.license : "same as ruby's"
|
102
107
|
|
103
108
|
if This.extensions.nil?
|
104
109
|
This.extensions = []
|
@@ -136,6 +141,7 @@ task :gemspec do
|
|
136
141
|
spec.platform = Gem::Platform::RUBY
|
137
142
|
spec.summary = <%= lib.inspect %>
|
138
143
|
spec.description = <%= description.inspect %>
|
144
|
+
spec.license = <%= license.inspect %>
|
139
145
|
|
140
146
|
spec.files =\n<%= files.sort.pretty_inspect %>
|
141
147
|
spec.executables = <%= executables.inspect %>
|
data/lib/mongoid-fts.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module Mongoid
|
2
2
|
module FTS
|
3
3
|
#
|
4
|
-
const_set(:Version, '1.
|
4
|
+
const_set(:Version, '1.1.0') unless const_defined?(:Version)
|
5
5
|
|
6
6
|
class << FTS
|
7
7
|
def version
|
@@ -135,6 +135,7 @@ module Mongoid
|
|
135
135
|
_denormalize!
|
136
136
|
@page = 1
|
137
137
|
@per = size
|
138
|
+
@num_pages = 1
|
138
139
|
end
|
139
140
|
|
140
141
|
def paginate(*args)
|
@@ -145,6 +146,7 @@ module Mongoid
|
|
145
146
|
|
146
147
|
@page = [page.abs, 1].max
|
147
148
|
@per = [per.abs, 1].max
|
149
|
+
@num_pages = (size.to_f / @per).ceil
|
148
150
|
|
149
151
|
offset = (@page - 1) * @per
|
150
152
|
length = @per
|
@@ -181,7 +183,7 @@ module Mongoid
|
|
181
183
|
end
|
182
184
|
|
183
185
|
def num_pages
|
184
|
-
|
186
|
+
@num_pages
|
185
187
|
end
|
186
188
|
|
187
189
|
def total_pages
|
data/mongoid-fts.gemspec
CHANGED
@@ -3,13 +3,15 @@
|
|
3
3
|
|
4
4
|
Gem::Specification::new do |spec|
|
5
5
|
spec.name = "mongoid-fts"
|
6
|
-
spec.version = "1.
|
6
|
+
spec.version = "1.1.0"
|
7
7
|
spec.platform = Gem::Platform::RUBY
|
8
8
|
spec.summary = "mongoid-fts"
|
9
9
|
spec.description = "enable mongodb's new fulltext simply and quickly on your mongoid models, including pagination."
|
10
|
+
spec.license = "same as ruby's"
|
10
11
|
|
11
12
|
spec.files =
|
12
|
-
["
|
13
|
+
["LICENSE",
|
14
|
+
"README.md",
|
13
15
|
"Rakefile",
|
14
16
|
"lib",
|
15
17
|
"lib/app",
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongoid-fts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ara T. Howard
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-02-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mongoid
|
@@ -59,13 +59,15 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
+
- LICENSE
|
62
63
|
- README.md
|
63
64
|
- Rakefile
|
64
65
|
- lib/app/mongoid/fts/index.rb
|
65
66
|
- lib/mongoid-fts.rb
|
66
67
|
- mongoid-fts.gemspec
|
67
68
|
homepage: https://github.com/ahoward/mongoid-fts
|
68
|
-
licenses:
|
69
|
+
licenses:
|
70
|
+
- same as ruby's
|
69
71
|
metadata: {}
|
70
72
|
post_install_message:
|
71
73
|
rdoc_options: []
|