sortable-by 0.13.0 → 0.13.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4639f942b5f628b07367a343160d7e4301b00bf3c6e0db9f57ff43d204a85ab5
4
- data.tar.gz: 2f424ec2cda37112ca64fdf628b7ff0aee3e223dbee81d585040eff79ee468c8
3
+ metadata.gz: 4bb07dd11741d2ea29ae694e1e6bc11711e8427b137855ff84fe6760e182e59e
4
+ data.tar.gz: a5d2b6e874053630307e891855e542b6874adad75788e6a0c822a2e9336d490d
5
5
  SHA512:
6
- metadata.gz: ff08a62e083e324f9baa4118423c82d90ad93d00f42b4cd6ae74d915a637439315f4cf5ebd8b9d598075bd9565064429a06d0017bae3b5f7998c35b39a50f14c
7
- data.tar.gz: b084242394054b896d594c923e262c6325a74c58c836e2224ee5c4f91c3bc087bedfe0b42eb7aa2438ea2a84dd41ddd54c6b5718f68e181d5869bbb5efcb2397
6
+ metadata.gz: 95feb9e2a5ba054e128572c35da39246760472ecb12c456976e267cac7eaa425c61505bce2037af98c5e33d5f20513571405395f1c462ad2054f6032d6600a5c
7
+ data.tar.gz: 610babd95b3ba593f9f566720e549929e13aef5031aa7330f7e87a07feac48b68483f2c5d2bc14489d81dd0728e39d405aeeb6d7681437598a98078e10f2e437
@@ -0,0 +1,21 @@
1
+ name: Ruby
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+ branches: [main]
8
+
9
+ jobs:
10
+ test:
11
+ runs-on: ubuntu-latest
12
+ strategy:
13
+ matrix:
14
+ ruby-version: ["2.6", "2.7", "3.0"]
15
+ steps:
16
+ - uses: actions/checkout@v2
17
+ - uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: ${{ matrix.ruby-version }}
20
+ bundler-cache: true
21
+ - run: bundle exec rake
data/.rubocop.yml CHANGED
@@ -1,9 +1,12 @@
1
- inherit_from:
2
- - https://gitlab.com/bsm/misc/raw/master/rubocop/default.yml
1
+ inherit_gem:
2
+ rubocop-bsm:
3
+ - default.yml
4
+ inherit_mode:
5
+ merge:
6
+ - Exclude
3
7
 
4
8
  AllCops:
5
- TargetRubyVersion: 2.5
6
-
9
+ TargetRubyVersion: 2.6
7
10
  Naming/MethodParameterName:
8
11
  MinNameLength: 2
9
12
  Naming/MemoizedInstanceVariableName:
data/Gemfile.lock CHANGED
@@ -1,68 +1,86 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- sortable-by (0.13.0)
4
+ sortable-by (0.13.1)
5
5
  activerecord
6
6
  activesupport
7
7
 
8
8
  GEM
9
9
  remote: http://rubygems.org/
10
10
  specs:
11
- activemodel (6.0.3.3)
12
- activesupport (= 6.0.3.3)
13
- activerecord (6.0.3.3)
14
- activemodel (= 6.0.3.3)
15
- activesupport (= 6.0.3.3)
16
- activesupport (6.0.3.3)
11
+ activemodel (6.1.3)
12
+ activesupport (= 6.1.3)
13
+ activerecord (6.1.3)
14
+ activemodel (= 6.1.3)
15
+ activesupport (= 6.1.3)
16
+ activesupport (6.1.3)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (>= 0.7, < 2)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- zeitwerk (~> 2.2, >= 2.2.2)
22
- ast (2.4.1)
23
- concurrent-ruby (1.1.7)
18
+ i18n (>= 1.6, < 2)
19
+ minitest (>= 5.1)
20
+ tzinfo (~> 2.0)
21
+ zeitwerk (~> 2.3)
22
+ ast (2.4.2)
23
+ concurrent-ruby (1.1.8)
24
24
  diff-lcs (1.4.4)
25
- i18n (1.8.5)
25
+ i18n (1.8.9)
26
26
  concurrent-ruby (~> 1.0)
27
- minitest (5.14.2)
28
- parallel (1.19.2)
29
- parser (2.7.2.0)
27
+ minitest (5.14.4)
28
+ parallel (1.20.1)
29
+ parser (3.0.0.0)
30
30
  ast (~> 2.4.1)
31
+ rack (2.2.3)
31
32
  rainbow (3.0.0)
32
- rake (13.0.1)
33
- regexp_parser (1.8.1)
33
+ rake (13.0.3)
34
+ regexp_parser (2.1.1)
34
35
  rexml (3.2.4)
35
- rspec (3.9.0)
36
- rspec-core (~> 3.9.0)
37
- rspec-expectations (~> 3.9.0)
38
- rspec-mocks (~> 3.9.0)
39
- rspec-core (3.9.3)
40
- rspec-support (~> 3.9.3)
41
- rspec-expectations (3.9.2)
36
+ rspec (3.10.0)
37
+ rspec-core (~> 3.10.0)
38
+ rspec-expectations (~> 3.10.0)
39
+ rspec-mocks (~> 3.10.0)
40
+ rspec-core (3.10.1)
41
+ rspec-support (~> 3.10.0)
42
+ rspec-expectations (3.10.1)
42
43
  diff-lcs (>= 1.2.0, < 2.0)
43
- rspec-support (~> 3.9.0)
44
- rspec-mocks (3.9.1)
44
+ rspec-support (~> 3.10.0)
45
+ rspec-mocks (3.10.2)
45
46
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.9.0)
47
- rspec-support (3.9.3)
48
- rubocop (0.92.0)
47
+ rspec-support (~> 3.10.0)
48
+ rspec-support (3.10.2)
49
+ rubocop (1.11.0)
49
50
  parallel (~> 1.10)
50
- parser (>= 2.7.1.5)
51
+ parser (>= 3.0.0.0)
51
52
  rainbow (>= 2.2.2, < 4.0)
52
- regexp_parser (>= 1.7)
53
+ regexp_parser (>= 1.8, < 3.0)
53
54
  rexml
54
- rubocop-ast (>= 0.5.0)
55
+ rubocop-ast (>= 1.2.0, < 2.0)
55
56
  ruby-progressbar (~> 1.7)
56
- unicode-display_width (>= 1.4.0, < 2.0)
57
- rubocop-ast (0.7.1)
57
+ unicode-display_width (>= 1.4.0, < 3.0)
58
+ rubocop-ast (1.4.1)
58
59
  parser (>= 2.7.1.5)
59
- ruby-progressbar (1.10.1)
60
+ rubocop-bsm (0.5.4)
61
+ rubocop (~> 1.0)
62
+ rubocop-performance
63
+ rubocop-rails
64
+ rubocop-rake
65
+ rubocop-rspec
66
+ rubocop-performance (1.10.1)
67
+ rubocop (>= 0.90.0, < 2.0)
68
+ rubocop-ast (>= 0.4.0)
69
+ rubocop-rails (2.9.1)
70
+ activesupport (>= 4.2.0)
71
+ rack (>= 1.1)
72
+ rubocop (>= 0.90.0, < 2.0)
73
+ rubocop-rake (0.5.1)
74
+ rubocop
75
+ rubocop-rspec (2.2.0)
76
+ rubocop (~> 1.0)
77
+ rubocop-ast (>= 1.1.0)
78
+ ruby-progressbar (1.11.0)
60
79
  sqlite3 (1.4.2)
61
- thread_safe (0.3.6)
62
- tzinfo (1.2.7)
63
- thread_safe (~> 0.1)
64
- unicode-display_width (1.7.0)
65
- zeitwerk (2.4.0)
80
+ tzinfo (2.0.4)
81
+ concurrent-ruby (~> 1.0)
82
+ unicode-display_width (2.0.0)
83
+ zeitwerk (2.4.2)
66
84
 
67
85
  PLATFORMS
68
86
  ruby
@@ -71,7 +89,7 @@ DEPENDENCIES
71
89
  bundler
72
90
  rake
73
91
  rspec
74
- rubocop
92
+ rubocop-bsm
75
93
  sortable-by!
76
94
  sqlite3
77
95
 
data/lib/sortable_by.rb CHANGED
@@ -44,7 +44,7 @@ module ActiveRecord # :nodoc:
44
44
  rank = :asc
45
45
  if name[0] == '-'
46
46
  rank = :desc
47
- name = name[1..-1]
47
+ name = name[1..]
48
48
  end
49
49
 
50
50
  field = _fields[name]
data/sortable-by.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'sortable-by'
3
- s.version = '0.13.0'
3
+ s.version = '0.13.1'
4
4
  s.authors = ['Dimitrij Denissenko']
5
5
  s.email = ['dimitrij@blacksquaremedia.com']
6
6
  s.summary = 'Generate white-listed sort scopes from URL parameter values'
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.files = `git ls-files -z`.split("\x0").reject {|f| f.match(%r{^spec/}) }
12
12
  s.test_files = `git ls-files -z -- spec/*`.split("\x0")
13
13
  s.require_paths = ['lib']
14
- s.required_ruby_version = '>= 2.5'
14
+ s.required_ruby_version = '>= 2.6'
15
15
 
16
16
  s.add_dependency 'activerecord'
17
17
  s.add_dependency 'activesupport'
@@ -19,6 +19,6 @@ Gem::Specification.new do |s|
19
19
  s.add_development_dependency 'bundler'
20
20
  s.add_development_dependency 'rake'
21
21
  s.add_development_dependency 'rspec'
22
- s.add_development_dependency 'rubocop'
22
+ s.add_development_dependency 'rubocop-bsm'
23
23
  s.add_development_dependency 'sqlite3'
24
24
  end
@@ -1,4 +1,4 @@
1
- require File.expand_path('./spec_helper', __dir__)
1
+ require 'spec_helper'
2
2
 
3
3
  describe ActiveRecord::SortableBy do
4
4
  before do
@@ -8,7 +8,7 @@ describe ActiveRecord::SortableBy do
8
8
  end
9
9
  end
10
10
 
11
- it 'should have config' do
11
+ it 'has config' do
12
12
  expect(Post._sortable_by_config._fields.keys).to match_array(%w[title created])
13
13
  expect(Post._sortable_by_config._default).to eq('-created')
14
14
  expect(SubPost._sortable_by_config._fields.keys).to match_array(%w[title created])
@@ -24,7 +24,7 @@ describe ActiveRecord::SortableBy do
24
24
  expect(Product._sortable_by_config._default).to eq('shop,name')
25
25
  end
26
26
 
27
- it 'should simply order' do
27
+ it 'simplies order' do
28
28
  Post.create! title: 'A', created_at: Time.at(1515151500)
29
29
  Post.create! title: 'b', created_at: Time.at(1515151600)
30
30
  Post.create! title: 'C', created_at: Time.at(1515151400)
@@ -41,7 +41,7 @@ describe ActiveRecord::SortableBy do
41
41
  expect(Post.sorted_by(' title ').pluck(:title)).to eq(%w[A C b])
42
42
  end
43
43
 
44
- it 'should support STI inheritance and overrides' do
44
+ it 'supports STI inheritance and overrides' do
45
45
  SubPost.create! title: 'A', created_at: Time.at(1515151700)
46
46
  SubPost.create! title: 'b', created_at: Time.at(1515151600)
47
47
  Post.create! title: 'C', created_at: Time.at(1515151400)
@@ -56,7 +56,7 @@ describe ActiveRecord::SortableBy do
56
56
  expect(SubPost.sorted_by('title').pluck(:title)).to eq(%w[A b D])
57
57
  end
58
58
 
59
- it 'should support composition' do
59
+ it 'supports composition' do
60
60
  App.create! name: 'E', major: 0, minor: 9, patch: 2
61
61
  App.create! name: 'A', major: 1, minor: 0, patch: 1
62
62
  App.create! name: 'D', major: 1, minor: 0, patch: 6
@@ -68,7 +68,7 @@ describe ActiveRecord::SortableBy do
68
68
  expect(App.sorted_by('-version').pluck(:name)).to eq(%w[B C D A E])
69
69
  end
70
70
 
71
- it 'should support associations' do
71
+ it 'supports associations' do
72
72
  y = Shop.create! name: 'Y'
73
73
  x = Shop.create! name: 'X'
74
74
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sortable-by
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.13.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dimitrij Denissenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2021-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rubocop
84
+ name: rubocop-bsm
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -115,9 +115,9 @@ executables: []
115
115
  extensions: []
116
116
  extra_rdoc_files: []
117
117
  files:
118
+ - ".github/workflows/ruby.yml"
118
119
  - ".gitignore"
119
120
  - ".rubocop.yml"
120
- - ".travis.yml"
121
121
  - Gemfile
122
122
  - Gemfile.lock
123
123
  - LICENSE
@@ -126,7 +126,7 @@ files:
126
126
  - lib/sortable-by.rb
127
127
  - lib/sortable_by.rb
128
128
  - sortable-by.gemspec
129
- - spec/sortable_by_spec.rb
129
+ - spec/active_record/sortable_by_spec.rb
130
130
  - spec/spec_helper.rb
131
131
  homepage: https://github.com/bsm/sortable-by
132
132
  licenses:
@@ -140,17 +140,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
140
140
  requirements:
141
141
  - - ">="
142
142
  - !ruby/object:Gem::Version
143
- version: '2.5'
143
+ version: '2.6'
144
144
  required_rubygems_version: !ruby/object:Gem::Requirement
145
145
  requirements:
146
146
  - - ">="
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.1.2
150
+ rubygems_version: 3.1.4
151
151
  signing_key:
152
152
  specification_version: 4
153
153
  summary: Generate white-listed sort scopes from URL parameter values
154
154
  test_files:
155
- - spec/sortable_by_spec.rb
155
+ - spec/active_record/sortable_by_spec.rb
156
156
  - spec/spec_helper.rb
data/.travis.yml DELETED
@@ -1,9 +0,0 @@
1
- sudo: false
2
- rvm:
3
- - 2.5
4
- - 2.6
5
- - 2.7
6
- gemfile:
7
- - Gemfile
8
- before_install:
9
- - gem install bundler