db_text_search 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0b93fa5e6feaef447c7bd1e8580b42aafa2cca3d
4
- data.tar.gz: d1ddab5bfe8ef8cb544c711ab1b4792882578eab
3
+ metadata.gz: 056fe218cb672b103fec059b95bf7327da5cdc12
4
+ data.tar.gz: b866b129a58f829aa4fdf0f658a052a28aaf0542
5
5
  SHA512:
6
- metadata.gz: ffe48a13416b0dd7d820584d411c5a4e22806738e1bc3c36fd2be0121f890b621269f62a058b3791e0322e5f51edc05c255ab0ee87958c8b4e0e1846dba41ca9
7
- data.tar.gz: b07cce34cda731a695d59da849cb0e62a0f2c2247584c32a21cf23c75afeba4382cad4d3fe2cff945e4ccd05bedcd114af44ed5248c1775c2fe5e4c3e148a016
6
+ metadata.gz: b6ee2bf4e5244a12808290ff0b5b00848c6718a97e1ff36291c746b45143068946f982e76c57c336d8741bcc6a30c0a4697ea18911744c48377610a7dfa7a66f
7
+ data.tar.gz: bb9f9f6c61b9be723fb62d7ea6c615f8e28db470a452347b871cb7574bda5b607906f03667a9fe1a57195101ddee484f546f1df6e9a08592180671131b5cc44f
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## v0.2.1
2
+
3
+ * Support for PostGIS adapters.
4
+ [#2](https://github.com/thredded/db_text_search/issues/2)
5
+
1
6
  ## v0.2.0
2
7
 
3
8
  * **Feature** Prefix matching via the new `CaseInsensitive#prefix` method.
data/README.md CHANGED
@@ -11,7 +11,7 @@ DbTextSearch provides a unified interface on top of ActiveRecord for SQLite, MyS
11
11
  Add this line to your application's Gemfile:
12
12
 
13
13
  ```ruby
14
- gem 'db_text_search', '~> 0.2.0'
14
+ gem 'db_text_search', '~> 0.2.1'
15
15
  ```
16
16
 
17
17
  ## Usage
@@ -31,4 +31,6 @@ Gem::Specification.new do |s|
31
31
  s.add_development_dependency 'bundler', '~> 1.11'
32
32
  s.add_development_dependency 'rake', '~> 11.0'
33
33
  s.add_development_dependency 'rspec', '~> 3.4'
34
+ s.add_development_dependency 'simplecov'
35
+ s.add_development_dependency 'rubocop'
34
36
  end
@@ -24,7 +24,7 @@ module DbTextSearch
24
24
  case connection.adapter_name
25
25
  when /mysql/i
26
26
  mysql.call
27
- when /postgres/i
27
+ when /postg/i # match all postgres and postgis adapters
28
28
  postgres.call
29
29
  when /sqlite/i
30
30
  sqlite.call
@@ -48,7 +48,8 @@ module DbTextSearch
48
48
  else
49
49
  ['TEXT COLLATE NOCASE', options]
50
50
  end
51
- })
51
+ }
52
+ )
52
53
  end
53
54
 
54
55
  # Add an index for case-insensitive string search.
@@ -78,7 +79,8 @@ module DbTextSearch
78
79
  postgres: lower_or_insensitive,
79
80
  # Always use COLLATE NOCASE for SQLite, as we can't check if the column is case-sensitive.
80
81
  # It has no performance impact apart from slightly longer query strings for case-insensitive columns.
81
- sqlite: -> { CollateNocaseAdapter })
82
+ sqlite: -> { CollateNocaseAdapter }
83
+ )
82
84
  end
83
85
 
84
86
  # @param connection [ActiveRecord::ConnectionAdapters::AbstractAdapter]
@@ -93,7 +95,8 @@ module DbTextSearch
93
95
  connection,
94
96
  mysql: -> { column.case_sensitive? },
95
97
  postgres: -> { column.sql_type !~ /citext/i },
96
- sqlite: -> { DbTextSearch.unsupported_adapter! connection })
98
+ sqlite: -> { DbTextSearch.unsupported_adapter! connection }
99
+ )
97
100
  end
98
101
  end
99
102
  end
@@ -31,7 +31,8 @@ module DbTextSearch
31
31
  connection.exec_query(quoted_create_index(connection, table_name, **options))
32
32
  },
33
33
  mysql: unsupported,
34
- sqlite: unsupported)
34
+ sqlite: unsupported
35
+ )
35
36
  end
36
37
  end
37
38
  end
@@ -49,7 +49,8 @@ module DbTextSearch
49
49
  connection,
50
50
  mysql: -> { MysqlAdapter },
51
51
  postgres: -> { PostgresAdapter },
52
- sqlite: -> { SqliteAdapter })
52
+ sqlite: -> { SqliteAdapter }
53
+ )
53
54
  end
54
55
  end
55
56
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module DbTextSearch
4
4
  # Gem version
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
@@ -1,7 +1,11 @@
1
1
  if ENV['TRAVIS']
2
2
  group :test do
3
3
  gem 'codeclimate-test-reporter', require: false
4
- gem 'codeclimate_batch', require: false
4
+ gem 'codeclimate_batch', require: false,
5
+ # TODO: use the released version once a new release that supports
6
+ # codeclimate-test-reporter v1.0+ is out.
7
+ git: 'https://github.com/sethherr/codeclimate_batch',
8
+ branch: 'new_simplecov'
5
9
  end
6
10
  else
7
11
  group :test, :development do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: db_text_search
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Mazovetskiy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-06 00:00:00.000000000 Z
11
+ date: 2016-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -114,6 +114,34 @@ dependencies:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
116
  version: '3.4'
117
+ - !ruby/object:Gem::Dependency
118
+ name: simplecov
119
+ requirement: !ruby/object:Gem::Requirement
120
+ requirements:
121
+ - - ">="
122
+ - !ruby/object:Gem::Version
123
+ version: '0'
124
+ type: :development
125
+ prerelease: false
126
+ version_requirements: !ruby/object:Gem::Requirement
127
+ requirements:
128
+ - - ">="
129
+ - !ruby/object:Gem::Version
130
+ version: '0'
131
+ - !ruby/object:Gem::Dependency
132
+ name: rubocop
133
+ requirement: !ruby/object:Gem::Requirement
134
+ requirements:
135
+ - - ">="
136
+ - !ruby/object:Gem::Version
137
+ version: '0'
138
+ type: :development
139
+ prerelease: false
140
+ version_requirements: !ruby/object:Gem::Requirement
141
+ requirements:
142
+ - - ">="
143
+ - !ruby/object:Gem::Version
144
+ version: '0'
117
145
  description: Different relational databases treat text search very differently. DbTextSearch
118
146
  provides a unified interface on top of ActiveRecord for SQLite, MySQL, and PostgreSQL
119
147
  to do case-insensitive string-in-set querying and CI index creation, and basic full-text
@@ -163,10 +191,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
191
  version: '0'
164
192
  requirements: []
165
193
  rubyforge_project:
166
- rubygems_version: 2.5.1
194
+ rubygems_version: 2.5.2
167
195
  signing_key:
168
196
  specification_version: 4
169
197
  summary: A unified interface on top of ActiveRecord for SQLite, MySQL, and PostgreSQLfor
170
198
  case-insensitive string search and basic full-text search.
171
199
  test_files: []
172
- has_rdoc: