searchgasm 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.rdoc +5 -0
- data/Manifest +2 -0
- data/README.rdoc +2 -0
- data/Rakefile +1 -1
- data/lib/searchgasm/condition/ilike.rb +15 -0
- data/lib/searchgasm/condition/not_ilike.rb +20 -0
- data/lib/searchgasm/version.rb +1 -1
- data/lib/searchgasm.rb +1 -1
- data/searchgasm.gemspec +7 -13
- metadata +6 -12
data/CHANGELOG.rdoc
CHANGED
data/Manifest
CHANGED
@@ -15,6 +15,7 @@ lib/searchgasm/condition/ends_with.rb
|
|
15
15
|
lib/searchgasm/condition/equals.rb
|
16
16
|
lib/searchgasm/condition/greater_than.rb
|
17
17
|
lib/searchgasm/condition/greater_than_or_equal_to.rb
|
18
|
+
lib/searchgasm/condition/ilike.rb
|
18
19
|
lib/searchgasm/condition/inclusive_descendant_of.rb
|
19
20
|
lib/searchgasm/condition/keywords.rb
|
20
21
|
lib/searchgasm/condition/less_than.rb
|
@@ -26,6 +27,7 @@ lib/searchgasm/condition/not_blank.rb
|
|
26
27
|
lib/searchgasm/condition/not_end_with.rb
|
27
28
|
lib/searchgasm/condition/not_equal.rb
|
28
29
|
lib/searchgasm/condition/not_have_keywords.rb
|
30
|
+
lib/searchgasm/condition/not_ilike.rb
|
29
31
|
lib/searchgasm/condition/not_like.rb
|
30
32
|
lib/searchgasm/condition/not_nil.rb
|
31
33
|
lib/searchgasm/condition/sibling_of.rb
|
data/README.rdoc
CHANGED
@@ -251,6 +251,7 @@ Each column can be used with any of the following conditions
|
|
251
251
|
:equals :is, "" Lets ActiveRecord handle this
|
252
252
|
:greater_than :gt, :after col > value
|
253
253
|
:greater_than_or_equal_to :at_least, :least, :gte col >= value
|
254
|
+
:ilike :icontains, :ihas PostgreSQL specific, makes LIKE case insensitive
|
254
255
|
:less_than :lt, :before col < value
|
255
256
|
:less_than_or_equal_to :at_most, :most, :lte col <= value
|
256
257
|
:keywords :kwords, :kw Splits into each word and omits meaningless words, a true keyword search
|
@@ -260,6 +261,7 @@ Each column can be used with any of the following conditions
|
|
260
261
|
:not_end_with :not_ew, :not_end, :end_is_not, :end_not
|
261
262
|
:not_equal :does_not_equal, :is_not, :not
|
262
263
|
:not_have_keywords :not_have_keywords, :not_keywords, :not_have_kw, :not_kw, :not_have_kwwords, :not_kwwords
|
264
|
+
:not_ilike :not_icontain, :not_ihave
|
263
265
|
:not_like :not_contain, :not_have
|
264
266
|
|
265
267
|
=== Class level conditions
|
data/Rakefile
CHANGED
@@ -10,6 +10,6 @@ Echoe.new 'searchgasm' do |p|
|
|
10
10
|
p.project = 'searchgasm'
|
11
11
|
p.summary = "Object based ActiveRecord searching, ordering, pagination, and more!"
|
12
12
|
p.url = "http://github.com/binarylogic/searchgasm"
|
13
|
-
p.dependencies = %w(activerecord activesupport
|
13
|
+
p.dependencies = %w(activerecord activesupport)
|
14
14
|
p.include_rakefile = true
|
15
15
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Searchgasm
|
2
|
+
module Condition
|
3
|
+
class Ilike < Base
|
4
|
+
class << self
|
5
|
+
def condition_names_for_column
|
6
|
+
super + ["icontains", "ihas"]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_conditions(value)
|
11
|
+
["#{column_sql} ILIKE ?", "%#{value}%"]
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Searchgasm
|
2
|
+
module Condition
|
3
|
+
class NotIlike < Base
|
4
|
+
class << self
|
5
|
+
def condition_names_for_column
|
6
|
+
super + ["not_icontain", "not_ihave"]
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def to_conditions(value)
|
11
|
+
like = Ilike.new(klass, options)
|
12
|
+
like.value = value
|
13
|
+
conditions = like.to_conditions
|
14
|
+
return conditions if conditions.blank?
|
15
|
+
conditions.first.gsub!(" ILIKE ", " NOT ILIKE ")
|
16
|
+
conditions
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/searchgasm/version.rb
CHANGED
data/lib/searchgasm.rb
CHANGED
@@ -44,7 +44,7 @@ require "searchgasm/conditions/base"
|
|
44
44
|
# Condition
|
45
45
|
require "searchgasm/condition/base"
|
46
46
|
require "searchgasm/condition/tree"
|
47
|
-
SEARCHGASM_CONDITIONS = [:begins_with, :blank, :child_of, :descendant_of, :ends_with, :equals, :greater_than, :greater_than_or_equal_to, :inclusive_descendant_of, :like, :nil, :not_begin_with, :not_blank, :not_end_with, :not_equal, :not_have_keywords, :not_nil, :keywords, :less_than, :less_than_or_equal_to, :sibling_of]
|
47
|
+
SEARCHGASM_CONDITIONS = [:begins_with, :blank, :child_of, :descendant_of, :ends_with, :equals, :greater_than, :greater_than_or_equal_to, :inclusive_descendant_of, :ilike, :like, :nil, :not_begin_with, :not_blank, :not_end_with, :not_equal, :not_have_keywords, :not_ilike, :not_nil, :keywords, :less_than, :less_than_or_equal_to, :sibling_of]
|
48
48
|
SEARCHGASM_CONDITIONS.each { |condition| require "searchgasm/condition/#{condition}" }
|
49
49
|
|
50
50
|
# Modifiers
|
data/searchgasm.gemspec
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
|
2
|
-
# Gem::Specification for Searchgasm-1.5.
|
2
|
+
# Gem::Specification for Searchgasm-1.5.2
|
3
3
|
# Originally generated by Echoe
|
4
4
|
|
5
5
|
--- !ruby/object:Gem::Specification
|
6
6
|
name: searchgasm
|
7
7
|
version: !ruby/object:Gem::Version
|
8
|
-
version: 1.5.
|
8
|
+
version: 1.5.2
|
9
9
|
platform: ruby
|
10
10
|
authors:
|
11
11
|
- Ben Johnson of Binary Logic
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
|
15
|
-
date: 2008-10-
|
15
|
+
date: 2008-10-21 00:00:00 -04:00
|
16
16
|
default_executable:
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
@@ -35,16 +35,6 @@ dependencies:
|
|
35
35
|
- !ruby/object:Gem::Version
|
36
36
|
version: "0"
|
37
37
|
version:
|
38
|
-
- !ruby/object:Gem::Dependency
|
39
|
-
name: configatron
|
40
|
-
type: :runtime
|
41
|
-
version_requirement:
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
43
|
-
requirements:
|
44
|
-
- - ">="
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: "0"
|
47
|
-
version:
|
48
38
|
- !ruby/object:Gem::Dependency
|
49
39
|
name: echoe
|
50
40
|
type: :development
|
@@ -77,6 +67,7 @@ extra_rdoc_files:
|
|
77
67
|
- lib/searchgasm/condition/equals.rb
|
78
68
|
- lib/searchgasm/condition/greater_than.rb
|
79
69
|
- lib/searchgasm/condition/greater_than_or_equal_to.rb
|
70
|
+
- lib/searchgasm/condition/ilike.rb
|
80
71
|
- lib/searchgasm/condition/inclusive_descendant_of.rb
|
81
72
|
- lib/searchgasm/condition/keywords.rb
|
82
73
|
- lib/searchgasm/condition/less_than.rb
|
@@ -88,6 +79,7 @@ extra_rdoc_files:
|
|
88
79
|
- lib/searchgasm/condition/not_end_with.rb
|
89
80
|
- lib/searchgasm/condition/not_equal.rb
|
90
81
|
- lib/searchgasm/condition/not_have_keywords.rb
|
82
|
+
- lib/searchgasm/condition/not_ilike.rb
|
91
83
|
- lib/searchgasm/condition/not_like.rb
|
92
84
|
- lib/searchgasm/condition/not_nil.rb
|
93
85
|
- lib/searchgasm/condition/sibling_of.rb
|
@@ -176,6 +168,7 @@ files:
|
|
176
168
|
- lib/searchgasm/condition/equals.rb
|
177
169
|
- lib/searchgasm/condition/greater_than.rb
|
178
170
|
- lib/searchgasm/condition/greater_than_or_equal_to.rb
|
171
|
+
- lib/searchgasm/condition/ilike.rb
|
179
172
|
- lib/searchgasm/condition/inclusive_descendant_of.rb
|
180
173
|
- lib/searchgasm/condition/keywords.rb
|
181
174
|
- lib/searchgasm/condition/less_than.rb
|
@@ -187,6 +180,7 @@ files:
|
|
187
180
|
- lib/searchgasm/condition/not_end_with.rb
|
188
181
|
- lib/searchgasm/condition/not_equal.rb
|
189
182
|
- lib/searchgasm/condition/not_have_keywords.rb
|
183
|
+
- lib/searchgasm/condition/not_ilike.rb
|
190
184
|
- lib/searchgasm/condition/not_like.rb
|
191
185
|
- lib/searchgasm/condition/not_nil.rb
|
192
186
|
- lib/searchgasm/condition/sibling_of.rb
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: searchgasm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Johnson of Binary Logic
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-10-
|
12
|
+
date: 2008-10-21 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -32,16 +32,6 @@ dependencies:
|
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: "0"
|
34
34
|
version:
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: configatron
|
37
|
-
type: :runtime
|
38
|
-
version_requirement:
|
39
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
-
requirements:
|
41
|
-
- - ">="
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version: "0"
|
44
|
-
version:
|
45
35
|
- !ruby/object:Gem::Dependency
|
46
36
|
name: echoe
|
47
37
|
type: :development
|
@@ -74,6 +64,7 @@ extra_rdoc_files:
|
|
74
64
|
- lib/searchgasm/condition/equals.rb
|
75
65
|
- lib/searchgasm/condition/greater_than.rb
|
76
66
|
- lib/searchgasm/condition/greater_than_or_equal_to.rb
|
67
|
+
- lib/searchgasm/condition/ilike.rb
|
77
68
|
- lib/searchgasm/condition/inclusive_descendant_of.rb
|
78
69
|
- lib/searchgasm/condition/keywords.rb
|
79
70
|
- lib/searchgasm/condition/less_than.rb
|
@@ -85,6 +76,7 @@ extra_rdoc_files:
|
|
85
76
|
- lib/searchgasm/condition/not_end_with.rb
|
86
77
|
- lib/searchgasm/condition/not_equal.rb
|
87
78
|
- lib/searchgasm/condition/not_have_keywords.rb
|
79
|
+
- lib/searchgasm/condition/not_ilike.rb
|
88
80
|
- lib/searchgasm/condition/not_like.rb
|
89
81
|
- lib/searchgasm/condition/not_nil.rb
|
90
82
|
- lib/searchgasm/condition/sibling_of.rb
|
@@ -173,6 +165,7 @@ files:
|
|
173
165
|
- lib/searchgasm/condition/equals.rb
|
174
166
|
- lib/searchgasm/condition/greater_than.rb
|
175
167
|
- lib/searchgasm/condition/greater_than_or_equal_to.rb
|
168
|
+
- lib/searchgasm/condition/ilike.rb
|
176
169
|
- lib/searchgasm/condition/inclusive_descendant_of.rb
|
177
170
|
- lib/searchgasm/condition/keywords.rb
|
178
171
|
- lib/searchgasm/condition/less_than.rb
|
@@ -184,6 +177,7 @@ files:
|
|
184
177
|
- lib/searchgasm/condition/not_end_with.rb
|
185
178
|
- lib/searchgasm/condition/not_equal.rb
|
186
179
|
- lib/searchgasm/condition/not_have_keywords.rb
|
180
|
+
- lib/searchgasm/condition/not_ilike.rb
|
187
181
|
- lib/searchgasm/condition/not_like.rb
|
188
182
|
- lib/searchgasm/condition/not_nil.rb
|
189
183
|
- lib/searchgasm/condition/sibling_of.rb
|