lunr 2.0.5 → 2.0.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,8 @@
1
+ === 2.0.6 / 2010-09-09
2
+
3
+ * Improve booleans. Fix Sunspot's cast, add property? sugar method.
4
+ * Add Search#results (a faster to_a).
5
+
1
6
  === 2.0.5 / 2010-09-08
2
7
 
3
8
  * Add default as_json method (just returns backing store).
@@ -6,7 +6,7 @@ module Lunr
6
6
 
7
7
  # Duh.
8
8
 
9
- VERSION = "2.0.5"
9
+ VERSION = "2.0.6"
10
10
 
11
11
  end
12
12
 
@@ -65,6 +65,8 @@ module Lunr
65
65
  @hash[#{name.inspect}]
66
66
  end
67
67
  END
68
+
69
+ alias_method "#{name}?", name if type == :boolean
68
70
  end
69
71
  end
70
72
  end
@@ -74,6 +74,10 @@ module Lunr
74
74
  klass.scopes.key?(name) || super
75
75
  end
76
76
 
77
+ def results
78
+ execute && @results
79
+ end
80
+
77
81
  def scope &block
78
82
  executable!
79
83
  @search.build(&block)
@@ -24,6 +24,14 @@ module Sunspot
24
24
  end
25
25
  end
26
26
 
27
+ module Type
28
+ class BooleanType
29
+ def cast thing
30
+ thing == "true" ? true : thing == "false" ? false : !!thing
31
+ end
32
+ end
33
+ end
34
+
27
35
  class TypeField
28
36
  class << self
29
37
  def alias(dest_class, source_class_name)
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lunr
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 3
4
5
  prerelease: false
5
6
  segments:
6
7
  - 2
7
8
  - 0
8
- - 5
9
- version: 2.0.5
9
+ - 6
10
+ version: 2.0.6
10
11
  platform: ruby
11
12
  authors:
12
13
  - John Barnette
@@ -14,7 +15,7 @@ autorequire:
14
15
  bindir: bin
15
16
  cert_chain: []
16
17
 
17
- date: 2010-09-08 00:00:00 -07:00
18
+ date: 2010-09-09 00:00:00 -07:00
18
19
  default_executable:
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
@@ -25,6 +26,7 @@ dependencies:
25
26
  requirements:
26
27
  - - "="
27
28
  - !ruby/object:Gem::Version
29
+ hash: 19
28
30
  segments:
29
31
  - 1
30
32
  - 1
@@ -40,6 +42,7 @@ dependencies:
40
42
  requirements:
41
43
  - - "="
42
44
  - !ruby/object:Gem::Version
45
+ hash: 47
43
46
  segments:
44
47
  - 4
45
48
  - 4
@@ -55,6 +58,7 @@ dependencies:
55
58
  requirements:
56
59
  - - "="
57
60
  - !ruby/object:Gem::Version
61
+ hash: 27
58
62
  segments:
59
63
  - 1
60
64
  - 3
@@ -70,6 +74,7 @@ dependencies:
70
74
  requirements:
71
75
  - - "="
72
76
  - !ruby/object:Gem::Version
77
+ hash: 19
73
78
  segments:
74
79
  - 2
75
80
  - 6
@@ -85,6 +90,7 @@ dependencies:
85
90
  requirements:
86
91
  - - "="
87
92
  - !ruby/object:Gem::Version
93
+ hash: 23
88
94
  segments:
89
95
  - 1
90
96
  - 0
@@ -100,6 +106,7 @@ dependencies:
100
106
  requirements:
101
107
  - - "="
102
108
  - !ruby/object:Gem::Version
109
+ hash: 27
103
110
  segments:
104
111
  - 1
105
112
  - 3
@@ -115,6 +122,7 @@ dependencies:
115
122
  requirements:
116
123
  - - "="
117
124
  - !ruby/object:Gem::Version
125
+ hash: 9
118
126
  segments:
119
127
  - 1
120
128
  - 7
@@ -130,6 +138,7 @@ dependencies:
130
138
  requirements:
131
139
  - - "="
132
140
  - !ruby/object:Gem::Version
141
+ hash: 43
133
142
  segments:
134
143
  - 0
135
144
  - 9
@@ -145,6 +154,7 @@ dependencies:
145
154
  requirements:
146
155
  - - ">="
147
156
  - !ruby/object:Gem::Version
157
+ hash: 19
148
158
  segments:
149
159
  - 2
150
160
  - 6
@@ -201,6 +211,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
201
211
  requirements:
202
212
  - - ">="
203
213
  - !ruby/object:Gem::Version
214
+ hash: 57
204
215
  segments:
205
216
  - 1
206
217
  - 8
@@ -211,6 +222,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
211
222
  requirements:
212
223
  - - ">="
213
224
  - !ruby/object:Gem::Version
225
+ hash: 3
214
226
  segments:
215
227
  - 0
216
228
  version: "0"