minidusen 0.8.1 → 0.10

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
- SHA1:
3
- metadata.gz: 53ae4e4778bb465b76e102597bcde71ea9a0db5a
4
- data.tar.gz: f2edf0821b4675e6be42805345e1cff779a42e43
2
+ SHA256:
3
+ metadata.gz: ae10acf35f7691ee887031d0dcccc455925315768b876a7eea142b4c84bc423b
4
+ data.tar.gz: '061389e69fadb5cc996ca2e35ccf891c9bc31a8abb70296e05f11d9a4cb0a428'
5
5
  SHA512:
6
- metadata.gz: dd3747985637690f5ee1f6504518c7e4a79a32c31ed9d5e99c54e0354c38b6e672b517ac518a0042308dbee49b08740c0b2517fecc32142ca61b8f6bf457c734
7
- data.tar.gz: 72a9c8759ba4379793959ebd83dcd694076a146e81a4d0d95ff7635e3f0a6cff789381040f68b3b20267ea0dd7457ca709b0f334ebcf5c4c6173de6594dba42a
6
+ metadata.gz: 5e9f51c132887a664558f78deac9c029395bc7f4078bbba3c3f714fef4ce073963febeab68335235b18a0b97ea0ed39af33b539c9cbaf6dc2ebe2a57adea2b66
7
+ data.tar.gz: d9451548713b09f93cf80e97b9cfaa47b519b3763cf1c0442e48a289cef85a81b43f5a7808083abe96577b87f6b4f6740a5b8729b658d812856c43f5e27bd8ea
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: Tests
3
+ 'on':
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+ jobs:
11
+ test_mysql:
12
+ runs-on: ubuntu-20.04
13
+ services:
14
+ mysql:
15
+ image: mysql:5.6
16
+ env:
17
+ MYSQL_ROOT_PASSWORD: password
18
+ options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout
19
+ 5s --health-retries 5
20
+ ports:
21
+ - 3306:3306
22
+ strategy:
23
+ fail-fast: false
24
+ matrix:
25
+ 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
+ gemfile: Gemfile.6.1.mysql2
34
+ - ruby: 3.0.0
35
+ gemfile: Gemfile.6.1.mysql2
36
+ env:
37
+ BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
38
+ steps:
39
+ - uses: actions/checkout@v2
40
+ - name: Install ruby
41
+ uses: ruby/setup-ruby@v1
42
+ with:
43
+ ruby-version: "${{ matrix.ruby }}"
44
+ - name: Setup database
45
+ run: |
46
+ sudo apt-get install -y mysql-client libmariadbclient-dev
47
+ mysql -e 'create database IF NOT EXISTS test;' -u root --password=password -P 3306 -h 127.0.0.1
48
+ - name: Bundle
49
+ run: |
50
+ gem install bundler:1.17.3
51
+ bundle install --no-deployment
52
+ - name: Run tests
53
+ run: bundle exec rspec
54
+ test_pg:
55
+ runs-on: ubuntu-20.04
56
+ services:
57
+ postgres:
58
+ image: postgres
59
+ env:
60
+ POSTGRES_PASSWORD: postgres
61
+ options: "--health-cmd pg_isready --health-interval 10s --health-timeout 5s
62
+ --health-retries 5"
63
+ ports:
64
+ - 5432:5432
65
+ strategy:
66
+ fail-fast: false
67
+ matrix:
68
+ include:
69
+ - ruby: 2.5.8
70
+ gemfile: Gemfile.4.2.pg
71
+ - ruby: 2.5.8
72
+ gemfile: Gemfile.5.2.pg
73
+ - ruby: 2.5.8
74
+ gemfile: Gemfile.6.0.pg
75
+ - ruby: 2.5.8
76
+ gemfile: Gemfile.6.1.pg
77
+ - ruby: 3.0.0
78
+ gemfile: Gemfile.6.1.pg
79
+ env:
80
+ BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
81
+ steps:
82
+ - uses: actions/checkout@v2
83
+ - name: Install ruby
84
+ uses: ruby/setup-ruby@v1
85
+ with:
86
+ ruby-version: "${{ matrix.ruby }}"
87
+ - name: Setup database
88
+ run: |
89
+ sudo apt-get install -y postgresql-client
90
+ PGPASSWORD=postgres psql -c 'create database test;' -U postgres -p 5432 -h localhost
91
+ - name: Bundle
92
+ run: |
93
+ gem install bundler:1.17.3
94
+ bundle install --no-deployment
95
+ - name: Run tests
96
+ run: bundle exec rspec
data/.ruby-version CHANGED
@@ -1,2 +1 @@
1
- 2.2.4
2
-
1
+ 2.5.8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
- # Minidusen change log
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
2
3
 
3
- ## 0.8.0 (2017-08-21)
4
+ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
4
5
 
6
+
7
+ ## Unreleased
8
+
9
+ ### Breaking changes
10
+
11
+ -
12
+
13
+ ### Compatible changes
14
+
15
+
16
+ ## 0.10.0 2021-08-11
17
+
18
+ ### Breaking changes
19
+
20
+ -
21
+
22
+ ### Compatible changes
23
+
24
+ - Remove Rails 3.2 and Ruby < 2.5 from test matrix
25
+ - Add Rails 6.1 and Ruby 3.0 to test matrix
26
+
27
+ ## 0.9.0 2019-06-12
28
+
29
+ ### Breaking changes
30
+
31
+ -
32
+
33
+ ### Compatible changes
34
+
35
+ - CHANGELOG to satisfy [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) format.
36
+ - Use Rails 5.2 for tests instead of Rails 5.0
37
+ - Added Ruby 2.5.3 to test matrix
38
+ - Added support for Rails 6 RC1
39
+
40
+ ## 0.8.0 2017-08-21
41
+
42
+ ### Added
5
43
  - Filters are now run in the context of the filter instance, not the filter class. This allows using private methods or instance variables.
@@ -2,7 +2,7 @@ source 'https://rubygems.org'
2
2
 
3
3
  # Runtime dependencies
4
4
  gem 'activerecord', '~>4.2.1'
5
- gem 'mysql2', '~> 0.3.17'
5
+ gem 'mysql2', '~> 0.4.10'
6
6
 
7
7
  # Development dependencies
8
8
  gem 'database_cleaner'
@@ -12,4 +12,4 @@ gem 'byebug'
12
12
  gem 'gemika'
13
13
 
14
14
  # Gem under test
15
- gem 'minidusen', :path => '..'
15
+ gem 'minidusen', :path => '.'
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ..
2
+ remote: .
3
3
  specs:
4
- minidusen (0.8.0)
4
+ minidusen (0.10)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -27,13 +27,13 @@ GEM
27
27
  byebug (9.0.5)
28
28
  database_cleaner (1.5.3)
29
29
  diff-lcs (1.2.5)
30
- edge_rider (0.3.1)
31
- activerecord
32
- gemika (0.3.2)
30
+ edge_rider (1.1.0)
31
+ activerecord (>= 3.2)
32
+ gemika (0.5.0)
33
33
  i18n (0.7.0)
34
- json (1.8.3)
34
+ json (1.8.6)
35
35
  minitest (5.9.0)
36
- mysql2 (0.3.21)
36
+ mysql2 (0.4.10)
37
37
  rake (11.3.0)
38
38
  rspec (3.5.0)
39
39
  rspec-core (~> 3.5.0)
@@ -61,9 +61,9 @@ DEPENDENCIES
61
61
  database_cleaner
62
62
  gemika
63
63
  minidusen!
64
- mysql2 (~> 0.3.17)
64
+ mysql2 (~> 0.4.10)
65
65
  rake
66
66
  rspec (~> 3.4)
67
67
 
68
68
  BUNDLED WITH
69
- 1.12.5
69
+ 1.17.3
@@ -12,4 +12,4 @@ gem 'byebug'
12
12
  gem 'gemika'
13
13
 
14
14
  # Gem under test
15
- gem 'minidusen', :path => '..'
15
+ gem 'minidusen', :path => '.'
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ..
2
+ remote: .
3
3
  specs:
4
- minidusen (0.8.0)
4
+ minidusen (0.10)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -27,11 +27,11 @@ GEM
27
27
  byebug (9.0.5)
28
28
  database_cleaner (1.5.3)
29
29
  diff-lcs (1.2.5)
30
- edge_rider (0.3.1)
31
- activerecord
32
- gemika (0.3.2)
30
+ edge_rider (1.1.0)
31
+ activerecord (>= 3.2)
32
+ gemika (0.5.0)
33
33
  i18n (0.7.0)
34
- json (1.8.3)
34
+ json (1.8.6)
35
35
  minitest (5.9.0)
36
36
  pg (0.19.0)
37
37
  rake (11.3.0)
@@ -66,4 +66,4 @@ DEPENDENCIES
66
66
  rspec (~> 3.4)
67
67
 
68
68
  BUNDLED WITH
69
- 1.12.5
69
+ 1.17.3
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Runtime dependencies
4
+ gem 'activerecord', '~>5.2.3'
5
+ gem 'mysql2', '~>0.4.4'
6
+ gem 'i18n', '<=1.5.1' # Required to support tests for Ruby 2.2.x
7
+
8
+ # Development dependencies
9
+ gem 'rake'
10
+ gem 'database_cleaner'
11
+ gem 'rspec', '~>3.5'
12
+ gem 'byebug'
13
+ gem 'gemika'
14
+
15
+ # Gem under test
16
+ gem 'minidusen', :path => '.'
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ..
2
+ remote: .
3
3
  specs:
4
- minidusen (0.8.0)
4
+ minidusen (0.10)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -9,28 +9,29 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activemodel (5.0.0.1)
13
- activesupport (= 5.0.0.1)
14
- activerecord (5.0.0.1)
15
- activemodel (= 5.0.0.1)
16
- activesupport (= 5.0.0.1)
17
- arel (~> 7.0)
18
- activesupport (5.0.0.1)
12
+ activemodel (5.2.3)
13
+ activesupport (= 5.2.3)
14
+ activerecord (5.2.3)
15
+ activemodel (= 5.2.3)
16
+ activesupport (= 5.2.3)
17
+ arel (>= 9.0)
18
+ activesupport (5.2.3)
19
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (~> 0.7)
20
+ i18n (>= 0.7, < 2)
21
21
  minitest (~> 5.1)
22
22
  tzinfo (~> 1.1)
23
- arel (7.1.2)
23
+ arel (9.0.0)
24
24
  byebug (9.0.5)
25
- concurrent-ruby (1.0.2)
26
- database_cleaner (1.5.3)
25
+ concurrent-ruby (1.1.5)
26
+ database_cleaner (1.7.0)
27
27
  diff-lcs (1.2.5)
28
- edge_rider (0.3.1)
29
- activerecord
30
- gemika (0.3.2)
31
- i18n (0.7.0)
32
- minitest (5.9.0)
33
- mysql2 (0.4.4)
28
+ edge_rider (1.1.0)
29
+ activerecord (>= 3.2)
30
+ gemika (0.5.0)
31
+ i18n (1.5.1)
32
+ concurrent-ruby (~> 1.0)
33
+ minitest (5.11.3)
34
+ mysql2 (0.4.10)
34
35
  rake (11.3.0)
35
36
  rspec (3.5.0)
36
37
  rspec-core (~> 3.5.0)
@@ -45,22 +46,23 @@ GEM
45
46
  diff-lcs (>= 1.2.0, < 2.0)
46
47
  rspec-support (~> 3.5.0)
47
48
  rspec-support (3.5.0)
48
- thread_safe (0.3.5)
49
- tzinfo (1.2.2)
49
+ thread_safe (0.3.6)
50
+ tzinfo (1.2.5)
50
51
  thread_safe (~> 0.1)
51
52
 
52
53
  PLATFORMS
53
54
  ruby
54
55
 
55
56
  DEPENDENCIES
56
- activerecord (~> 5.0.0)
57
+ activerecord (~> 5.2.3)
57
58
  byebug
58
59
  database_cleaner
59
60
  gemika
61
+ i18n (<= 1.5.1)
60
62
  minidusen!
61
63
  mysql2 (~> 0.4.4)
62
64
  rake
63
65
  rspec (~> 3.5)
64
66
 
65
67
  BUNDLED WITH
66
- 1.12.5
68
+ 1.17.3
data/Gemfile.5.2.pg ADDED
@@ -0,0 +1,16 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Runtime dependencies
4
+ gem 'activerecord', '~>5.2.3'
5
+ gem 'pg', '~>0.18.4'
6
+ gem 'i18n', '<=1.5.1' # Required to support tests for Ruby 2.2.x
7
+
8
+ # Development dependendcies
9
+ gem 'rake'
10
+ gem 'database_cleaner'
11
+ gem 'rspec', '~>3.5'
12
+ gem 'byebug'
13
+ gem 'gemika'
14
+
15
+ # Gem under test
16
+ gem 'minidusen', :path => '.'
@@ -1,7 +1,7 @@
1
1
  PATH
2
- remote: ..
2
+ remote: .
3
3
  specs:
4
- minidusen (0.8.0)
4
+ minidusen (0.10)
5
5
  activerecord (>= 3.2)
6
6
  activesupport (>= 3.2)
7
7
  edge_rider (>= 0.2.5)
@@ -9,27 +9,28 @@ PATH
9
9
  GEM
10
10
  remote: https://rubygems.org/
11
11
  specs:
12
- activemodel (5.0.0.1)
13
- activesupport (= 5.0.0.1)
14
- activerecord (5.0.0.1)
15
- activemodel (= 5.0.0.1)
16
- activesupport (= 5.0.0.1)
17
- arel (~> 7.0)
18
- activesupport (5.0.0.1)
12
+ activemodel (5.2.3)
13
+ activesupport (= 5.2.3)
14
+ activerecord (5.2.3)
15
+ activemodel (= 5.2.3)
16
+ activesupport (= 5.2.3)
17
+ arel (>= 9.0)
18
+ activesupport (5.2.3)
19
19
  concurrent-ruby (~> 1.0, >= 1.0.2)
20
- i18n (~> 0.7)
20
+ i18n (>= 0.7, < 2)
21
21
  minitest (~> 5.1)
22
22
  tzinfo (~> 1.1)
23
- arel (7.1.2)
23
+ arel (9.0.0)
24
24
  byebug (9.0.5)
25
- concurrent-ruby (1.0.2)
26
- database_cleaner (1.5.3)
25
+ concurrent-ruby (1.1.5)
26
+ database_cleaner (1.7.0)
27
27
  diff-lcs (1.2.5)
28
- edge_rider (0.3.1)
29
- activerecord
30
- gemika (0.3.2)
31
- i18n (0.7.0)
32
- minitest (5.9.0)
28
+ edge_rider (1.1.0)
29
+ activerecord (>= 3.2)
30
+ gemika (0.5.0)
31
+ i18n (1.5.1)
32
+ concurrent-ruby (~> 1.0)
33
+ minitest (5.11.3)
33
34
  pg (0.18.4)
34
35
  rake (11.3.0)
35
36
  rspec (3.5.0)
@@ -45,22 +46,23 @@ GEM
45
46
  diff-lcs (>= 1.2.0, < 2.0)
46
47
  rspec-support (~> 3.5.0)
47
48
  rspec-support (3.5.0)
48
- thread_safe (0.3.5)
49
- tzinfo (1.2.2)
49
+ thread_safe (0.3.6)
50
+ tzinfo (1.2.5)
50
51
  thread_safe (~> 0.1)
51
52
 
52
53
  PLATFORMS
53
54
  ruby
54
55
 
55
56
  DEPENDENCIES
56
- activerecord (~> 5.0.0)
57
+ activerecord (~> 5.2.3)
57
58
  byebug
58
59
  database_cleaner
59
60
  gemika
61
+ i18n (<= 1.5.1)
60
62
  minidusen!
61
63
  pg (~> 0.18.4)
62
64
  rake
63
65
  rspec (~> 3.5)
64
66
 
65
67
  BUNDLED WITH
66
- 1.12.5
68
+ 2.2.3
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Runtime dependencies
4
- gem 'activerecord', '~>5.0.0'
4
+ gem 'activerecord', '~>6.0.0'
5
5
  gem 'mysql2', '~>0.4.4'
6
6
 
7
7
  # Development dependencies
@@ -12,4 +12,4 @@ gem 'byebug'
12
12
  gem 'gemika'
13
13
 
14
14
  # Gem under test
15
- gem 'minidusen', :path => '..'
15
+ gem 'minidusen', :path => '.'
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minidusen (0.10)
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 (6.0.3.4)
13
+ activesupport (= 6.0.3.4)
14
+ activerecord (6.0.3.4)
15
+ activemodel (= 6.0.3.4)
16
+ activesupport (= 6.0.3.4)
17
+ activesupport (6.0.3.4)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (>= 0.7, < 2)
20
+ minitest (~> 5.1)
21
+ tzinfo (~> 1.1)
22
+ zeitwerk (~> 2.2, >= 2.2.2)
23
+ byebug (11.0.1)
24
+ concurrent-ruby (1.1.7)
25
+ database_cleaner (1.7.0)
26
+ diff-lcs (1.3)
27
+ edge_rider (1.1.0)
28
+ activerecord (>= 3.2)
29
+ gemika (0.5.0)
30
+ i18n (1.8.5)
31
+ concurrent-ruby (~> 1.0)
32
+ minitest (5.14.2)
33
+ mysql2 (0.4.10)
34
+ rake (12.3.2)
35
+ rspec (3.8.0)
36
+ rspec-core (~> 3.8.0)
37
+ rspec-expectations (~> 3.8.0)
38
+ rspec-mocks (~> 3.8.0)
39
+ rspec-core (3.8.0)
40
+ rspec-support (~> 3.8.0)
41
+ rspec-expectations (3.8.2)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.8.0)
44
+ rspec-mocks (3.8.0)
45
+ diff-lcs (>= 1.2.0, < 2.0)
46
+ rspec-support (~> 3.8.0)
47
+ rspec-support (3.8.0)
48
+ thread_safe (0.3.6)
49
+ tzinfo (1.2.7)
50
+ thread_safe (~> 0.1)
51
+ zeitwerk (2.4.0)
52
+
53
+ PLATFORMS
54
+ ruby
55
+
56
+ DEPENDENCIES
57
+ activerecord (~> 6.0.0)
58
+ byebug
59
+ database_cleaner
60
+ gemika
61
+ minidusen!
62
+ mysql2 (~> 0.4.4)
63
+ rake
64
+ rspec (~> 3.5)
65
+
66
+ BUNDLED WITH
67
+ 1.17.3
@@ -1,7 +1,7 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
3
  # Runtime dependencies
4
- gem 'activerecord', '~>5.0.0'
4
+ gem 'activerecord', '~>6.0.0'
5
5
  gem 'pg', '~>0.18.4'
6
6
 
7
7
  # Development dependendcies
@@ -12,4 +12,4 @@ gem 'byebug'
12
12
  gem 'gemika'
13
13
 
14
14
  # Gem under test
15
- gem 'minidusen', :path => '..'
15
+ gem 'minidusen', :path => '.'
@@ -0,0 +1,67 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minidusen (0.10)
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 (6.0.3.4)
13
+ activesupport (= 6.0.3.4)
14
+ activerecord (6.0.3.4)
15
+ activemodel (= 6.0.3.4)
16
+ activesupport (= 6.0.3.4)
17
+ activesupport (6.0.3.4)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (>= 0.7, < 2)
20
+ minitest (~> 5.1)
21
+ tzinfo (~> 1.1)
22
+ zeitwerk (~> 2.2, >= 2.2.2)
23
+ byebug (11.0.1)
24
+ concurrent-ruby (1.1.7)
25
+ database_cleaner (1.7.0)
26
+ diff-lcs (1.3)
27
+ edge_rider (1.1.0)
28
+ activerecord (>= 3.2)
29
+ gemika (0.5.0)
30
+ i18n (1.8.5)
31
+ concurrent-ruby (~> 1.0)
32
+ minitest (5.14.2)
33
+ pg (0.18.4)
34
+ rake (12.3.2)
35
+ rspec (3.8.0)
36
+ rspec-core (~> 3.8.0)
37
+ rspec-expectations (~> 3.8.0)
38
+ rspec-mocks (~> 3.8.0)
39
+ rspec-core (3.8.0)
40
+ rspec-support (~> 3.8.0)
41
+ rspec-expectations (3.8.2)
42
+ diff-lcs (>= 1.2.0, < 2.0)
43
+ rspec-support (~> 3.8.0)
44
+ rspec-mocks (3.8.0)
45
+ diff-lcs (>= 1.2.0, < 2.0)
46
+ rspec-support (~> 3.8.0)
47
+ rspec-support (3.8.0)
48
+ thread_safe (0.3.6)
49
+ tzinfo (1.2.7)
50
+ thread_safe (~> 0.1)
51
+ zeitwerk (2.4.0)
52
+
53
+ PLATFORMS
54
+ ruby
55
+
56
+ DEPENDENCIES
57
+ activerecord (~> 6.0.0)
58
+ byebug
59
+ database_cleaner
60
+ gemika
61
+ minidusen!
62
+ pg (~> 0.18.4)
63
+ rake
64
+ rspec (~> 3.5)
65
+
66
+ BUNDLED WITH
67
+ 1.17.3
@@ -0,0 +1,15 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Runtime dependencies
4
+ gem 'activerecord', '~>6.1.0'
5
+ gem 'mysql2', '~>0.5'
6
+
7
+ # Development dependencies
8
+ gem 'rake'
9
+ gem 'database_cleaner'
10
+ gem 'rspec', '~>3.5'
11
+ gem 'byebug'
12
+ gem 'gemika'
13
+
14
+ # Gem under test
15
+ gem 'minidusen', :path => '.'
@@ -0,0 +1,71 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minidusen (0.10)
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 (6.1.3)
13
+ activesupport (= 6.1.3)
14
+ activerecord (6.1.3)
15
+ activemodel (= 6.1.3)
16
+ activesupport (= 6.1.3)
17
+ activesupport (6.1.3)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (>= 1.6, < 2)
20
+ minitest (>= 5.1)
21
+ tzinfo (~> 2.0)
22
+ zeitwerk (~> 2.3)
23
+ byebug (11.1.3)
24
+ concurrent-ruby (1.1.8)
25
+ database_cleaner (2.0.1)
26
+ database_cleaner-active_record (~> 2.0.0)
27
+ database_cleaner-active_record (2.0.0)
28
+ activerecord (>= 5.a)
29
+ database_cleaner-core (~> 2.0.0)
30
+ database_cleaner-core (2.0.1)
31
+ diff-lcs (1.4.4)
32
+ edge_rider (1.1.0)
33
+ activerecord (>= 3.2)
34
+ gemika (0.5.0)
35
+ i18n (1.8.9)
36
+ concurrent-ruby (~> 1.0)
37
+ minitest (5.14.4)
38
+ mysql2 (0.5.3)
39
+ rake (13.0.3)
40
+ rspec (3.10.0)
41
+ rspec-core (~> 3.10.0)
42
+ rspec-expectations (~> 3.10.0)
43
+ rspec-mocks (~> 3.10.0)
44
+ rspec-core (3.10.1)
45
+ rspec-support (~> 3.10.0)
46
+ rspec-expectations (3.10.1)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.10.0)
49
+ rspec-mocks (3.10.2)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.10.0)
52
+ rspec-support (3.10.2)
53
+ tzinfo (2.0.4)
54
+ concurrent-ruby (~> 1.0)
55
+ zeitwerk (2.4.2)
56
+
57
+ PLATFORMS
58
+ x86_64-linux
59
+
60
+ DEPENDENCIES
61
+ activerecord (~> 6.1.0)
62
+ byebug
63
+ database_cleaner
64
+ gemika
65
+ minidusen!
66
+ mysql2 (~> 0.5)
67
+ rake
68
+ rspec (~> 3.5)
69
+
70
+ BUNDLED WITH
71
+ 2.2.24
data/Gemfile.6.1.pg ADDED
@@ -0,0 +1,15 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Runtime dependencies
4
+ gem 'activerecord', '~>6.1.0'
5
+ gem 'pg', '~>1.1'
6
+
7
+ # Development dependendcies
8
+ gem 'rake'
9
+ gem 'database_cleaner'
10
+ gem 'rspec', '~>3.5'
11
+ gem 'byebug'
12
+ gem 'gemika'
13
+
14
+ # Gem under test
15
+ gem 'minidusen', :path => '.'
@@ -0,0 +1,71 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ minidusen (0.10)
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 (6.1.3)
13
+ activesupport (= 6.1.3)
14
+ activerecord (6.1.3)
15
+ activemodel (= 6.1.3)
16
+ activesupport (= 6.1.3)
17
+ activesupport (6.1.3)
18
+ concurrent-ruby (~> 1.0, >= 1.0.2)
19
+ i18n (>= 1.6, < 2)
20
+ minitest (>= 5.1)
21
+ tzinfo (~> 2.0)
22
+ zeitwerk (~> 2.3)
23
+ byebug (11.1.3)
24
+ concurrent-ruby (1.1.8)
25
+ database_cleaner (2.0.1)
26
+ database_cleaner-active_record (~> 2.0.0)
27
+ database_cleaner-active_record (2.0.0)
28
+ activerecord (>= 5.a)
29
+ database_cleaner-core (~> 2.0.0)
30
+ database_cleaner-core (2.0.1)
31
+ diff-lcs (1.4.4)
32
+ edge_rider (1.1.0)
33
+ activerecord (>= 3.2)
34
+ gemika (0.5.0)
35
+ i18n (1.8.9)
36
+ concurrent-ruby (~> 1.0)
37
+ minitest (5.14.4)
38
+ pg (1.2.3)
39
+ rake (13.0.3)
40
+ rspec (3.10.0)
41
+ rspec-core (~> 3.10.0)
42
+ rspec-expectations (~> 3.10.0)
43
+ rspec-mocks (~> 3.10.0)
44
+ rspec-core (3.10.1)
45
+ rspec-support (~> 3.10.0)
46
+ rspec-expectations (3.10.1)
47
+ diff-lcs (>= 1.2.0, < 2.0)
48
+ rspec-support (~> 3.10.0)
49
+ rspec-mocks (3.10.2)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.10.0)
52
+ rspec-support (3.10.2)
53
+ tzinfo (2.0.4)
54
+ concurrent-ruby (~> 1.0)
55
+ zeitwerk (2.4.2)
56
+
57
+ PLATFORMS
58
+ x86_64-linux
59
+
60
+ DEPENDENCIES
61
+ activerecord (~> 6.1.0)
62
+ byebug
63
+ database_cleaner
64
+ gemika
65
+ minidusen!
66
+ pg (~> 1.1)
67
+ rake
68
+ rspec (~> 3.5)
69
+
70
+ BUNDLED WITH
71
+ 2.2.24
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- Minidusen [![Build Status](https://travis-ci.org/makandra/minidusen.svg?branch=master)](https://travis-ci.org/makandra/minidusen)
1
+ Minidusen [![Tests](https://github.com/makandra/minidusen/workflows/Tests/badge.svg)](https://github.com/makandra/minidusen/actions)
2
2
  =========
3
3
 
4
4
  Low-tech search solution for ActiveRecord with MySQL or PostgreSQL
@@ -53,7 +53,7 @@ Basic Usage
53
53
  Our example will be a simple address book:
54
54
 
55
55
  ```ruby
56
- class Contact < ActiveRecord::Base
56
+ class Contact < ApplicationRecord
57
57
  validates_presence_of :name, :street, :city, :email
58
58
  end
59
59
  ```
@@ -68,7 +68,6 @@ class ContactFilter
68
68
  columns = [:name, :email]
69
69
  scope.where_like(columns => phrases)
70
70
  end
71
-
72
71
  end
73
72
  ```
74
73
 
@@ -136,8 +135,45 @@ You can also use `where_like` to find all the records *not* matching some phrase
136
135
  Contact.where_like(name: 'foo', negate: true)
137
136
  ```
138
137
 
139
- Processing queries for qualified fields
140
- ---------------------------------------
138
+ Filtering associated records
139
+ ----------------------------
140
+
141
+ Minidusen lets you find text in associated records.
142
+
143
+ Assume the following model where a `Contact` record may be associated with a `Group` record:
144
+
145
+ ```ruby
146
+ class Contact < ApplicationRecord
147
+ belongs_to :group
148
+
149
+ validates_presence_of :name, :street, :city, :email
150
+ end
151
+
152
+ class Group < ApplicationRecord
153
+ has_many :contacts
154
+
155
+ validates_presence_of :name
156
+ end
157
+ ```
158
+
159
+ We can filter contacts by their group name by joining the `groups` table and filtering on a joined column.
160
+ Note how the joined column is qualified as `groups.name` (rather than just `name`):
161
+
162
+ ```ruby
163
+ class ContactFilter
164
+ include Minidusen::Filter
165
+
166
+ filter :text do |scope, phrases|
167
+ columns = [:name, :email, 'groups.name']
168
+ scope.includes(:group).where_like(columns => phrases)
169
+ end
170
+ end
171
+ ```
172
+
173
+
174
+
175
+ Supporting qualified field syntax
176
+ ---------------------------------
141
177
 
142
178
  Google supports queries like `filetype:pdf` that filters records by some criteria without performing a full text search. Minidusen gives you a simple way to support such search syntax.
143
179
 
@@ -151,7 +187,7 @@ class ContactFilter
151
187
  include Minidusen::Filter
152
188
 
153
189
  filter :email do |scope, email|
154
- scope.where(emai: email)
190
+ scope.where(email: email)
155
191
  end
156
192
 
157
193
  filter :text do |scope, phrases|
@@ -183,9 +219,10 @@ Supported Rails versions
183
219
 
184
220
  Minidusen is tested on:
185
221
 
186
- - Rails 3.2
187
222
  - Rails 4.2
188
- - Rails 5.0
223
+ - Rails 5.2
224
+ - Rails 6.0
225
+ - Rails 6.1
189
226
  - MySQL 5.6
190
227
  - PostgreSQL
191
228
 
@@ -196,10 +233,10 @@ Development
196
233
  -----------
197
234
 
198
235
  - There are tests in `spec`. We only accept PRs with tests.
199
- - We currently develop using Ruby 2.2.4 (see `.ruby-version`) since that version works for all versions of ActiveRecord that we support. Travis CI will test additional Ruby versions (2.1.8 and 2.3.1).
236
+ - We currently develop using the Ruby version in `.ruby-version`. It is required to change the Ruby Version to cover all Rails version or just use Gitlab CI.
200
237
  - Put your database credentials into `spec/support/database.yml`. There's a `database.sample.yml` you can use as a template.
201
238
  - Create a database `minidusen_test` in both MySQL and PostgreSQL.
202
- - There are gem bundles in `gemfiles` for each combination of ActiveRecord version and database type that we support.
239
+ - There are gem bundles in the project root for each combination of ActiveRecord version and database type that we support.
203
240
  - You can bundle all test applications by saying `bundle exec rake matrix:install`
204
241
  - You can run specs from the project root by saying `bundle exec rake matrix:spec`. This will run all gemfiles compatible with your current Ruby.
205
242
 
@@ -4,7 +4,7 @@ module Minidusen
4
4
  class CannotParse < StandardError; end
5
5
 
6
6
  TEXT_QUERY = /(?:(\-)?"([^"]+)"|(\-)?([\S]+))/
7
- FIELD_QUERY = /(\-)?(\w+)\:#{TEXT_QUERY}/
7
+ FIELD_QUERY = /(?:\s|^|(\-))(\w+)\:#{TEXT_QUERY}/
8
8
 
9
9
  class << self
10
10
 
@@ -25,6 +25,7 @@ module Minidusen
25
25
 
26
26
  def parse_string(string)
27
27
  string = string.dup # we are going to delete substrings in-place
28
+ string = string.encode('UTF-8', invalid: :replace, undef: :replace, replace: '')
28
29
  query = Query.new
29
30
  extract_field_query_tokens(string, query)
30
31
  extract_text_query_tokens(string, query)
@@ -1,3 +1,3 @@
1
1
  module Minidusen
2
- VERSION = '0.8.1'
2
+ VERSION = '0.10'
3
3
  end
@@ -25,7 +25,9 @@ describe Minidusen::Filter do
25
25
  it 'should not find stale text after fields were updated (bugfix)' do
26
26
  match = User.create!(:name => 'Abraham')
27
27
  no_match = User.create!(:name => 'Elizabath')
28
- match.update_attributes!(:name => 'Johnny')
28
+ match.name = 'Johnny'
29
+ match.save!
30
+
29
31
  user_filter.filter(User, 'Abraham').to_a.should be_empty
30
32
  user_filter.filter(User, 'Johnny').to_a.should == [match]
31
33
  end
@@ -5,19 +5,28 @@ describe Minidusen::Parser do
5
5
  describe 'when called with a String' do
6
6
 
7
7
  it 'parses the given string into tokens' do
8
- query = Minidusen::Parser.parse('fieldname:fieldvalue word "a phrase"')
9
- query.size.should == 3
8
+ query = Minidusen::Parser.parse('fieldname:fieldvalue word "a phrase" "deploy:rollback" -"db:seed"')
9
+ query.size.should == 5
10
10
  query[0].field.should == 'fieldname'
11
11
  query[0].value.should == 'fieldvalue'
12
+ query[0].exclude.should == false
12
13
  query[1].field.should == 'text'
13
14
  query[1].value.should == 'word'
15
+ query[1].exclude.should == false
14
16
  query[2].field.should == 'text'
15
17
  query[2].value.should == 'a phrase'
18
+ query[2].exclude.should == false
19
+ query[3].field.should == 'text'
20
+ query[3].value.should == 'deploy:rollback'
21
+ query[3].exclude.should == false
22
+ query[4].field.should == 'text'
23
+ query[4].value.should == 'db:seed'
24
+ query[4].exclude.should == true
16
25
  end
17
26
 
18
27
  it 'should parse field tokens first, because they usually give maximum filtering at little cost' do
19
- query = Minidusen::Parser.parse('word1 field1:field1-value word2 field2:field2-value')
20
- query.collect(&:value).should == ['field1-value', 'field2-value', 'word1', 'word2']
28
+ query = Minidusen::Parser.parse('word1 field1:field1-value word2 field2:field2-value "search:word"')
29
+ query.collect(&:value).should == ['field1-value', 'field2-value', 'word1', 'word2', 'search:word']
21
30
  end
22
31
 
23
32
  it 'should not consider the dash to be a word boundary' do
@@ -30,6 +39,38 @@ describe Minidusen::Parser do
30
39
  query.collect(&:value).should == ['åöÙÔøüéíÁ', 'ÄüÊçñÆ ððÿáÒÉ', 'pulvérisateur', 'pędzić']
31
40
  end
32
41
 
42
+ it 'should allow to search for a phrase containing a colon' do
43
+ query = Minidusen::Parser.parse('"deploy:rollback"')
44
+ query.size.should == 1
45
+ query[0].field.should == 'text'
46
+ query[0].value.should == 'deploy:rollback'
47
+ query[0].exclude.should == false
48
+ end
49
+
50
+ it 'should parse a field token which is at the beginning of the search string' do
51
+ query = Minidusen::Parser.parse('filetype:pdf word')
52
+ query.size.should == 2
53
+ query[0].field.should == 'filetype'
54
+ query[0].value.should == 'pdf'
55
+ query[0].exclude.should == false
56
+ end
57
+
58
+ it 'should parse an excluded field token which is at the beginning of the search string' do
59
+ query = Minidusen::Parser.parse('-filetype:docx word')
60
+ query.size.should == 2
61
+ query[0].field.should == 'filetype'
62
+ query[0].value.should == 'docx'
63
+ query[0].exclude.should == true
64
+ end
65
+
66
+ it 'should ignore invalid utf-8 byte sequences' do
67
+ term_with_invalid_byte_sequence = "word\255".force_encoding('UTF-8')
68
+
69
+ query = Minidusen::Parser.parse(term_with_invalid_byte_sequence)
70
+ query.size.should == 1
71
+ query[0].value.should == 'word'
72
+ end
73
+
33
74
  end
34
75
 
35
76
  describe 'when called with a Query' do
@@ -0,0 +1,13 @@
1
+ mysql:
2
+ database: test
3
+ username: root
4
+ password: password
5
+ host: 127.0.0.1
6
+ port: 3306
7
+
8
+ postgresql:
9
+ database: test
10
+ host: localhost
11
+ username: postgres
12
+ password: postgres
13
+ port: 5432
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minidusen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: '0.10'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henning Koch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-06 00:00:00.000000000 Z
11
+ date: 2021-08-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -58,25 +58,31 @@ executables: []
58
58
  extensions: []
59
59
  extra_rdoc_files: []
60
60
  files:
61
+ - ".github/workflows/test.yml"
61
62
  - ".gitignore"
62
63
  - ".rspec"
63
64
  - ".ruby-version"
64
- - ".travis.yml"
65
65
  - CHANGELOG.md
66
+ - Gemfile.4.2.mysql2
67
+ - Gemfile.4.2.mysql2.lock
68
+ - Gemfile.4.2.pg
69
+ - Gemfile.4.2.pg.lock
70
+ - Gemfile.5.2.mysql2
71
+ - Gemfile.5.2.mysql2.lock
72
+ - Gemfile.5.2.pg
73
+ - Gemfile.5.2.pg.lock
74
+ - Gemfile.6.0.mysql2
75
+ - Gemfile.6.0.mysql2.lock
76
+ - Gemfile.6.0.pg
77
+ - Gemfile.6.0.pg.lock
78
+ - Gemfile.6.1.mysql2
79
+ - Gemfile.6.1.mysql2.lock
80
+ - Gemfile.6.1.pg
81
+ - Gemfile.6.1.pg.lock
66
82
  - LICENSE
67
83
  - README.md
68
84
  - Rakefile
69
85
  - doc/filtered_index_view.cropped.png
70
- - gemfiles/Gemfile.3.2.mysql2
71
- - gemfiles/Gemfile.3.2.mysql2.lock
72
- - gemfiles/Gemfile.4.2.mysql2
73
- - gemfiles/Gemfile.4.2.mysql2.lock
74
- - gemfiles/Gemfile.4.2.pg
75
- - gemfiles/Gemfile.4.2.pg.lock
76
- - gemfiles/Gemfile.5.0.mysql2
77
- - gemfiles/Gemfile.5.0.mysql2.lock
78
- - gemfiles/Gemfile.5.0.pg
79
- - gemfiles/Gemfile.5.0.pg.lock
80
86
  - lib/minidusen.rb
81
87
  - lib/minidusen/active_record_ext.rb
82
88
  - lib/minidusen/filter.rb
@@ -93,9 +99,9 @@ files:
93
99
  - spec/minidusen/query_spec.rb
94
100
  - spec/minidusen/util_spec.rb
95
101
  - spec/spec_helper.rb
102
+ - spec/support/database.github.yml
96
103
  - spec/support/database.rb
97
104
  - spec/support/database.sample.yml
98
- - spec/support/database.travis.yml
99
105
  - spec/support/models.rb
100
106
  homepage: https://github.com/makandra/minidusen
101
107
  licenses:
@@ -116,8 +122,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
122
  - !ruby/object:Gem::Version
117
123
  version: '0'
118
124
  requirements: []
119
- rubyforge_project:
120
- rubygems_version: 2.6.13
125
+ rubygems_version: 3.2.3
121
126
  signing_key:
122
127
  specification_version: 4
123
128
  summary: Low-tech search for ActiveRecord with MySQL or PostgreSQL
data/.travis.yml DELETED
@@ -1,34 +0,0 @@
1
- language: ruby
2
-
3
- rvm:
4
- - 2.1.8
5
- - 2.2.4
6
- - 2.3.1
7
-
8
- gemfile:
9
- - gemfiles/Gemfile.3.2.mysql2
10
- - gemfiles/Gemfile.4.2.mysql2
11
- - gemfiles/Gemfile.4.2.pg
12
- - gemfiles/Gemfile.5.0.mysql2
13
- - gemfiles/Gemfile.5.0.pg
14
-
15
- before_script:
16
- - psql -c 'create database minidusen_test;' -U postgres
17
- - mysql -e 'create database IF NOT EXISTS minidusen_test;'
18
-
19
- script: bundle exec rspec spec
20
-
21
- sudo: false
22
-
23
- cache: bundler
24
-
25
- notifications:
26
- email:
27
- - fail@makandra.de
28
-
29
- matrix:
30
- exclude:
31
- - rvm: 2.1.8
32
- gemfile: gemfiles/Gemfile.5.0.mysql2
33
- - rvm: 2.1.8
34
- gemfile: gemfiles/Gemfile.5.0.pg
@@ -1,16 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Runtime dependencies
4
- gem 'activerecord', '=3.2.22'
5
- gem 'mysql2', '= 0.3.17'
6
- gem 'i18n', '=0.6.11' # 0.7 no longer builds for Ruby 1.8.7
7
-
8
- # Development dependencies
9
- gem 'rake'
10
- gem 'database_cleaner'
11
- gem 'rspec', '~> 3.4'
12
- gem 'byebug'
13
- gem 'gemika'
14
-
15
- # Gem under test
16
- gem 'minidusen', :path => '..'
@@ -1,65 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- minidusen (0.8.0)
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 (3.2.22)
13
- activesupport (= 3.2.22)
14
- builder (~> 3.0.0)
15
- activerecord (3.2.22)
16
- activemodel (= 3.2.22)
17
- activesupport (= 3.2.22)
18
- arel (~> 3.0.2)
19
- tzinfo (~> 0.3.29)
20
- activesupport (3.2.22)
21
- i18n (~> 0.6, >= 0.6.4)
22
- multi_json (~> 1.0)
23
- arel (3.0.3)
24
- builder (3.0.4)
25
- byebug (9.0.5)
26
- database_cleaner (1.5.3)
27
- diff-lcs (1.2.5)
28
- edge_rider (0.3.1)
29
- activerecord
30
- gemika (0.3.2)
31
- i18n (0.6.11)
32
- multi_json (1.12.1)
33
- mysql2 (0.3.17)
34
- rake (11.3.0)
35
- rspec (3.5.0)
36
- rspec-core (~> 3.5.0)
37
- rspec-expectations (~> 3.5.0)
38
- rspec-mocks (~> 3.5.0)
39
- rspec-core (3.5.3)
40
- rspec-support (~> 3.5.0)
41
- rspec-expectations (3.5.0)
42
- diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.5.0)
44
- rspec-mocks (3.5.0)
45
- diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.5.0)
47
- rspec-support (3.5.0)
48
- tzinfo (0.3.51)
49
-
50
- PLATFORMS
51
- ruby
52
-
53
- DEPENDENCIES
54
- activerecord (= 3.2.22)
55
- byebug
56
- database_cleaner
57
- gemika
58
- i18n (= 0.6.11)
59
- minidusen!
60
- mysql2 (= 0.3.17)
61
- rake
62
- rspec (~> 3.4)
63
-
64
- BUNDLED WITH
65
- 1.12.5
@@ -1,9 +0,0 @@
1
- mysql:
2
- database: minidusen_test
3
- username: travis
4
- password:
5
-
6
- postgresql:
7
- database: minidusen_test
8
- user: postgres
9
- password: