postgres-fulltext-search-helper 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 98f060f64e144065dd6b0b02cc2c2d7243a4f193a1a46b9ab344e1116e113fdf
|
4
|
+
data.tar.gz: 7774bc638315997a5a4f7a42eacd2bd9b804a8f0cc5634f18441784b5b6af6e5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: e82714efe6e979eb2d1a01105a0b3a4822f59fd9c9bb580f9f738461a4993e0cd5f8b3e40bcb8d87079b96332f79e956cbe61cf23f893f65ff04e04eec6ae9fe
|
7
|
+
data.tar.gz: 8d5f68c227551ebabb6530b5785606251716260ce1c6cded486b0ba46d31ea0321418ec5fe382c4619a57cbeaa22d7ebc64ad9fe0174e02917b7a8883e3ae2bf
|
data/.gitignore
CHANGED
@@ -3,7 +3,7 @@ require "postgres-fulltext-search-helper/version"
|
|
3
3
|
module PostgresFulltextSearchHelper
|
4
4
|
extend self
|
5
5
|
|
6
|
-
POSTGRES_TSQUERY_SENSITIVE_CHARACTERS = /[
|
6
|
+
POSTGRES_TSQUERY_SENSITIVE_CHARACTERS = /[<>|&!():\* ]/
|
7
7
|
|
8
8
|
def format_query_for_fulltext(query)
|
9
9
|
parts = query.split(POSTGRES_TSQUERY_SENSITIVE_CHARACTERS).delete_if{|x| x.strip.empty? }
|
@@ -6,8 +6,8 @@ require 'postgres-fulltext-search-helper/version'
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
7
|
gem.name = "postgres-fulltext-search-helper"
|
8
8
|
gem.version = Postgres::Fulltext::Search::Helper::VERSION
|
9
|
-
gem.authors = ["Justin Fitzsimmons", "Arturo Pie"]
|
10
|
-
gem.email = ["justinf@nulogy.com", "arturop@nulogy.com"]
|
9
|
+
gem.authors = ["Justin Fitzsimmons", "Arturo Pie", "Shahriyar Nasir"]
|
10
|
+
gem.email = ["justinf@nulogy.com", "arturop@nulogy.com", "shahn@nulogy.com"]
|
11
11
|
gem.description = %q{Use postgres' fulltext search with ease}
|
12
12
|
gem.summary = ""
|
13
13
|
gem.homepage = ""
|
@@ -17,5 +17,6 @@ Gem::Specification.new do |gem|
|
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
19
19
|
|
20
|
-
gem.add_development_dependency "rspec"
|
20
|
+
gem.add_development_dependency "rspec", "~> 3.0"
|
21
|
+
gem.add_development_dependency "rake", "~> 10.0"
|
21
22
|
end
|
@@ -16,14 +16,14 @@ describe PostgresFulltextSearchHelper do
|
|
16
16
|
end
|
17
17
|
|
18
18
|
it "handles sensitive characters" do
|
19
|
-
query = "*:hello
|
19
|
+
query = "*:hello <>&(world)!|"
|
20
20
|
expect(Helper.format_query_for_fulltext(query)).to eq("(hello:* | -hello:*) & (world:* | -world:*)")
|
21
21
|
end
|
22
22
|
|
23
23
|
it "adds a filter to a activerecord-style scope" do
|
24
|
-
scope =
|
24
|
+
scope = double("scope")
|
25
25
|
|
26
|
-
scope.
|
26
|
+
expect(scope).to receive(:where).with("to_tsvector('simple', name::text) @@ to_tsquery('simple', ?)", ["(hello:* | -hello:*) & (world:* | -world:*)"])
|
27
27
|
|
28
28
|
Helper.search(scope, "name", "hello world")
|
29
29
|
end
|
metadata
CHANGED
@@ -1,42 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: postgres-fulltext-search-helper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Justin Fitzsimmons
|
9
8
|
- Arturo Pie
|
9
|
+
- Shahriyar Nasir
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2019-09-17 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
18
|
-
none: false
|
19
18
|
requirements:
|
20
|
-
- -
|
19
|
+
- - "~>"
|
21
20
|
- !ruby/object:Gem::Version
|
22
|
-
version: '0'
|
21
|
+
version: '3.0'
|
23
22
|
type: :development
|
24
23
|
prerelease: false
|
25
24
|
version_requirements: !ruby/object:Gem::Requirement
|
26
|
-
none: false
|
27
25
|
requirements:
|
28
|
-
- -
|
26
|
+
- - "~>"
|
29
27
|
- !ruby/object:Gem::Version
|
30
|
-
version: '0'
|
28
|
+
version: '3.0'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: rake
|
31
|
+
requirement: !ruby/object:Gem::Requirement
|
32
|
+
requirements:
|
33
|
+
- - "~>"
|
34
|
+
- !ruby/object:Gem::Version
|
35
|
+
version: '10.0'
|
36
|
+
type: :development
|
37
|
+
prerelease: false
|
38
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
|
+
requirements:
|
40
|
+
- - "~>"
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
version: '10.0'
|
31
43
|
description: Use postgres' fulltext search with ease
|
32
44
|
email:
|
33
45
|
- justinf@nulogy.com
|
34
46
|
- arturop@nulogy.com
|
47
|
+
- shahn@nulogy.com
|
35
48
|
executables: []
|
36
49
|
extensions: []
|
37
50
|
extra_rdoc_files: []
|
38
51
|
files:
|
39
|
-
- .gitignore
|
52
|
+
- ".gitignore"
|
40
53
|
- Gemfile
|
41
54
|
- LICENSE.txt
|
42
55
|
- README.md
|
@@ -47,27 +60,25 @@ files:
|
|
47
60
|
- spec/postgres-fulltext-search-helper_spec.rb
|
48
61
|
homepage: ''
|
49
62
|
licenses: []
|
63
|
+
metadata: {}
|
50
64
|
post_install_message:
|
51
65
|
rdoc_options: []
|
52
66
|
require_paths:
|
53
67
|
- lib
|
54
68
|
required_ruby_version: !ruby/object:Gem::Requirement
|
55
|
-
none: false
|
56
69
|
requirements:
|
57
|
-
- -
|
70
|
+
- - ">="
|
58
71
|
- !ruby/object:Gem::Version
|
59
72
|
version: '0'
|
60
73
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
61
|
-
none: false
|
62
74
|
requirements:
|
63
|
-
- -
|
75
|
+
- - ">="
|
64
76
|
- !ruby/object:Gem::Version
|
65
77
|
version: '0'
|
66
78
|
requirements: []
|
67
|
-
|
68
|
-
rubygems_version: 1.8.24
|
79
|
+
rubygems_version: 3.0.6
|
69
80
|
signing_key:
|
70
|
-
specification_version:
|
81
|
+
specification_version: 4
|
71
82
|
summary: ''
|
72
83
|
test_files:
|
73
84
|
- spec/postgres-fulltext-search-helper_spec.rb
|