phat_pgsearch 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b2990323c55ae33fb1519af0ed7b5ace0eda1301
4
+ data.tar.gz: 33854d6d6f1433455b26120020dab0646750ec3c
5
+ SHA512:
6
+ metadata.gz: ecf6d385401ad59c2899bd153fa05edb38882bb499ce1f0f08ebdfe6efe1d50228ee1faf8edbadbf27548fed684e99826c912cec87539e154a42fea3269ffbd9
7
+ data.tar.gz: a669178b2f54997c90cbffe24009421fd2a3896a88758f02a776284d7d95a98dd3af38c284d90c996f25270876bcb036e2611f91af790a4e9e2e8efde77ebfc1
@@ -1,103 +1,156 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- ZenTest (4.6.2)
5
- actionmailer (3.1.1)
6
- actionpack (= 3.1.1)
7
- mail (~> 2.3.0)
8
- actionpack (3.1.1)
9
- activemodel (= 3.1.1)
10
- activesupport (= 3.1.1)
11
- builder (~> 3.0.0)
4
+ ZenTest (4.11.0)
5
+ actionmailer (4.2.0)
6
+ actionpack (= 4.2.0)
7
+ actionview (= 4.2.0)
8
+ activejob (= 4.2.0)
9
+ mail (~> 2.5, >= 2.5.4)
10
+ rails-dom-testing (~> 1.0, >= 1.0.5)
11
+ actionpack (4.2.0)
12
+ actionview (= 4.2.0)
13
+ activesupport (= 4.2.0)
14
+ rack (~> 1.6.0)
15
+ rack-test (~> 0.6.2)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
18
+ actionview (4.2.0)
19
+ activesupport (= 4.2.0)
20
+ builder (~> 3.1)
12
21
  erubis (~> 2.7.0)
13
- i18n (~> 0.6)
14
- rack (~> 1.3.2)
15
- rack-cache (~> 1.1)
16
- rack-mount (~> 0.8.2)
17
- rack-test (~> 0.6.1)
18
- sprockets (~> 2.0.2)
19
- activemodel (3.1.1)
20
- activesupport (= 3.1.1)
21
- builder (~> 3.0.0)
22
- i18n (~> 0.6)
23
- activerecord (3.1.1)
24
- activemodel (= 3.1.1)
25
- activesupport (= 3.1.1)
26
- arel (~> 2.2.1)
27
- tzinfo (~> 0.3.29)
28
- activeresource (3.1.1)
29
- activemodel (= 3.1.1)
30
- activesupport (= 3.1.1)
31
- activesupport (3.1.1)
32
- multi_json (~> 1.0)
33
- arel (2.2.1)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.1)
24
+ activejob (4.2.0)
25
+ activesupport (= 4.2.0)
26
+ globalid (>= 0.3.0)
27
+ activemodel (4.2.0)
28
+ activesupport (= 4.2.0)
29
+ builder (~> 3.1)
30
+ activerecord (4.2.0)
31
+ activemodel (= 4.2.0)
32
+ activesupport (= 4.2.0)
33
+ arel (~> 6.0)
34
+ activesupport (4.2.0)
35
+ i18n (~> 0.7)
36
+ json (~> 1.7, >= 1.7.7)
37
+ minitest (~> 5.1)
38
+ thread_safe (~> 0.3, >= 0.3.4)
39
+ tzinfo (~> 1.1)
40
+ addressable (2.3.7)
41
+ arel (6.0.0)
34
42
  autotest (4.4.6)
35
43
  ZenTest (>= 4.4.1)
36
- builder (3.0.0)
37
- diff-lcs (1.1.3)
44
+ builder (3.2.2)
45
+ descendants_tracker (0.0.4)
46
+ thread_safe (~> 0.3, >= 0.3.1)
47
+ diff-lcs (1.2.5)
38
48
  erubis (2.7.0)
39
- git (1.2.5)
40
- hike (1.2.1)
41
- i18n (0.6.0)
42
- jeweler (1.6.4)
43
- bundler (~> 1.0)
49
+ faraday (0.9.1)
50
+ multipart-post (>= 1.2, < 3)
51
+ git (1.2.9.1)
52
+ github_api (0.12.3)
53
+ addressable (~> 2.3)
54
+ descendants_tracker (~> 0.0.4)
55
+ faraday (~> 0.8, < 0.10)
56
+ hashie (>= 3.3)
57
+ multi_json (>= 1.7.5, < 2.0)
58
+ nokogiri (~> 1.6.3)
59
+ oauth2
60
+ globalid (0.3.3)
61
+ activesupport (>= 4.1.0)
62
+ hashie (3.4.0)
63
+ highline (1.7.1)
64
+ hike (1.2.3)
65
+ i18n (0.7.0)
66
+ jeweler (2.0.1)
67
+ builder
68
+ bundler (>= 1.0)
44
69
  git (>= 1.2.5)
70
+ github_api
71
+ highline (>= 1.6.15)
72
+ nokogiri (>= 1.5.10)
45
73
  rake
46
- json (1.6.1)
47
- mail (2.3.0)
48
- i18n (>= 0.4.0)
49
- mime-types (~> 1.16)
50
- treetop (~> 1.4.8)
51
- mime-types (1.16)
52
- multi_json (1.0.3)
53
- pg (0.11.0)
54
- polyglot (0.3.2)
55
- rack (1.3.4)
56
- rack-cache (1.1)
57
- rack (>= 0.4)
58
- rack-mount (0.8.3)
59
- rack (>= 1.0.0)
60
- rack-ssl (1.3.2)
61
- rack
62
- rack-test (0.6.1)
74
+ rdoc
75
+ json (1.8.2)
76
+ jwt (1.3.0)
77
+ loofah (2.0.1)
78
+ nokogiri (>= 1.5.9)
79
+ mail (2.6.3)
80
+ mime-types (>= 1.16, < 3)
81
+ mime-types (2.4.3)
82
+ mini_portile (0.6.2)
83
+ minitest (5.5.1)
84
+ multi_json (1.11.0)
85
+ multi_xml (0.5.5)
86
+ multipart-post (2.0.0)
87
+ nokogiri (1.6.6.2)
88
+ mini_portile (~> 0.6.0)
89
+ oauth2 (1.0.0)
90
+ faraday (>= 0.8, < 0.10)
91
+ jwt (~> 1.0)
92
+ multi_json (~> 1.3)
93
+ multi_xml (~> 0.5)
94
+ rack (~> 1.2)
95
+ pg (0.18.1)
96
+ rack (1.6.0)
97
+ rack-test (0.6.3)
63
98
  rack (>= 1.0)
64
- rails (3.1.1)
65
- actionmailer (= 3.1.1)
66
- actionpack (= 3.1.1)
67
- activerecord (= 3.1.1)
68
- activeresource (= 3.1.1)
69
- activesupport (= 3.1.1)
70
- bundler (~> 1.0)
71
- railties (= 3.1.1)
72
- railties (3.1.1)
73
- actionpack (= 3.1.1)
74
- activesupport (= 3.1.1)
75
- rack-ssl (~> 1.3.2)
99
+ rails (4.2.0)
100
+ actionmailer (= 4.2.0)
101
+ actionpack (= 4.2.0)
102
+ actionview (= 4.2.0)
103
+ activejob (= 4.2.0)
104
+ activemodel (= 4.2.0)
105
+ activerecord (= 4.2.0)
106
+ activesupport (= 4.2.0)
107
+ bundler (>= 1.3.0, < 2.0)
108
+ railties (= 4.2.0)
109
+ sprockets-rails
110
+ rails-deprecated_sanitizer (1.0.3)
111
+ activesupport (>= 4.2.0.alpha)
112
+ rails-dom-testing (1.0.5)
113
+ activesupport (>= 4.2.0.beta, < 5.0)
114
+ nokogiri (~> 1.6.0)
115
+ rails-deprecated_sanitizer (>= 1.0.1)
116
+ rails-html-sanitizer (1.0.1)
117
+ loofah (~> 2.0)
118
+ railties (4.2.0)
119
+ actionpack (= 4.2.0)
120
+ activesupport (= 4.2.0)
76
121
  rake (>= 0.8.7)
77
- rdoc (~> 3.4)
78
- thor (~> 0.14.6)
79
- rake (0.9.2)
80
- rdoc (3.10)
122
+ thor (>= 0.18.1, < 2.0)
123
+ rake (10.4.2)
124
+ rdoc (4.2.0)
81
125
  json (~> 1.4)
82
- rspec (2.6.0)
83
- rspec-core (~> 2.6.0)
84
- rspec-expectations (~> 2.6.0)
85
- rspec-mocks (~> 2.6.0)
86
- rspec-core (2.6.4)
87
- rspec-expectations (2.6.0)
88
- diff-lcs (~> 1.1.2)
89
- rspec-mocks (2.6.0)
90
- sprockets (2.0.2)
126
+ rspec (3.2.0)
127
+ rspec-core (~> 3.2.0)
128
+ rspec-expectations (~> 3.2.0)
129
+ rspec-mocks (~> 3.2.0)
130
+ rspec-core (3.2.1)
131
+ rspec-support (~> 3.2.0)
132
+ rspec-expectations (3.2.0)
133
+ diff-lcs (>= 1.2.0, < 2.0)
134
+ rspec-support (~> 3.2.0)
135
+ rspec-mocks (3.2.1)
136
+ diff-lcs (>= 1.2.0, < 2.0)
137
+ rspec-support (~> 3.2.0)
138
+ rspec-support (3.2.2)
139
+ sprockets (2.12.3)
91
140
  hike (~> 1.2)
141
+ multi_json (~> 1.0)
92
142
  rack (~> 1.0)
93
143
  tilt (~> 1.1, != 1.3.0)
94
- thor (0.14.6)
95
- tilt (1.3.3)
96
- treetop (1.4.10)
97
- polyglot
98
- polyglot (>= 0.3.1)
99
- tzinfo (0.3.30)
100
- yard (0.7.2)
144
+ sprockets-rails (2.2.4)
145
+ actionpack (>= 3.0)
146
+ activesupport (>= 3.0)
147
+ sprockets (>= 2.8, < 4.0)
148
+ thor (0.19.1)
149
+ thread_safe (0.3.4)
150
+ tilt (1.4.1)
151
+ tzinfo (1.2.2)
152
+ thread_safe (~> 0.1)
153
+ yard (0.8.7.6)
101
154
 
102
155
  PLATFORMS
103
156
  ruby
@@ -33,9 +33,8 @@ add to Gemfile
33
33
  t.tsvector :tsv
34
34
  end
35
35
 
36
- add_gin_index :sample_headers, :tsv, :gin => true
37
- add_gin_index :sample_items, :tsv, :gin => true
38
- add_gist_index :sample_comments, :tsv, :gist => true
36
+ add_index :sample_headers, :tsv, using: :gin
37
+ add_index :sample_comments, :tsv, using: :gist
39
38
 
40
39
  === define index
41
40
 
@@ -90,19 +89,13 @@ add to Gemfile
90
89
 
91
90
  == Requirements
92
91
 
93
- * Rails 3 (http://github.com/rails/rails)
92
+ * Rails 4 (http://github.com/rails/rails)
94
93
  * PostgreSQL
95
94
 
96
-
97
- = Todo / Problem
98
-
99
- * Missing support for SchemaDumper (at the moment use config.active_record.schema_format = :sql)
100
-
101
95
  == Test environments
102
96
 
97
+ * ruby-2.1 (work)
103
98
  * ruby-1.9.2 (work)
104
- * ruby-1.8.7 (segfault in pg)
105
- * ree-1.8.7 (work)
106
99
 
107
100
  == Maintainers
108
101
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.6
1
+ 0.1.7
@@ -49,8 +49,8 @@ module PhatPgsearch
49
49
 
50
50
  def pgsearch_query(*args)
51
51
  options = args.extract_options!
52
- plain = options.delete(:plain)
53
- plain = true if plain.nil?
52
+ plain = options.delete(:plain) || true
53
+ match = options.delete(:matchall) == true ? " && " : " || "
54
54
  raise ArgumentError, "invalid field given" if args.first.nil? or not (args.first.is_a? String or args.first.is_a? Symbol)
55
55
  raise ArgumentError, "invalid query given" if args.second.nil? or not (args.second.is_a? String)
56
56
 
@@ -77,7 +77,12 @@ module PhatPgsearch
77
77
  catalog = options[:catalog] || definition.catalog
78
78
  end
79
79
 
80
- "#{plain ? 'plain' : ''}to_tsquery(#{self.sanitize(catalog)}, #{self.sanitize(args.second)})"
80
+ words = args.second.split(/ +/)
81
+ search_words = words.collect do |word|
82
+ "#{plain ? 'plain' : ''}to_tsquery(#{self.sanitize(catalog)}, #{self.sanitize(word)})"
83
+ end
84
+
85
+ "(#{search_words.join(match)})"
81
86
  end
82
87
 
83
88
  # rebuild complete index for model
@@ -5,23 +5,27 @@ module PhatPgsearch
5
5
 
6
6
  module SchemaDumper
7
7
  def self.included(base)
8
-
8
+
9
9
  end
10
10
 
11
11
  def indexes
12
-
13
-
12
+
13
+
14
14
  end
15
15
  end
16
16
 
17
17
  module SchemaStatements
18
18
 
19
+ # deprecated
20
+ # use: add_index :sample_headers, :tsv, using: :gin
19
21
  def add_gin_index(table_name, column_name, options = {})
20
22
  index_name = index_name(table_name, :column => column_name)
21
23
  index_name = options[:name].to_s if options.key?(:name)
22
24
  execute "CREATE INDEX #{quote_column_name(index_name)} ON #{quote_table_name(table_name)} USING gin(#{quote_column_name(column_name)})"
23
25
  end
24
26
 
27
+ # deprecated
28
+ # use: add_index :sample_headers, :tsv, using: :gist
25
29
  def add_gist_index(table_name, column_name, options = {})
26
30
  index_name = index_name(table_name, :column => column_name)
27
31
  index_name = options[:name].to_s if options.key?(:name)
@@ -31,7 +35,7 @@ module PhatPgsearch
31
35
 
32
36
  module PostgreSQLColumn
33
37
  def pgsearch_index(table)
34
-
38
+
35
39
  end
36
40
 
37
41
  def simplified_type(field_type)
@@ -2,14 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
+ # stub: phat_pgsearch 0.1.7 ruby lib
5
6
 
6
7
  Gem::Specification.new do |s|
7
8
  s.name = "phat_pgsearch"
8
- s.version = "0.1.6"
9
+ s.version = "0.1.7"
9
10
 
10
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
+ s.require_paths = ["lib"]
11
13
  s.authors = ["Marco Scholl"]
12
- s.date = "2011-10-12"
14
+ s.date = "2015-03-05"
13
15
  s.description = "a plugin for tssearch support from postgresql"
14
16
  s.email = "develop@marco-scholl.de"
15
17
  s.extra_rdoc_files = [
@@ -39,12 +41,11 @@ Gem::Specification.new do |s|
39
41
  ]
40
42
  s.homepage = "http://github.com/phatworx/phat_pgsearch"
41
43
  s.licenses = ["MIT"]
42
- s.require_paths = ["lib"]
43
- s.rubygems_version = "1.8.10"
44
+ s.rubygems_version = "2.4.3"
44
45
  s.summary = "a postgresql based search plugin"
45
46
 
46
47
  if s.respond_to? :specification_version then
47
- s.specification_version = 3
48
+ s.specification_version = 4
48
49
 
49
50
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
50
51
  s.add_runtime_dependency(%q<rails>, [">= 3.0.0"])
metadata CHANGED
@@ -1,93 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: phat_pgsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
5
- prerelease:
4
+ version: 0.1.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Marco Scholl
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2011-10-12 00:00:00.000000000Z
11
+ date: 2015-03-05 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
- requirement: &19520660 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - ">="
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.0.0
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *19520660
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 3.0.0
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: autotest
27
- requirement: &19519960 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - ">="
31
32
  - !ruby/object:Gem::Version
32
33
  version: '0'
33
34
  type: :development
34
35
  prerelease: false
35
- version_requirements: *19519960
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: bundler
38
- requirement: &19519320 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ! '>='
45
+ - - ">="
42
46
  - !ruby/object:Gem::Version
43
47
  version: '0'
44
48
  type: :development
45
49
  prerelease: false
46
- version_requirements: *19519320
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
47
55
  - !ruby/object:Gem::Dependency
48
56
  name: jeweler
49
- requirement: &19518700 !ruby/object:Gem::Requirement
50
- none: false
57
+ requirement: !ruby/object:Gem::Requirement
51
58
  requirements:
52
- - - ! '>='
59
+ - - ">="
53
60
  - !ruby/object:Gem::Version
54
61
  version: '0'
55
62
  type: :development
56
63
  prerelease: false
57
- version_requirements: *19518700
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
58
69
  - !ruby/object:Gem::Dependency
59
70
  name: rspec
60
- requirement: &19518100 !ruby/object:Gem::Requirement
61
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
62
72
  requirements:
63
- - - ! '>='
73
+ - - ">="
64
74
  - !ruby/object:Gem::Version
65
75
  version: '0'
66
76
  type: :development
67
77
  prerelease: false
68
- version_requirements: *19518100
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: yard
71
- requirement: &19517520 !ruby/object:Gem::Requirement
72
- none: false
85
+ requirement: !ruby/object:Gem::Requirement
73
86
  requirements:
74
- - - ! '>='
87
+ - - ">="
75
88
  - !ruby/object:Gem::Version
76
89
  version: '0'
77
90
  type: :development
78
91
  prerelease: false
79
- version_requirements: *19517520
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
80
97
  - !ruby/object:Gem::Dependency
81
98
  name: pg
82
- requirement: &19517040 !ruby/object:Gem::Requirement
83
- none: false
99
+ requirement: !ruby/object:Gem::Requirement
84
100
  requirements:
85
- - - ! '>='
101
+ - - ">="
86
102
  - !ruby/object:Gem::Version
87
103
  version: '0'
88
104
  type: :development
89
105
  prerelease: false
90
- version_requirements: *19517040
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
91
111
  description: a plugin for tssearch support from postgresql
92
112
  email: develop@marco-scholl.de
93
113
  executables: []
@@ -96,8 +116,8 @@ extra_rdoc_files:
96
116
  - LICENSE.txt
97
117
  - README.rdoc
98
118
  files:
99
- - .document
100
- - .rspec
119
+ - ".document"
120
+ - ".rspec"
101
121
  - Gemfile
102
122
  - Gemfile.lock
103
123
  - LICENSE.txt
@@ -118,29 +138,25 @@ files:
118
138
  homepage: http://github.com/phatworx/phat_pgsearch
119
139
  licenses:
120
140
  - MIT
141
+ metadata: {}
121
142
  post_install_message:
122
143
  rdoc_options: []
123
144
  require_paths:
124
145
  - lib
125
146
  required_ruby_version: !ruby/object:Gem::Requirement
126
- none: false
127
147
  requirements:
128
- - - ! '>='
148
+ - - ">="
129
149
  - !ruby/object:Gem::Version
130
150
  version: '0'
131
- segments:
132
- - 0
133
- hash: -3742980550671848031
134
151
  required_rubygems_version: !ruby/object:Gem::Requirement
135
- none: false
136
152
  requirements:
137
- - - ! '>='
153
+ - - ">="
138
154
  - !ruby/object:Gem::Version
139
155
  version: '0'
140
156
  requirements: []
141
157
  rubyforge_project:
142
- rubygems_version: 1.8.10
158
+ rubygems_version: 2.4.3
143
159
  signing_key:
144
- specification_version: 3
160
+ specification_version: 4
145
161
  summary: a postgresql based search plugin
146
162
  test_files: []