autosuggest 0.3.0 → 0.4.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
  SHA256:
3
- metadata.gz: 0cd2e072b09ebaecd6858e27f87b198e0909c8d70c0f36250c6eefc022600e59
4
- data.tar.gz: '02434900d6a69b6c18ad2d5353c7359681f442fbe19a28f1aacfdac3c60dfe42'
3
+ metadata.gz: 380bee30bc6228daaeb97b24894e2332a0daad91a3f2dfbf6ba04dbca47b794e
4
+ data.tar.gz: 3df1265dbb5b67b234f023a5595d636d4cd3a244496a467f1b1819c2b9c693f0
5
5
  SHA512:
6
- metadata.gz: 22ed0ecf00dae3f077cbd2be2cd024e61f6ceb6cdefca57af9a90d1769499e51c1df301ee37bfbd2344ef69afd6b9da3582aa21714b1b3d5061749eb0d9b190d
7
- data.tar.gz: d8b757d31b2c2b9429afc29758f6d70631e9402593dbc127728c47f5553edb2ec04b9007dc79257820a500f0105f93d72254decd1cde3b2123990752f255600e
6
+ metadata.gz: cd036013fd6ee96dcc935c8ca5551b8c8424af5cb7c7f704617a102798bdb020f30206230876b60843ca31b9395820743b29b6c78438050ed7b69f2dd2eb68a1
7
+ data.tar.gz: 5e66bcba5ad4df678274336f53cc81063117d86a571f252bca8754b28970455de088d775fbc5e493c8910f1f47fb82fd5457c114eefe8359090771b77adc6552
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.4.0 (2025-10-26)
2
+
3
+ - Switched to keyword arguments for `parse_words` method
4
+ - Dropped support for Ruby < 3.2
5
+
1
6
  ## 0.3.0 (2024-05-22)
2
7
 
3
8
  - Switched to Mittens for stemming
data/LICENSE.txt CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2015-2024 Andrew Kane
1
+ Copyright (c) 2015-2025 Andrew Kane
2
2
 
3
3
  MIT License
4
4
 
data/README.md CHANGED
@@ -65,7 +65,7 @@ autosuggest.not_duplicates [["straws", "straus"]]
65
65
 
66
66
  #### Filter misspellings
67
67
 
68
- We tried open-source libraries like [Aspell](http://aspell.net) and [Hunspell](http://hunspell.sourceforge.net/) but quickly realized we needed to build a corpus specific to our application.
68
+ We tried open-source libraries like [Aspell](http://aspell.net) and [Hunspell](https://github.com/hunspell/hunspell) but quickly realized we needed to build a corpus specific to our application.
69
69
 
70
70
  There are two ways to build the corpus, which can be used together.
71
71
 
@@ -121,7 +121,7 @@ Autosuggest::Suggestion.transaction do
121
121
  end
122
122
  ```
123
123
 
124
- Leave out `unique_by` for MySQL, and use [activerecord-import](https://github.com/zdennis/activerecord-import) for upserts with Rails < 6.
124
+ Leave out `unique_by` for MySQL.
125
125
 
126
126
  #### Show suggestions
127
127
 
@@ -199,16 +199,6 @@ Autosuggest::Suggestion.transaction do
199
199
  end
200
200
  ```
201
201
 
202
- ## Upgrading
203
-
204
- ### 0.2.0
205
-
206
- Suggestions are now filtered by default, and only the query and score are returned. Get all queries and fields with:
207
-
208
- ```ruby
209
- autosuggest.suggestions(filter: false)
210
- ```
211
-
212
202
  ## History
213
203
 
214
204
  View the [changelog](https://github.com/ankane/autosuggest/blob/master/CHANGELOG.md)
@@ -24,9 +24,7 @@ module Autosuggest
24
24
  @concepts[name] = Set.new(values.map(&:downcase))
25
25
  end
26
26
 
27
- def parse_words(phrases, options = {})
28
- min = options[:min] || 1
29
-
27
+ def parse_words(phrases, min: 1)
30
28
  word_counts = Hash.new(0)
31
29
  phrases.each do |phrase|
32
30
  words = tokenize(phrase)
@@ -1,3 +1,3 @@
1
1
  module Autosuggest
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -22,11 +22,7 @@ module Autosuggest
22
22
  # use connection_config instead of connection.adapter
23
23
  # so database connection isn't needed
24
24
  def adapter
25
- if ActiveRecord::VERSION::STRING.to_f >= 6.1
26
- ActiveRecord::Base.connection_db_config.adapter.to_s
27
- else
28
- ActiveRecord::Base.connection_config[:adapter].to_s
29
- end
25
+ ActiveRecord::Base.connection_db_config.adapter.to_s
30
26
  end
31
27
  end
32
28
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autosuggest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-05-23 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: mittens
@@ -38,7 +37,6 @@ dependencies:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
39
  version: '0'
41
- description:
42
40
  email: andrew@ankane.org
43
41
  executables: []
44
42
  extensions: []
@@ -57,7 +55,6 @@ homepage: https://github.com/ankane/autosuggest
57
55
  licenses:
58
56
  - MIT
59
57
  metadata: {}
60
- post_install_message:
61
58
  rdoc_options: []
62
59
  require_paths:
63
60
  - lib
@@ -65,15 +62,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
62
  requirements:
66
63
  - - ">="
67
64
  - !ruby/object:Gem::Version
68
- version: '3.1'
65
+ version: '3.2'
69
66
  required_rubygems_version: !ruby/object:Gem::Requirement
70
67
  requirements:
71
68
  - - ">="
72
69
  - !ruby/object:Gem::Version
73
70
  version: '0'
74
71
  requirements: []
75
- rubygems_version: 3.5.9
76
- signing_key:
72
+ rubygems_version: 3.6.9
77
73
  specification_version: 4
78
74
  summary: Generate autocomplete suggestions based on what your users search
79
75
  test_files: []