textacular 5.0.1 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cd8a6ebc9cec369bbf3fea444970d281234f2805
4
- data.tar.gz: ce91d4843d41ecf94ddc8dd1029ed9228d38b240
3
+ metadata.gz: 3bd98a4fec2d72714909b49059a7f8b50298d734
4
+ data.tar.gz: 9b3fc608d5192296392da8323048c65440146cbd
5
5
  SHA512:
6
- metadata.gz: 318a0c57177384cf44d0080106a38b8e460b92b545ca98ccc3855964fb2d0a4dd7f9b2727f9b18b0285f6f6301f0fe35e506d0f9aa300e79e0c2b81cf0a75c83
7
- data.tar.gz: 70a5011bcd8d2de558749b8d7a57f666db3c2fb90d6929a7f26cda05f1d241ff7752c356a75bc90063353b48720d7306b5e5602c6c3d6542d1b620e8deae0603
6
+ metadata.gz: 7e1cd1fdce05d21df1e9803ca0bd1db66fc18ba371a4980175824ad5c46df5eb1e4cfd1aed857e5cea384887734f7f563ce498cc860c8c8827873f669a9ca584
7
+ data.tar.gz: 6237664f59c95a81b48283b3f761289a8c63199c908fba347e3931be9f93c59f5be897c971434266a7d1a203dfc3aa11af217736ca2e3313cea180c73c0d16c3
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 5.1.0
6
+
7
+ * ActiveRecord 5.2 compatibility by wrapping string queries with `Arel.sql()`
8
+ * Adds latest Ruby, Rails and Postgres-dependencies to Travis.
9
+ * Rewrite development migration code to support Rails 5.0-5.2.
10
+
5
11
  ## 5.0.0
6
12
 
7
13
  * ActiveRecord 5.1 compatibility
data/Gemfile CHANGED
@@ -1,3 +1,5 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  gemspec
4
+
5
+ gem 'activerecord', '~> 5.2.x'
data/Rakefile CHANGED
@@ -43,12 +43,22 @@ namespace :db do
43
43
 
44
44
  desc 'Run the test database migrations'
45
45
  task :up => :'db:connect' do
46
- ActiveRecord::Migrator.up 'db/migrate'
46
+ migrations = if ActiveRecord.version.version >= '5.2'
47
+ ActiveRecord::Migration.new.migration_context.migrations
48
+ else
49
+ ActiveRecord::Migrator.migrations('db/migrate')
50
+ end
51
+ ActiveRecord::Migrator.new(:up, migrations, nil).migrate
47
52
  end
48
53
 
49
54
  desc 'Reverse the test database migrations'
50
55
  task :down => :'db:connect' do
51
- ActiveRecord::Migrator.down 'db/migrate'
56
+ migrations = if ActiveRecord.version.version >= '5.2'
57
+ ActiveRecord::Migration.new.migration_context.migrations
58
+ else
59
+ ActiveRecord::Migrator.migrations('db/migrate')
60
+ end
61
+ ActiveRecord::Migrator.new(:down, migrations, nil).migrate
52
62
  end
53
63
  end
54
64
  task :migrate => :'migrate:up'
@@ -123,9 +123,9 @@ module Textacular
123
123
  def assemble_query(similarities, conditions, exclusive)
124
124
  rank = connection.quote_column_name('rank' + rand(100000000000000000).to_s)
125
125
 
126
- select("#{quoted_table_name + '.*,' if select_values.empty?} #{similarities.join(" + ")} AS #{rank}").
126
+ select(Arel.sql("#{quoted_table_name + '.*,' if select_values.empty?} #{similarities.join(" + ")} AS #{rank}")).
127
127
  where(conditions.join(exclusive ? " AND " : " OR ")).
128
- order("#{rank} DESC")
128
+ order(Arel.sql("#{rank} DESC"))
129
129
  end
130
130
 
131
131
  def select_values
@@ -151,7 +151,7 @@ module Textacular
151
151
  module Helper
152
152
  class << self
153
153
  def normalize(query)
154
- query.to_s.gsub(/\s(?![\&|\!|\|])/, '\\\\ ')
154
+ query.to_s.gsub(/\s(?![\&\!\|])/, '\\\\ ')
155
155
  end
156
156
  end
157
157
  end
@@ -4,6 +4,7 @@ class Textacular::MigrationGenerator
4
4
  def initialize(filename, content)
5
5
  @filename = filename
6
6
  @content = content
7
+ @output_stream = nil
7
8
  end
8
9
 
9
10
  def generate_migration
@@ -1,5 +1,5 @@
1
1
  module Textacular
2
- VERSION = '5.0.1'
2
+ VERSION = '5.1.0'
3
3
 
4
4
  def self.version
5
5
  VERSION
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textacular
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.1
4
+ version: 5.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Hamill
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2017-06-12 00:00:00.000000000 Z
14
+ date: 2018-05-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: pg
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - "~>"
21
21
  - !ruby/object:Gem::Version
22
- version: '0.14'
22
+ version: 1.0.0
23
23
  type: :development
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - "~>"
28
28
  - !ruby/object:Gem::Version
29
- version: '0.14'
29
+ version: 1.0.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: rspec
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -103,20 +103,20 @@ dependencies:
103
103
  requirements:
104
104
  - - ">="
105
105
  - !ruby/object:Gem::Version
106
- version: '3.0'
106
+ version: '5.0'
107
107
  - - "<"
108
108
  - !ruby/object:Gem::Version
109
- version: '5.2'
109
+ version: '6.0'
110
110
  type: :runtime
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - ">="
115
115
  - !ruby/object:Gem::Version
116
- version: '3.0'
116
+ version: '5.0'
117
117
  - - "<"
118
118
  - !ruby/object:Gem::Version
119
- version: '5.2'
119
+ version: '6.0'
120
120
  description: |-
121
121
  Textacular exposes full text search capabilities from PostgreSQL, extending
122
122
  ActiveRecord with scopes making search easy and fun!
@@ -181,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
181
  version: '0'
182
182
  requirements: []
183
183
  rubyforge_project:
184
- rubygems_version: 2.4.5
184
+ rubygems_version: 2.6.8
185
185
  signing_key:
186
186
  specification_version: 4
187
187
  summary: Textacular exposes full text search capabilities from PostgreSQL