schnecke 0.4.1 → 0.4.4
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 +4 -4
- data/.rubocop.yml +1 -2
- data/Gemfile.lock +33 -29
- data/README.md +1 -0
- data/lib/schnecke/schnecke.rb +11 -9
- data/lib/schnecke/version.rb +1 -1
- data/schnecke.gemspec +1 -0
- metadata +16 -3
- data/.travis.yml +0 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ac2b5eb13b89895652625a2dc86077818285821b96b81293f86813d8f22ce4a
|
|
4
|
+
data.tar.gz: e1158c4eb045cfc7a7e212ad9391ff144538e01e534e796e03a2597a9b0d51cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9d5a03f6931e0e8d41ae528bfc974be71651207e916579b31639ab1f40f73dd6d9adc0dd2248061adfdf12aae0a60413b470ec17c3295be0ff9b7d6fad775c7b
|
|
7
|
+
data.tar.gz: 55cb643383633b2625345005028d5630ce9f62eaeff8f603c9689f8aedb6240e3da956d3394ce364c043ea181cae976d9a6baa0adfced1edfc2e643d6d3ca9bd
|
data/.rubocop.yml
CHANGED
|
@@ -16,7 +16,6 @@ AllCops:
|
|
|
16
16
|
- 'config/**/*'
|
|
17
17
|
- 'vendor/**/*'
|
|
18
18
|
- 'bin/**/*'
|
|
19
|
-
- 'node_modules/**/*'
|
|
20
19
|
|
|
21
20
|
Layout/LineLength:
|
|
22
21
|
Max: 80
|
|
@@ -29,8 +28,8 @@ Metrics/AbcSize:
|
|
|
29
28
|
Metrics/BlockLength:
|
|
30
29
|
Max: 40
|
|
31
30
|
Exclude:
|
|
32
|
-
- 'test/**/*'
|
|
33
31
|
- 'schnecke.gemspec'
|
|
32
|
+
- 'test/**/*'
|
|
34
33
|
|
|
35
34
|
Metrics/ClassLength:
|
|
36
35
|
Max: 150
|
data/Gemfile.lock
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
schnecke (0.4.
|
|
4
|
+
schnecke (0.4.4)
|
|
5
5
|
activerecord (> 4.2.0)
|
|
6
6
|
activesupport (> 4.2.0)
|
|
7
7
|
|
|
8
8
|
GEM
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
|
-
activemodel (7.0.4)
|
|
12
|
-
activesupport (= 7.0.4)
|
|
13
|
-
activerecord (7.0.4)
|
|
14
|
-
activemodel (= 7.0.4)
|
|
15
|
-
activesupport (= 7.0.4)
|
|
16
|
-
activesupport (7.0.4)
|
|
11
|
+
activemodel (7.0.4.2)
|
|
12
|
+
activesupport (= 7.0.4.2)
|
|
13
|
+
activerecord (7.0.4.2)
|
|
14
|
+
activemodel (= 7.0.4.2)
|
|
15
|
+
activesupport (= 7.0.4.2)
|
|
16
|
+
activesupport (7.0.4.2)
|
|
17
17
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
|
18
18
|
i18n (>= 1.6, < 2)
|
|
19
19
|
minitest (>= 5.1)
|
|
@@ -22,51 +22,54 @@ GEM
|
|
|
22
22
|
bundler-audit (0.9.1)
|
|
23
23
|
bundler (>= 1.2.0, < 3)
|
|
24
24
|
thor (~> 1.0)
|
|
25
|
-
concurrent-ruby (1.
|
|
25
|
+
concurrent-ruby (1.2.2)
|
|
26
26
|
i18n (1.12.0)
|
|
27
27
|
concurrent-ruby (~> 1.0)
|
|
28
|
-
json (2.6.
|
|
29
|
-
minitest (5.
|
|
28
|
+
json (2.6.3)
|
|
29
|
+
minitest (5.18.0)
|
|
30
30
|
parallel (1.22.1)
|
|
31
|
-
parser (3.
|
|
31
|
+
parser (3.2.1.1)
|
|
32
32
|
ast (~> 2.4.1)
|
|
33
|
-
rack (3.0.
|
|
33
|
+
rack (3.0.4.2)
|
|
34
34
|
rainbow (3.1.1)
|
|
35
35
|
rake (12.3.3)
|
|
36
|
-
regexp_parser (2.
|
|
36
|
+
regexp_parser (2.7.0)
|
|
37
37
|
rexml (3.2.5)
|
|
38
|
-
rubocop (1.
|
|
38
|
+
rubocop (1.48.0)
|
|
39
39
|
json (~> 2.3)
|
|
40
40
|
parallel (~> 1.10)
|
|
41
|
-
parser (>= 3.
|
|
41
|
+
parser (>= 3.2.0.0)
|
|
42
42
|
rainbow (>= 2.2.2, < 4.0)
|
|
43
43
|
regexp_parser (>= 1.8, < 3.0)
|
|
44
44
|
rexml (>= 3.2.5, < 4.0)
|
|
45
|
-
rubocop-ast (>= 1.
|
|
45
|
+
rubocop-ast (>= 1.26.0, < 2.0)
|
|
46
46
|
ruby-progressbar (~> 1.7)
|
|
47
|
-
unicode-display_width (>=
|
|
48
|
-
rubocop-ast (1.
|
|
49
|
-
parser (>= 3.
|
|
50
|
-
rubocop-minitest (0.
|
|
51
|
-
rubocop (>=
|
|
52
|
-
rubocop-performance (1.
|
|
47
|
+
unicode-display_width (>= 2.4.0, < 3.0)
|
|
48
|
+
rubocop-ast (1.27.0)
|
|
49
|
+
parser (>= 3.2.1.0)
|
|
50
|
+
rubocop-minitest (0.29.0)
|
|
51
|
+
rubocop (>= 1.39, < 2.0)
|
|
52
|
+
rubocop-performance (1.16.0)
|
|
53
53
|
rubocop (>= 1.7.0, < 2.0)
|
|
54
54
|
rubocop-ast (>= 0.4.0)
|
|
55
|
-
rubocop-rails (2.
|
|
55
|
+
rubocop-rails (2.18.0)
|
|
56
56
|
activesupport (>= 4.2.0)
|
|
57
57
|
rack (>= 1.1)
|
|
58
58
|
rubocop (>= 1.33.0, < 2.0)
|
|
59
59
|
rubocop-rake (0.6.0)
|
|
60
60
|
rubocop (~> 1.0)
|
|
61
|
-
ruby-progressbar (1.
|
|
62
|
-
ruby_audit (2.
|
|
61
|
+
ruby-progressbar (1.13.0)
|
|
62
|
+
ruby_audit (2.2.0)
|
|
63
63
|
bundler-audit (~> 0.9.0)
|
|
64
|
-
sqlite3 (1.
|
|
65
|
-
sqlite3 (1.
|
|
64
|
+
sqlite3 (1.6.1-x86_64-darwin)
|
|
65
|
+
sqlite3 (1.6.1-x86_64-linux)
|
|
66
|
+
temping (4.0.0)
|
|
67
|
+
activerecord (>= 5.2, < 7.1)
|
|
68
|
+
activesupport (>= 5.2, < 7.1)
|
|
66
69
|
thor (1.2.1)
|
|
67
|
-
tzinfo (2.0.
|
|
70
|
+
tzinfo (2.0.6)
|
|
68
71
|
concurrent-ruby (~> 1.0)
|
|
69
|
-
unicode-display_width (2.
|
|
72
|
+
unicode-display_width (2.4.2)
|
|
70
73
|
|
|
71
74
|
PLATFORMS
|
|
72
75
|
x86_64-darwin-21
|
|
@@ -86,6 +89,7 @@ DEPENDENCIES
|
|
|
86
89
|
ruby_audit
|
|
87
90
|
schnecke!
|
|
88
91
|
sqlite3
|
|
92
|
+
temping (~> 4.0)
|
|
89
93
|
|
|
90
94
|
BUNDLED WITH
|
|
91
95
|
2.3.26
|
data/README.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# Schnecke
|
|
2
2
|
|
|
3
3
|
[](https://dl.circleci.com/status-badge/redirect/gh/prschmid/schnecke/tree/main)
|
|
4
|
+
[](https://badge.fury.io/rb/schnecke)
|
|
4
5
|
|
|
5
6
|
A very simple gem to enable ActiveRecord models to have slugs.
|
|
6
7
|
|
data/lib/schnecke/schnecke.rb
CHANGED
|
@@ -8,10 +8,10 @@ require 'active_support/concern'
|
|
|
8
8
|
module Schnecke
|
|
9
9
|
extend ActiveSupport::Concern
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
SCHNECKE_DEFAULT_SLUG_COLUMN = :slug
|
|
12
|
+
SCHNECKE_DEFAULT_SLUG_SEPARATOR = '-'
|
|
13
|
+
SCHNECKE_DEFAULT_MAX_LENGTH = 32
|
|
14
|
+
SCHNECKE_DEFAULT_REQUIRED_FORMAT = /\A[a-z0-9\-_]+\z/
|
|
15
15
|
|
|
16
16
|
class_methods do
|
|
17
17
|
# rubocop:disable Metrics/AbcSize
|
|
@@ -21,12 +21,14 @@ module Schnecke
|
|
|
21
21
|
# Save the configuration
|
|
22
22
|
self.schnecke_config = {
|
|
23
23
|
slug_source: source,
|
|
24
|
-
slug_column: opts.fetch(:column,
|
|
25
|
-
slug_separator: opts.fetch(:separator,
|
|
26
|
-
limit_length: opts.fetch(:limit_length,
|
|
24
|
+
slug_column: opts.fetch(:column, SCHNECKE_DEFAULT_SLUG_COLUMN),
|
|
25
|
+
slug_separator: opts.fetch(:separator, SCHNECKE_DEFAULT_SLUG_SEPARATOR),
|
|
26
|
+
limit_length: opts.fetch(:limit_length, SCHNECKE_DEFAULT_MAX_LENGTH),
|
|
27
27
|
required: opts.fetch(:required, true),
|
|
28
28
|
generate_on_blank: opts.fetch(:generate_on_blank, true),
|
|
29
|
-
require_format: opts.fetch(
|
|
29
|
+
require_format: opts.fetch(
|
|
30
|
+
:require_format, SCHNECKE_DEFAULT_REQUIRED_FORMAT
|
|
31
|
+
),
|
|
30
32
|
uniqueness: opts.fetch(:uniqueness, {})
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -52,8 +54,8 @@ module Schnecke
|
|
|
52
54
|
|
|
53
55
|
include InstanceMethods
|
|
54
56
|
end
|
|
57
|
+
# rubocop:enable Metrics/AbcSize
|
|
55
58
|
end
|
|
56
|
-
# rubocop:enable Metrics/AbcSize
|
|
57
59
|
|
|
58
60
|
# Instance methods to include
|
|
59
61
|
module InstanceMethods
|
data/lib/schnecke/version.rb
CHANGED
data/schnecke.gemspec
CHANGED
|
@@ -54,6 +54,7 @@ Gem::Specification.new do |spec|
|
|
|
54
54
|
spec.add_development_dependency('rubocop-rake', '>= 0')
|
|
55
55
|
spec.add_development_dependency('ruby_audit', '>= 0')
|
|
56
56
|
spec.add_development_dependency('sqlite3', '>= 0')
|
|
57
|
+
spec.add_development_dependency('temping', '~> 4.0')
|
|
57
58
|
spec.add_runtime_dependency('activerecord', '> 4.2.0')
|
|
58
59
|
spec.add_runtime_dependency('activesupport', '> 4.2.0')
|
|
59
60
|
spec.metadata['rubygems_mfa_required'] = 'true'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: schnecke
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Patrick R. Schmid
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2023-03-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -164,6 +164,20 @@ dependencies:
|
|
|
164
164
|
- - ">="
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: '0'
|
|
167
|
+
- !ruby/object:Gem::Dependency
|
|
168
|
+
name: temping
|
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
|
170
|
+
requirements:
|
|
171
|
+
- - "~>"
|
|
172
|
+
- !ruby/object:Gem::Version
|
|
173
|
+
version: '4.0'
|
|
174
|
+
type: :development
|
|
175
|
+
prerelease: false
|
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
177
|
+
requirements:
|
|
178
|
+
- - "~>"
|
|
179
|
+
- !ruby/object:Gem::Version
|
|
180
|
+
version: '4.0'
|
|
167
181
|
- !ruby/object:Gem::Dependency
|
|
168
182
|
name: activerecord
|
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -204,7 +218,6 @@ files:
|
|
|
204
218
|
- ".rubocop.yml"
|
|
205
219
|
- ".ruby-gemset"
|
|
206
220
|
- ".ruby-version"
|
|
207
|
-
- ".travis.yml"
|
|
208
221
|
- Gemfile
|
|
209
222
|
- Gemfile.lock
|
|
210
223
|
- LICENSE.txt
|