minidusen 0.11.2 → 1.0.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: 4f32ad9fa29bb04c20b375672101586a333419a6e7ba63dca31de338a6160240
4
- data.tar.gz: e6e3262a32e39a889a942eafe2babbdd097acf40b79577f442b5539b920cd1ea
3
+ metadata.gz: 66b0584b719725f8f625cb93bab425665cb474c609a1a5c229954f7211541d21
4
+ data.tar.gz: da214c18bb9ae43e795d224a9561e4a08ae6be2acdc5cfddf0a4e3231aab9bc9
5
5
  SHA512:
6
- metadata.gz: 95ff0a7700fa447a36e36d45844d6f37ae7a5cab44b7782055eb28d9ae06981c21d0236d6199f727787230b14233f10942315333eb9eba945fb6ea5d1945224c
7
- data.tar.gz: 506d7606d35b9c139091433834c9f1116997f836440e953c8c9f8ce26be29b33aff71bb15fc8a78879dbfed48489d8eca19dd44699d708486c82b5105d3e2b7b
6
+ metadata.gz: ea259513910c5691dc6fd7e332b3aa30479ce7dd4c9080e88ef14b6277fd33516cd4698361a600036aa9f1e587da6fd774f8a8097a7fc108b29b78e9235a481a
7
+ data.tar.gz: e827389410f4730a7af91ed7caf71731baa2ddc323ee9e31e65da43bdd55857b15a85d06afd1aa4a1376730f3390d5f9dd03d4d3a296a6411a0996fd819f7719
@@ -1,108 +1,107 @@
1
1
  ---
2
2
  name: Tests
3
- 'on':
3
+
4
+ on:
4
5
  push:
5
6
  branches:
6
7
  - main
7
8
  pull_request:
8
9
  branches:
9
10
  - main
11
+
10
12
  jobs:
11
13
  test_mysql:
12
- runs-on: ubuntu-20.04
14
+ runs-on: ubuntu-24.04
15
+
13
16
  services:
14
17
  mysql:
15
- image: mysql:5.6
18
+ image: mysql:5.7
16
19
  env:
17
20
  MYSQL_ROOT_PASSWORD: password
18
- options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout
19
- 5s --health-retries 5
21
+ options: >-
22
+ --health-cmd="mysqladmin ping"
23
+ --health-interval=10s
24
+ --health-timeout=5s
25
+ --health-retries=5
20
26
  ports:
21
27
  - 3306:3306
28
+
22
29
  strategy:
23
30
  fail-fast: false
24
31
  matrix:
25
32
  include:
26
- - ruby: 2.5.8
27
- gemfile: Gemfile.4.2.mysql2
28
- - ruby: 2.5.8
29
- gemfile: Gemfile.5.2.mysql2
30
- - ruby: 2.5.8
31
- gemfile: Gemfile.6.0.mysql2
32
- - ruby: 2.5.8
33
+ - ruby: 2.7.8
33
34
  gemfile: Gemfile.6.1.mysql2
34
- - ruby: 3.2.0
35
+ - ruby: 3.2.3
35
36
  gemfile: Gemfile.6.1.mysql2
36
- - ruby: 3.2.0
37
+ - ruby: 3.2.3
37
38
  gemfile: Gemfile.7.0.mysql2
38
- - ruby: 3.2.0
39
+ - ruby: 3.2.3
39
40
  gemfile: Gemfile.7.1.mysql2
40
- - ruby: 3.2.0
41
+ - ruby: 3.3.4
41
42
  gemfile: Gemfile.7.2.mysql2
43
+ - ruby: 3.3.4
44
+ gemfile: Gemfile.8.0.mysql2
45
+
42
46
  env:
43
- BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
47
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
48
+
44
49
  steps:
45
- - uses: actions/checkout@v2
50
+ - uses: actions/checkout@v3
46
51
  - name: Install ruby
47
52
  uses: ruby/setup-ruby@v1
48
53
  with:
49
- ruby-version: "${{ matrix.ruby }}"
54
+ ruby-version: ${{ matrix.ruby }}
55
+ bundler-cache: true
50
56
  - name: Setup database
51
57
  run: |
52
- mysql -e 'create database IF NOT EXISTS test;' -u root --password=password -P 3306 -h 127.0.0.1
53
- - name: Bundle
54
- run: |
55
- gem install bundler:1.17.3
56
- bundle install --no-deployment
58
+ mysql -e 'create database IF NOT EXISTS minidusen_test;' -u root --password=password -P 3306 -h 127.0.0.1
57
59
  - name: Run tests
58
60
  run: bundle exec rspec
61
+
59
62
  test_pg:
60
- runs-on: ubuntu-20.04
63
+ runs-on: ubuntu-24.04
64
+
61
65
  services:
62
66
  postgres:
63
67
  image: postgres
64
68
  env:
65
69
  POSTGRES_PASSWORD: postgres
66
- options: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s
67
- --health-retries 5"
70
+ POSTGRES_DB: minidusen_test
71
+ options: >-
72
+ --health-cmd pg_isready
73
+ --health-interval 10s
74
+ --health-timeout 5s
75
+ --health-retries 5
68
76
  ports:
69
77
  - 5432:5432
78
+
70
79
  strategy:
71
80
  fail-fast: false
72
81
  matrix:
73
82
  include:
74
- - ruby: 2.5.8
75
- gemfile: Gemfile.4.2.pg
76
- - ruby: 2.5.8
77
- gemfile: Gemfile.5.2.pg
78
- - ruby: 2.5.8
79
- gemfile: Gemfile.6.0.pg
80
- - ruby: 2.5.8
83
+ - ruby: 2.7.8
81
84
  gemfile: Gemfile.6.1.pg
82
- - ruby: 3.2.0
85
+ - ruby: 3.2.3
83
86
  gemfile: Gemfile.6.1.pg
84
- - ruby: 3.2.0
87
+ - ruby: 3.2.3
85
88
  gemfile: Gemfile.7.0.pg
86
- - ruby: 3.2.0
89
+ - ruby: 3.2.3
87
90
  gemfile: Gemfile.7.1.pg
88
- - ruby: 3.2.0
91
+ - ruby: 3.3.4
89
92
  gemfile: Gemfile.7.2.pg
93
+ - ruby: 3.3.4
94
+ gemfile: Gemfile.8.0.pg
95
+
90
96
  env:
91
- BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
97
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
98
+
92
99
  steps:
93
- - uses: actions/checkout@v2
100
+ - uses: actions/checkout@v3
94
101
  - name: Install ruby
95
102
  uses: ruby/setup-ruby@v1
96
103
  with:
97
- ruby-version: "${{ matrix.ruby }}"
98
- - name: Setup database
99
- run: |
100
- sudo apt-get update
101
- sudo apt-get install -y postgresql-client
102
- PGPASSWORD=postgres psql -c 'create database test;' -U postgres -p 5432 -h localhost
103
- - name: Bundle
104
- run: |
105
- gem install bundler:1.17.3
106
- bundle install --no-deployment
104
+ ruby-version: ${{ matrix.ruby }}
105
+ bundler-cache: true
107
106
  - name: Run tests
108
107
  run: bundle exec rspec
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.2.0
1
+ 3.2.3
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minidusen (0.11.2)
4
+ minidusen (1.0.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -29,7 +29,7 @@ GEM
29
29
  database_cleaner-core (~> 2.0.0)
30
30
  database_cleaner-core (2.0.1)
31
31
  diff-lcs (1.4.4)
32
- edge_rider (2.1.1)
32
+ edge_rider (2.4.0)
33
33
  activerecord (>= 3.2)
34
34
  gemika (0.8.1)
35
35
  i18n (1.8.9)
data/Gemfile.6.1.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minidusen (0.11.2)
4
+ minidusen (1.0.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -29,7 +29,7 @@ GEM
29
29
  database_cleaner-core (~> 2.0.0)
30
30
  database_cleaner-core (2.0.1)
31
31
  diff-lcs (1.4.4)
32
- edge_rider (2.1.1)
32
+ edge_rider (2.4.0)
33
33
  activerecord (>= 3.2)
34
34
  gemika (0.8.1)
35
35
  i18n (1.8.9)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minidusen (0.11.2)
4
+ minidusen (1.0.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -28,7 +28,7 @@ GEM
28
28
  database_cleaner-core (~> 2.0.0)
29
29
  database_cleaner-core (2.0.1)
30
30
  diff-lcs (1.5.0)
31
- edge_rider (2.1.1)
31
+ edge_rider (2.4.0)
32
32
  activerecord (>= 3.2)
33
33
  gemika (0.8.1)
34
34
  i18n (1.8.11)
data/Gemfile.7.0.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minidusen (0.11.2)
4
+ minidusen (1.0.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -28,7 +28,7 @@ GEM
28
28
  database_cleaner-core (~> 2.0.0)
29
29
  database_cleaner-core (2.0.1)
30
30
  diff-lcs (1.5.0)
31
- edge_rider (2.1.1)
31
+ edge_rider (2.4.0)
32
32
  activerecord (>= 3.2)
33
33
  gemika (0.8.1)
34
34
  i18n (1.8.11)
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minidusen (0.11.2)
4
+ minidusen (1.0.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -65,7 +65,6 @@ GEM
65
65
  concurrent-ruby (~> 1.0)
66
66
 
67
67
  PLATFORMS
68
- ruby
69
68
  x86_64-linux
70
69
 
71
70
  DEPENDENCIES
data/Gemfile.7.1.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minidusen (0.11.2)
4
+ minidusen (1.0.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -65,7 +65,6 @@ GEM
65
65
  concurrent-ruby (~> 1.0)
66
66
 
67
67
  PLATFORMS
68
- ruby
69
68
  x86_64-linux
70
69
 
71
70
  DEPENDENCIES
@@ -67,7 +67,6 @@ GEM
67
67
  concurrent-ruby (~> 1.0)
68
68
 
69
69
  PLATFORMS
70
- ruby
71
70
  x86_64-linux
72
71
 
73
72
  DEPENDENCIES
data/Gemfile.7.2.pg.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- minidusen (0.11.2)
4
+ minidusen (1.0.0)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -67,7 +67,6 @@ GEM
67
67
  concurrent-ruby (~> 1.0)
68
68
 
69
69
  PLATFORMS
70
- ruby
71
70
  x86_64-linux
72
71
 
73
72
  DEPENDENCIES
@@ -1,8 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Runtime dependencies
4
- gem 'activerecord', '~>6.0.0'
5
- gem 'mysql2', '~>0.4.4'
4
+ gem 'activerecord', '~>8.0.1'
5
+ gem 'mysql2', '~>0.5'
6
6
 
7
7
  # Development dependencies
8
8
  gem 'rake'
@@ -0,0 +1,87 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minidusen (0.11.2)
5
+ activerecord (>= 3.2)
6
+ activesupport (>= 3.2)
7
+ edge_rider (>= 0.2.5)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activemodel (8.0.1)
13
+ activesupport (= 8.0.1)
14
+ activerecord (8.0.1)
15
+ activemodel (= 8.0.1)
16
+ activesupport (= 8.0.1)
17
+ timeout (>= 0.4.0)
18
+ activesupport (8.0.1)
19
+ base64
20
+ benchmark (>= 0.3)
21
+ bigdecimal
22
+ concurrent-ruby (~> 1.0, >= 1.3.1)
23
+ connection_pool (>= 2.2.5)
24
+ drb
25
+ i18n (>= 1.6, < 2)
26
+ logger (>= 1.4.2)
27
+ minitest (>= 5.1)
28
+ securerandom (>= 0.3)
29
+ tzinfo (~> 2.0, >= 2.0.5)
30
+ uri (>= 0.13.1)
31
+ base64 (0.2.0)
32
+ benchmark (0.4.0)
33
+ bigdecimal (3.1.8)
34
+ byebug (11.1.3)
35
+ concurrent-ruby (1.3.4)
36
+ connection_pool (2.4.1)
37
+ database_cleaner (2.0.2)
38
+ database_cleaner-active_record (>= 2, < 3)
39
+ database_cleaner-active_record (2.2.0)
40
+ activerecord (>= 5.a)
41
+ database_cleaner-core (~> 2.0.0)
42
+ database_cleaner-core (2.0.1)
43
+ diff-lcs (1.5.1)
44
+ drb (2.2.1)
45
+ edge_rider (2.3.0)
46
+ activerecord (>= 3.2)
47
+ gemika (0.8.3)
48
+ i18n (1.14.5)
49
+ concurrent-ruby (~> 1.0)
50
+ logger (1.6.1)
51
+ minitest (5.25.1)
52
+ mysql2 (0.5.6)
53
+ rake (13.2.1)
54
+ rspec (3.13.0)
55
+ rspec-core (~> 3.13.0)
56
+ rspec-expectations (~> 3.13.0)
57
+ rspec-mocks (~> 3.13.0)
58
+ rspec-core (3.13.1)
59
+ rspec-support (~> 3.13.0)
60
+ rspec-expectations (3.13.2)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.13.0)
63
+ rspec-mocks (3.13.1)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-support (3.13.1)
67
+ securerandom (0.3.1)
68
+ timeout (0.4.3)
69
+ tzinfo (2.0.6)
70
+ concurrent-ruby (~> 1.0)
71
+ uri (1.0.2)
72
+
73
+ PLATFORMS
74
+ x86_64-linux
75
+
76
+ DEPENDENCIES
77
+ activerecord (~> 8.0.1)
78
+ byebug
79
+ database_cleaner
80
+ gemika
81
+ minidusen!
82
+ mysql2 (~> 0.5)
83
+ rake
84
+ rspec (~> 3.5)
85
+
86
+ BUNDLED WITH
87
+ 2.5.6
@@ -1,8 +1,8 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Runtime dependencies
4
- gem 'activerecord', '~>6.0.0'
5
- gem 'pg', '~>0.18.4'
4
+ gem 'activerecord', '~>8.0.1'
5
+ gem 'pg', '~> 1.4.0'
6
6
 
7
7
  # Development dependencies
8
8
  gem 'rake'
@@ -0,0 +1,87 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minidusen (0.11.2)
5
+ activerecord (>= 3.2)
6
+ activesupport (>= 3.2)
7
+ edge_rider (>= 0.2.5)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ activemodel (8.0.1)
13
+ activesupport (= 8.0.1)
14
+ activerecord (8.0.1)
15
+ activemodel (= 8.0.1)
16
+ activesupport (= 8.0.1)
17
+ timeout (>= 0.4.0)
18
+ activesupport (8.0.1)
19
+ base64
20
+ benchmark (>= 0.3)
21
+ bigdecimal
22
+ concurrent-ruby (~> 1.0, >= 1.3.1)
23
+ connection_pool (>= 2.2.5)
24
+ drb
25
+ i18n (>= 1.6, < 2)
26
+ logger (>= 1.4.2)
27
+ minitest (>= 5.1)
28
+ securerandom (>= 0.3)
29
+ tzinfo (~> 2.0, >= 2.0.5)
30
+ uri (>= 0.13.1)
31
+ base64 (0.2.0)
32
+ benchmark (0.4.0)
33
+ bigdecimal (3.1.8)
34
+ byebug (11.1.3)
35
+ concurrent-ruby (1.3.4)
36
+ connection_pool (2.4.1)
37
+ database_cleaner (2.0.2)
38
+ database_cleaner-active_record (>= 2, < 3)
39
+ database_cleaner-active_record (2.2.0)
40
+ activerecord (>= 5.a)
41
+ database_cleaner-core (~> 2.0.0)
42
+ database_cleaner-core (2.0.1)
43
+ diff-lcs (1.5.1)
44
+ drb (2.2.1)
45
+ edge_rider (2.3.0)
46
+ activerecord (>= 3.2)
47
+ gemika (0.8.3)
48
+ i18n (1.14.5)
49
+ concurrent-ruby (~> 1.0)
50
+ logger (1.6.1)
51
+ minitest (5.25.1)
52
+ pg (1.4.6)
53
+ rake (13.2.1)
54
+ rspec (3.13.0)
55
+ rspec-core (~> 3.13.0)
56
+ rspec-expectations (~> 3.13.0)
57
+ rspec-mocks (~> 3.13.0)
58
+ rspec-core (3.13.1)
59
+ rspec-support (~> 3.13.0)
60
+ rspec-expectations (3.13.2)
61
+ diff-lcs (>= 1.2.0, < 2.0)
62
+ rspec-support (~> 3.13.0)
63
+ rspec-mocks (3.13.1)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.13.0)
66
+ rspec-support (3.13.1)
67
+ securerandom (0.3.1)
68
+ timeout (0.4.3)
69
+ tzinfo (2.0.6)
70
+ concurrent-ruby (~> 1.0)
71
+ uri (1.0.2)
72
+
73
+ PLATFORMS
74
+ ruby
75
+
76
+ DEPENDENCIES
77
+ activerecord (~> 8.0.1)
78
+ byebug
79
+ database_cleaner
80
+ gemika
81
+ minidusen!
82
+ pg (~> 1.4.0)
83
+ rake
84
+ rspec (~> 3.5)
85
+
86
+ BUNDLED WITH
87
+ 2.5.6
data/README.md CHANGED
@@ -1,5 +1,20 @@
1
- Minidusen [![Tests](https://github.com/makandra/minidusen/workflows/Tests/badge.svg)](https://github.com/makandra/minidusen/actions)
2
- =========
1
+ <p>
2
+ <a href="https://makandra.de/">
3
+ <picture>
4
+ <source media="(prefers-color-scheme: light)" srcset="media/makandra-with-bottom-margin.light.svg">
5
+ <source media="(prefers-color-scheme: dark)" srcset="media/makandra-with-bottom-margin.dark.svg">
6
+ <img align="right" width="25%" alt="makandra" src="media/makandra-with-bottom-margin.light.svg">
7
+ </picture>
8
+ </a>
9
+
10
+ <picture>
11
+ <source media="(prefers-color-scheme: light)" srcset="media/logo.light.shapes.svg">
12
+ <source media="(prefers-color-scheme: dark)" srcset="media/logo.dark.shapes.svg">
13
+ <img width="210" alt="Minidusen" role="heading" aria-level="1" src="media/logo.light.shapes.svg">
14
+ </picture>
15
+ </p>
16
+
17
+ [![Tests](https://github.com/makandra/minidusen/workflows/Tests/badge.svg)](https://github.com/makandra/minidusen/actions)
3
18
 
4
19
  Low-tech search solution for ActiveRecord with MySQL or PostgreSQL
5
20
  ------------------------------------------------------------------
@@ -219,9 +234,6 @@ Supported Rails versions
219
234
 
220
235
  Minidusen is tested on:
221
236
 
222
- - Rails 4.2
223
- - Rails 5.2
224
- - Rails 6.0
225
237
  - Rails 6.1
226
238
  - Rails 7.0
227
239
  - Rails 7.1
@@ -42,9 +42,10 @@ module Minidusen
42
42
 
43
43
  def extract_text_query_tokens(query_string, query)
44
44
  while query_string.sub!(TEXT_QUERY, '')
45
+ phrase = !$2.nil?
45
46
  value = "#{$2}#{$4}"
46
47
  exclude = "#{$1}#{$3}" == "-"
47
- options = { :field => 'text', :value => value, :exclude => exclude }
48
+ options = { :field => 'text', :value => value, :exclude => exclude, :phrase => phrase }
48
49
  query << Token.new(options)
49
50
  end
50
51
  end
@@ -52,9 +53,10 @@ module Minidusen
52
53
  def extract_field_query_tokens(query_string, query)
53
54
  while query_string.sub!(FIELD_QUERY, '')
54
55
  field = $2
56
+ phrase = !$4.nil?
55
57
  value = "#{$4}#{$6}"
56
58
  exclude = "#{$1}" == "-"
57
- options = { :field => field, :value => value, :exclude => exclude }
59
+ options = { :field => field, :value => value, :exclude => exclude, :phrase => phrase }
58
60
  query << Token.new(options)
59
61
  end
60
62
  end
@@ -7,6 +7,7 @@ module Minidusen
7
7
  @value = options.fetch(:value)
8
8
  @exclude = options.fetch(:exclude, false)
9
9
  @field = options.fetch(:field).to_s
10
+ @phrase = options.fetch(:phrase, false)
10
11
  end
11
12
 
12
13
  def to_s
@@ -21,5 +22,9 @@ module Minidusen
21
22
  exclude
22
23
  end
23
24
 
25
+ def phrase?
26
+ @phrase
27
+ end
28
+
24
29
  end
25
30
  end
@@ -1,3 +1,3 @@
1
1
  module Minidusen
2
- VERSION = '0.11.2'
2
+ VERSION = '1.0.0'
3
3
  end