encoded_id-rails 1.0.0.rc1 → 1.0.0.rc7
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/CHANGELOG.md +97 -18
- data/LICENSE.txt +1 -1
- data/README.md +81 -473
- data/context/encoded_id-rails.md +651 -0
- data/context/encoded_id.md +437 -0
- data/lib/encoded_id/rails/active_record_finders.rb +54 -0
- data/lib/encoded_id/rails/annotated_id.rb +14 -9
- data/lib/encoded_id/rails/annotated_id_parser.rb +9 -1
- data/lib/encoded_id/rails/coder.rb +55 -10
- data/lib/encoded_id/rails/composite_id_base.rb +39 -0
- data/lib/encoded_id/rails/configuration.rb +66 -10
- data/lib/encoded_id/rails/encoder_methods.rb +30 -7
- data/lib/encoded_id/rails/finder_methods.rb +11 -0
- data/lib/encoded_id/rails/model.rb +60 -7
- data/lib/encoded_id/rails/path_param.rb +8 -0
- data/lib/encoded_id/rails/persists.rb +55 -9
- data/lib/encoded_id/rails/query_methods.rb +21 -4
- data/lib/encoded_id/rails/railtie.rb +13 -0
- data/lib/encoded_id/rails/salt.rb +8 -0
- data/lib/encoded_id/rails/slugged_id.rb +14 -9
- data/lib/encoded_id/rails/slugged_id_parser.rb +9 -1
- data/lib/encoded_id/rails/slugged_path_param.rb +8 -0
- data/lib/encoded_id/rails.rb +11 -6
- data/lib/generators/encoded_id/rails/install_generator.rb +36 -2
- data/lib/generators/encoded_id/rails/templates/{encoded_id.rb → hashids_encoded_id.rb} +49 -5
- data/lib/generators/encoded_id/rails/templates/sqids_encoded_id.rb +116 -0
- metadata +16 -24
- data/.devcontainer/Dockerfile +0 -17
- data/.devcontainer/compose.yml +0 -10
- data/.devcontainer/devcontainer.json +0 -12
- data/.standard.yml +0 -3
- data/Appraisals +0 -9
- data/Gemfile +0 -24
- data/Rakefile +0 -20
- data/Steepfile +0 -4
- data/gemfiles/.bundle/config +0 -2
- data/gemfiles/rails_7.2.gemfile +0 -19
- data/gemfiles/rails_8.0.gemfile +0 -19
- data/lib/encoded_id/rails/version.rb +0 -7
- data/rbs_collection.yaml +0 -24
- data/sig/encoded_id/rails.rbs +0 -141
data/lib/encoded_id/rails.rb
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# rbs_inline: enabled
|
|
4
|
+
|
|
4
5
|
require_relative "rails/configuration"
|
|
5
6
|
require_relative "rails/coder"
|
|
7
|
+
require_relative "rails/composite_id_base"
|
|
6
8
|
require_relative "rails/slugged_id"
|
|
7
9
|
require_relative "rails/slugged_id_parser"
|
|
8
10
|
require_relative "rails/annotated_id"
|
|
@@ -15,24 +17,27 @@ require_relative "rails/path_param"
|
|
|
15
17
|
require_relative "rails/slugged_path_param"
|
|
16
18
|
require_relative "rails/model"
|
|
17
19
|
require_relative "rails/persists"
|
|
20
|
+
require_relative "rails/active_record_finders"
|
|
21
|
+
require_relative "rails/railtie"
|
|
18
22
|
|
|
19
23
|
module EncodedId
|
|
24
|
+
# Rails integration for EncodedId, providing configuration and ActiveRecord extensions.
|
|
20
25
|
module Rails
|
|
21
26
|
# Configuration
|
|
27
|
+
# @rbs self.@configuration: EncodedId::Rails::Configuration?
|
|
28
|
+
|
|
22
29
|
class << self
|
|
30
|
+
# @rbs return: EncodedId::Rails::Configuration
|
|
23
31
|
def configuration
|
|
24
32
|
@configuration ||= Configuration.new
|
|
25
33
|
end
|
|
26
34
|
|
|
35
|
+
# @rbs () -> EncodedId::Rails::Configuration
|
|
36
|
+
# | () { (EncodedId::Rails::Configuration) -> void } -> EncodedId::Rails::Configuration
|
|
27
37
|
def configure
|
|
28
38
|
yield(configuration) if block_given?
|
|
29
39
|
configuration
|
|
30
40
|
end
|
|
31
41
|
end
|
|
32
42
|
end
|
|
33
|
-
|
|
34
|
-
# Expose directly on EncodedId
|
|
35
|
-
Model = Rails::Model
|
|
36
|
-
PathParam = Rails::PathParam
|
|
37
|
-
SluggedPathParam = Rails::SluggedPathParam
|
|
38
43
|
end
|
|
@@ -9,9 +9,43 @@ module EncodedId
|
|
|
9
9
|
class InstallGenerator < ::Rails::Generators::Base
|
|
10
10
|
source_root File.expand_path(__dir__)
|
|
11
11
|
|
|
12
|
-
desc "Creates an initializer for the gem."
|
|
12
|
+
desc "Creates an encoder-specific initializer for the gem."
|
|
13
|
+
|
|
14
|
+
class_option :encoder,
|
|
15
|
+
type: :string,
|
|
16
|
+
aliases: "-e",
|
|
17
|
+
desc: "Encoder to use (sqids or hashids)",
|
|
18
|
+
default: nil
|
|
19
|
+
|
|
20
|
+
def ask_for_encoder
|
|
21
|
+
@encoder = options[:encoder]
|
|
22
|
+
|
|
23
|
+
@encoder ||= ask("Which encoder would you like to use?",
|
|
24
|
+
limited_to: %w[sqids hashids],
|
|
25
|
+
default: "sqids")
|
|
26
|
+
|
|
27
|
+
unless %w[sqids hashids].include?(@encoder)
|
|
28
|
+
say "Invalid encoder '#{@encoder}'. Must be 'sqids' or 'hashids'.", :red
|
|
29
|
+
exit 1
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
13
33
|
def copy_tasks
|
|
14
|
-
|
|
34
|
+
template_name = (@encoder == "sqids") ? "sqids_encoded_id.rb" : "hashids_encoded_id.rb"
|
|
35
|
+
template "templates/#{template_name}", "config/initializers/encoded_id.rb"
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def show_readme
|
|
39
|
+
say "\n" + ("=" * 70), :green
|
|
40
|
+
if @encoder == "sqids"
|
|
41
|
+
say "Sqids encoder installed!", :green
|
|
42
|
+
say "This encoder does not require a salt and generates URL-safe IDs.", :green
|
|
43
|
+
else
|
|
44
|
+
say "Hashids encoder installed!", :green
|
|
45
|
+
say "⚠️ IMPORTANT: You MUST configure a salt in config/initializers/encoded_id.rb", :yellow
|
|
46
|
+
say "Uncomment and set the 'config.salt' line before using Hashids.", :yellow
|
|
47
|
+
end
|
|
48
|
+
say ("=" * 70) + "\n", :green
|
|
15
49
|
end
|
|
16
50
|
end
|
|
17
51
|
end
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
EncodedId::Rails.configure do |config|
|
|
4
|
+
# The encoder to use for generating encoded IDs.
|
|
5
|
+
#
|
|
6
|
+
# Hashids generates short, unique, non-sequential IDs from numbers using a salt. The salt ensures that
|
|
7
|
+
# the same ID produces different encoded values. Learn more: https://hashids.org
|
|
8
|
+
#
|
|
9
|
+
config.encoder = :hashids
|
|
10
|
+
|
|
4
11
|
# The salt is used in the Hashids algorithm to generate the encoded ID. It ensures that the same ID will result in
|
|
5
12
|
# a different encoded ID. You must configure one and it must be longer that 4 characters. It can be configured on a
|
|
6
13
|
# model by model basis too.
|
|
7
14
|
#
|
|
8
|
-
|
|
15
|
+
config.salt = "<%= SecureRandom.hex(24) %>"
|
|
9
16
|
|
|
10
17
|
# The number of characters of the encoded ID that are grouped before the hyphen separator is inserted.
|
|
11
18
|
# `nil` disables grouping.
|
|
@@ -26,13 +33,13 @@ EncodedId::Rails.configure do |config|
|
|
|
26
33
|
# config.group_separator = "-"
|
|
27
34
|
|
|
28
35
|
# The characters allowed in the encoded ID.
|
|
29
|
-
# Note,
|
|
36
|
+
# Note, Hashids requires at least 16 unique alphabet characters.
|
|
30
37
|
#
|
|
31
38
|
# Default: a reduced character set Crockford alphabet and split groups, see https://www.crockford.com/wrmg/base32.html
|
|
32
39
|
#
|
|
33
40
|
# config.alphabet = ::EncodedId::Alphabet.new("0123456789abcdef")
|
|
34
41
|
|
|
35
|
-
# The minimum length of the encoded ID. Note that this is not a hard limit, the actual length may be longer as
|
|
42
|
+
# The minimum length of the encoded ID. Note that this is not a hard limit, the actual length may be longer as Hashids
|
|
36
43
|
# may expand the length as needed to encode the full input. However encoded IDs will never be shorter than this.
|
|
37
44
|
#
|
|
38
45
|
# 4 -> "abcd"
|
|
@@ -68,11 +75,48 @@ EncodedId::Rails.configure do |config|
|
|
|
68
75
|
#
|
|
69
76
|
# config.annotated_id_separator = "_"
|
|
70
77
|
|
|
71
|
-
# When true, models that include EncodedId::Model will automatically have their to_param method
|
|
78
|
+
# When true, models that include EncodedId::Rails::Model will automatically have their to_param method
|
|
72
79
|
# return the encoded ID (equivalent to also including EncodedId::Rails::PathParam).
|
|
73
|
-
# This makes any model with EncodedId::Model automatically use encoded IDs in URLs.
|
|
80
|
+
# This makes any model with EncodedId::Rails::Model automatically use encoded IDs in URLs.
|
|
74
81
|
#
|
|
75
82
|
# Default: false
|
|
76
83
|
#
|
|
77
84
|
# config.model_to_param_returns_encoded_id = true
|
|
85
|
+
|
|
86
|
+
# When true, the encoded ID will be downcased before decoding. This can be used for
|
|
87
|
+
# case-insensitive matching on a compatible alphabet, but note that encoded IDs are case-sensitive by default.
|
|
88
|
+
# For backwards compatibility with pre-v1 versions, set this to true.
|
|
89
|
+
#
|
|
90
|
+
# Default: false
|
|
91
|
+
#
|
|
92
|
+
# config.downcase_on_decode = false
|
|
93
|
+
|
|
94
|
+
# A list of words that should not appear in generated encoded IDs.
|
|
95
|
+
# For the Hashids encoder, IDs containing blocklisted words will raise an error when generated.
|
|
96
|
+
# Should be an instance of EncodedId::Blocklist, or an Array or Set of strings.
|
|
97
|
+
#
|
|
98
|
+
# Default: EncodedId::Blocklist.empty
|
|
99
|
+
# Available built-in blocklists:
|
|
100
|
+
# - EncodedId::Blocklist.empty - no blocked words
|
|
101
|
+
# - EncodedId::Blocklist.minimal - common English profanity
|
|
102
|
+
#
|
|
103
|
+
# config.blocklist = EncodedId::Blocklist.minimal
|
|
104
|
+
|
|
105
|
+
# Controls when blocklist checking occurs. This can improve performance for apps generating many IDs.
|
|
106
|
+
#
|
|
107
|
+
# Options:
|
|
108
|
+
# - :length_threshold (default) - Only check IDs up to blocklist_max_length characters
|
|
109
|
+
# - :always - Check all IDs regardless of length
|
|
110
|
+
# - :raise_if_likely - Raise error if configuration likely causes performance issues
|
|
111
|
+
#
|
|
112
|
+
# Default: :length_threshold
|
|
113
|
+
#
|
|
114
|
+
# config.blocklist_mode = :length_threshold
|
|
115
|
+
|
|
116
|
+
# Maximum length threshold for blocklist checking when using :length_threshold mode.
|
|
117
|
+
# IDs longer than this will skip blocklist checking for better performance.
|
|
118
|
+
#
|
|
119
|
+
# Default: 32
|
|
120
|
+
#
|
|
121
|
+
# config.blocklist_max_length = 32
|
|
78
122
|
end
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
EncodedId::Rails.configure do |config|
|
|
4
|
+
# The encoder to use for generating encoded IDs.
|
|
5
|
+
#
|
|
6
|
+
# Sqids generates short, unique, URL-safe IDs from numbers. Learn more: https://sqids.org
|
|
7
|
+
#
|
|
8
|
+
config.encoder = :sqids
|
|
9
|
+
|
|
10
|
+
# The number of characters of the encoded ID that are grouped before the hyphen separator is inserted.
|
|
11
|
+
# `nil` disables grouping.
|
|
12
|
+
#
|
|
13
|
+
# nil -> abcdefghijklmnop
|
|
14
|
+
# 4 -> abcd-efgh-ijkl-mnop
|
|
15
|
+
# 8 -> abcdefgh-ijklmnop
|
|
16
|
+
#
|
|
17
|
+
# Default: 4
|
|
18
|
+
#
|
|
19
|
+
# config.character_group_size = 4
|
|
20
|
+
|
|
21
|
+
# The separator used between character groups in the encoded ID.
|
|
22
|
+
# `nil` disables grouping.
|
|
23
|
+
#
|
|
24
|
+
# Default: "-"
|
|
25
|
+
#
|
|
26
|
+
# config.group_separator = "-"
|
|
27
|
+
|
|
28
|
+
# The characters allowed in the encoded ID.
|
|
29
|
+
# Note, Sqids requires at least 5 unique alphabet characters.
|
|
30
|
+
#
|
|
31
|
+
# Default: a reduced character set Crockford alphabet and split groups, see https://www.crockford.com/wrmg/base32.html
|
|
32
|
+
#
|
|
33
|
+
# config.alphabet = ::EncodedId::Alphabet.new("0123456789abcdef")
|
|
34
|
+
|
|
35
|
+
# The minimum length of the encoded ID. Note that this is not a hard limit, the actual length may be longer as Sqids
|
|
36
|
+
# may expand the length as needed to encode the full input. However encoded IDs will never be shorter than this.
|
|
37
|
+
#
|
|
38
|
+
# 4 -> "abcd"
|
|
39
|
+
# 8 -> "abcd-efgh" (with character_group_size = 4)
|
|
40
|
+
#
|
|
41
|
+
# Default: 8
|
|
42
|
+
#
|
|
43
|
+
# config.id_length = 8
|
|
44
|
+
|
|
45
|
+
# The name of the method that returns the value to be used in the slug.
|
|
46
|
+
#
|
|
47
|
+
# Default: :name_for_encoded_id_slug
|
|
48
|
+
#
|
|
49
|
+
# config.slug_value_method_name = :name_for_encoded_id_slug
|
|
50
|
+
|
|
51
|
+
# The separator used between the slug and the encoded ID.
|
|
52
|
+
# `nil` disables grouping.
|
|
53
|
+
#
|
|
54
|
+
# Default: "--"
|
|
55
|
+
#
|
|
56
|
+
# config.slugged_id_separator = "--"
|
|
57
|
+
|
|
58
|
+
# The name of the method that returns the annotation to be used in the annotated ID.
|
|
59
|
+
#
|
|
60
|
+
# Default: :annotation_for_encoded_id
|
|
61
|
+
#
|
|
62
|
+
# config.annotation_method_name = :annotation_for_encoded_id
|
|
63
|
+
|
|
64
|
+
# The separator used between the annotation and the encoded ID.
|
|
65
|
+
# `nil` disables annotation.
|
|
66
|
+
#
|
|
67
|
+
# Default: "_"
|
|
68
|
+
#
|
|
69
|
+
# config.annotated_id_separator = "_"
|
|
70
|
+
|
|
71
|
+
# When true, models that include EncodedId::Rails::Model will automatically have their to_param method
|
|
72
|
+
# return the encoded ID (equivalent to also including EncodedId::Rails::PathParam).
|
|
73
|
+
# This makes any model with EncodedId::Rails::Model automatically use encoded IDs in URLs.
|
|
74
|
+
#
|
|
75
|
+
# Default: false
|
|
76
|
+
#
|
|
77
|
+
# config.model_to_param_returns_encoded_id = true
|
|
78
|
+
|
|
79
|
+
# When true, the encoded ID will be downcased before decoding. This can be used for
|
|
80
|
+
# case-insensitive matching on a compatible alphabet, but note that encoded IDs are case-sensitive by default.
|
|
81
|
+
# For backwards compatibility with pre-v1 versions, set this to true.
|
|
82
|
+
#
|
|
83
|
+
# Default: false
|
|
84
|
+
#
|
|
85
|
+
# config.downcase_on_decode = false
|
|
86
|
+
|
|
87
|
+
# A list of words that should not appear in generated encoded IDs.
|
|
88
|
+
# For the Sqids encoder, the algorithm will automatically avoid generating IDs containing these words.
|
|
89
|
+
# Should be an instance of EncodedId::Blocklist, or an Array or Set of strings.
|
|
90
|
+
#
|
|
91
|
+
# Default: EncodedId::Blocklist.empty
|
|
92
|
+
# Available built-in blocklists:
|
|
93
|
+
# - EncodedId::Blocklist.empty - no blocked words
|
|
94
|
+
# - EncodedId::Blocklist.minimal - common English profanity
|
|
95
|
+
# - EncodedId::Blocklist.sqids_blocklist - the default blocklist from the Sqids gem
|
|
96
|
+
#
|
|
97
|
+
# config.blocklist = EncodedId::Blocklist.minimal
|
|
98
|
+
|
|
99
|
+
# Controls when blocklist checking occurs. This can improve performance for apps generating many IDs.
|
|
100
|
+
#
|
|
101
|
+
# Options:
|
|
102
|
+
# - :length_threshold (default) - Only check IDs up to blocklist_max_length characters
|
|
103
|
+
# - :always - Check all IDs regardless of length
|
|
104
|
+
# - :raise_if_likely - Raise error if configuration likely causes performance issues
|
|
105
|
+
#
|
|
106
|
+
# Default: :length_threshold
|
|
107
|
+
#
|
|
108
|
+
# config.blocklist_mode = :length_threshold
|
|
109
|
+
|
|
110
|
+
# Maximum length threshold for blocklist checking when using :length_threshold mode.
|
|
111
|
+
# IDs longer than this will skip blocklist checking for better performance.
|
|
112
|
+
#
|
|
113
|
+
# Default: 32
|
|
114
|
+
#
|
|
115
|
+
# config.blocklist_max_length = 32
|
|
116
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: encoded_id-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.0.
|
|
4
|
+
version: 1.0.0.rc7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Stephen Ierodiaconou
|
|
8
8
|
bindir: exe
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date:
|
|
10
|
+
date: 2025-11-20 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: activesupport
|
|
@@ -55,14 +55,14 @@ dependencies:
|
|
|
55
55
|
requirements:
|
|
56
56
|
- - '='
|
|
57
57
|
- !ruby/object:Gem::Version
|
|
58
|
-
version: 1.0.0.
|
|
58
|
+
version: 1.0.0.rc7
|
|
59
59
|
type: :runtime
|
|
60
60
|
prerelease: false
|
|
61
61
|
version_requirements: !ruby/object:Gem::Requirement
|
|
62
62
|
requirements:
|
|
63
63
|
- - '='
|
|
64
64
|
- !ruby/object:Gem::Version
|
|
65
|
-
version: 1.0.0.
|
|
65
|
+
version: 1.0.0.rc7
|
|
66
66
|
description: ActiveRecord concern to use EncodedID to turn IDs into reversible and
|
|
67
67
|
human friendly obfuscated strings.
|
|
68
68
|
email:
|
|
@@ -71,24 +71,17 @@ executables: []
|
|
|
71
71
|
extensions: []
|
|
72
72
|
extra_rdoc_files: []
|
|
73
73
|
files:
|
|
74
|
-
- ".devcontainer/Dockerfile"
|
|
75
|
-
- ".devcontainer/compose.yml"
|
|
76
|
-
- ".devcontainer/devcontainer.json"
|
|
77
|
-
- ".standard.yml"
|
|
78
|
-
- Appraisals
|
|
79
74
|
- CHANGELOG.md
|
|
80
|
-
- Gemfile
|
|
81
75
|
- LICENSE.txt
|
|
82
76
|
- README.md
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
- gemfiles/.bundle/config
|
|
86
|
-
- gemfiles/rails_7.2.gemfile
|
|
87
|
-
- gemfiles/rails_8.0.gemfile
|
|
77
|
+
- context/encoded_id-rails.md
|
|
78
|
+
- context/encoded_id.md
|
|
88
79
|
- lib/encoded_id/rails.rb
|
|
80
|
+
- lib/encoded_id/rails/active_record_finders.rb
|
|
89
81
|
- lib/encoded_id/rails/annotated_id.rb
|
|
90
82
|
- lib/encoded_id/rails/annotated_id_parser.rb
|
|
91
83
|
- lib/encoded_id/rails/coder.rb
|
|
84
|
+
- lib/encoded_id/rails/composite_id_base.rb
|
|
92
85
|
- lib/encoded_id/rails/configuration.rb
|
|
93
86
|
- lib/encoded_id/rails/encoder_methods.rb
|
|
94
87
|
- lib/encoded_id/rails/finder_methods.rb
|
|
@@ -96,25 +89,24 @@ files:
|
|
|
96
89
|
- lib/encoded_id/rails/path_param.rb
|
|
97
90
|
- lib/encoded_id/rails/persists.rb
|
|
98
91
|
- lib/encoded_id/rails/query_methods.rb
|
|
92
|
+
- lib/encoded_id/rails/railtie.rb
|
|
99
93
|
- lib/encoded_id/rails/salt.rb
|
|
100
94
|
- lib/encoded_id/rails/slugged_id.rb
|
|
101
95
|
- lib/encoded_id/rails/slugged_id_parser.rb
|
|
102
96
|
- lib/encoded_id/rails/slugged_path_param.rb
|
|
103
|
-
- lib/encoded_id/rails/version.rb
|
|
104
97
|
- lib/generators/encoded_id/rails/USAGE
|
|
105
98
|
- lib/generators/encoded_id/rails/add_columns_generator.rb
|
|
106
99
|
- lib/generators/encoded_id/rails/install_generator.rb
|
|
107
100
|
- lib/generators/encoded_id/rails/templates/add_encoded_id_columns_migration.rb.erb
|
|
108
|
-
- lib/generators/encoded_id/rails/templates/
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
homepage: https://github.com/stevegeek/encoded_id-rails
|
|
101
|
+
- lib/generators/encoded_id/rails/templates/hashids_encoded_id.rb
|
|
102
|
+
- lib/generators/encoded_id/rails/templates/sqids_encoded_id.rb
|
|
103
|
+
homepage: https://github.com/stevegeek/encoded_id
|
|
112
104
|
licenses:
|
|
113
105
|
- MIT
|
|
114
106
|
metadata:
|
|
115
|
-
homepage_uri: https://github.com/stevegeek/encoded_id
|
|
116
|
-
source_code_uri: https://github.com/stevegeek/encoded_id
|
|
117
|
-
changelog_uri: https://github.com/stevegeek/encoded_id
|
|
107
|
+
homepage_uri: https://github.com/stevegeek/encoded_id
|
|
108
|
+
source_code_uri: https://github.com/stevegeek/encoded_id
|
|
109
|
+
changelog_uri: https://github.com/stevegeek/encoded_id/blob/main/CHANGELOG.md
|
|
118
110
|
rdoc_options: []
|
|
119
111
|
require_paths:
|
|
120
112
|
- lib
|
|
@@ -129,7 +121,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
129
121
|
- !ruby/object:Gem::Version
|
|
130
122
|
version: '0'
|
|
131
123
|
requirements: []
|
|
132
|
-
rubygems_version: 3.6.
|
|
124
|
+
rubygems_version: 3.6.2
|
|
133
125
|
specification_version: 4
|
|
134
126
|
summary: Use `encoded_id` with ActiveRecord models
|
|
135
127
|
test_files: []
|
data/.devcontainer/Dockerfile
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version or gemspec
|
|
2
|
-
ARG RUBY_VERSION=3.4.2
|
|
3
|
-
FROM ghcr.io/rails/devcontainer/images/ruby:$RUBY_VERSION
|
|
4
|
-
|
|
5
|
-
USER root
|
|
6
|
-
|
|
7
|
-
# Install pkg-config and SQLite development libraries
|
|
8
|
-
RUN apt-get update -qq && \
|
|
9
|
-
apt-get install -y pkg-config libsqlite3-dev && \
|
|
10
|
-
apt-get clean && \
|
|
11
|
-
rm -rf /var/lib/apt/lists/*
|
|
12
|
-
|
|
13
|
-
USER vscode
|
|
14
|
-
|
|
15
|
-
# Ensure binding is always 0.0.0.0
|
|
16
|
-
# Binds the server to all IP addresses of the container, so it can be accessed from outside the container.
|
|
17
|
-
ENV BINDING="0.0.0.0"
|
data/.devcontainer/compose.yml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "Encoded ID Rails Gem Development",
|
|
3
|
-
"dockerComposeFile": "compose.yml",
|
|
4
|
-
"service": "encoded-id-rails-dev-env",
|
|
5
|
-
"containerEnv": {
|
|
6
|
-
"RAILS_ENV": "development"
|
|
7
|
-
},
|
|
8
|
-
"forwardPorts": [3000],
|
|
9
|
-
"postCreateCommand": "bundle install && bundle exec appraisal install",
|
|
10
|
-
"postStartCommand": "bundle exec rake test",
|
|
11
|
-
"remoteUser": "vscode"
|
|
12
|
-
}
|
data/.standard.yml
DELETED
data/Appraisals
DELETED
data/Gemfile
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
# Specify your gem's dependencies in encoded_id-rails.gemspec
|
|
6
|
-
gemspec
|
|
7
|
-
|
|
8
|
-
group :development, :test do
|
|
9
|
-
gem "rake", "~> 13.0"
|
|
10
|
-
|
|
11
|
-
gem "minitest", "~> 5.0"
|
|
12
|
-
|
|
13
|
-
gem "standard", "~> 1.30"
|
|
14
|
-
|
|
15
|
-
gem "steep", "~> 1.5"
|
|
16
|
-
|
|
17
|
-
gem "rails"
|
|
18
|
-
|
|
19
|
-
gem "sqlite3"
|
|
20
|
-
|
|
21
|
-
gem "appraisal"
|
|
22
|
-
|
|
23
|
-
gem "simplecov"
|
|
24
|
-
end
|
data/Rakefile
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
require "bundler/gem_tasks"
|
|
4
|
-
require "rake/testtask"
|
|
5
|
-
|
|
6
|
-
Rake::TestTask.new(:test) do |t|
|
|
7
|
-
t.libs << "test"
|
|
8
|
-
t.libs << "lib"
|
|
9
|
-
t.test_files = FileList["test/**/*_test.rb"]
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
desc "Run tests with coverage"
|
|
13
|
-
task :coverage do
|
|
14
|
-
ENV["COVERAGE"] = "true"
|
|
15
|
-
Rake::Task["test"].invoke
|
|
16
|
-
end
|
|
17
|
-
|
|
18
|
-
require "standard/rake"
|
|
19
|
-
|
|
20
|
-
task default: %i[test standard]
|
data/Steepfile
DELETED
data/gemfiles/.bundle/config
DELETED
data/gemfiles/rails_7.2.gemfile
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# This file was generated by Appraisal
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem "activesupport", "~> 7.2.0"
|
|
6
|
-
gem "activerecord", "~> 7.2.0"
|
|
7
|
-
|
|
8
|
-
group :development, :test do
|
|
9
|
-
gem "rake", "~> 13.0"
|
|
10
|
-
gem "minitest", "~> 5.0"
|
|
11
|
-
gem "standard", "~> 1.30"
|
|
12
|
-
gem "steep", "~> 1.5"
|
|
13
|
-
gem "rails"
|
|
14
|
-
gem "sqlite3"
|
|
15
|
-
gem "appraisal"
|
|
16
|
-
gem "simplecov"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
gemspec path: "../"
|
data/gemfiles/rails_8.0.gemfile
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
# This file was generated by Appraisal
|
|
2
|
-
|
|
3
|
-
source "https://rubygems.org"
|
|
4
|
-
|
|
5
|
-
gem "activesupport", "~> 8.0.0"
|
|
6
|
-
gem "activerecord", "~> 8.0.0"
|
|
7
|
-
|
|
8
|
-
group :development, :test do
|
|
9
|
-
gem "rake", "~> 13.0"
|
|
10
|
-
gem "minitest", "~> 5.0"
|
|
11
|
-
gem "standard", "~> 1.30"
|
|
12
|
-
gem "steep", "~> 1.5"
|
|
13
|
-
gem "rails"
|
|
14
|
-
gem "sqlite3"
|
|
15
|
-
gem "appraisal"
|
|
16
|
-
gem "simplecov"
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
gemspec path: "../"
|
data/rbs_collection.yaml
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
# Download sources
|
|
2
|
-
sources:
|
|
3
|
-
- name: ruby/gem_rbs_collection
|
|
4
|
-
remote: https://github.com/ruby/gem_rbs_collection.git
|
|
5
|
-
revision: main
|
|
6
|
-
repo_dir: gems
|
|
7
|
-
|
|
8
|
-
# A directory to install the downloaded RBSs
|
|
9
|
-
path: .gem_rbs_collection
|
|
10
|
-
|
|
11
|
-
gems:
|
|
12
|
-
- name: cgi
|
|
13
|
-
# Skip loading rbs gem's RBS.
|
|
14
|
-
# It's unnecessary if you don't use rbs as a library.
|
|
15
|
-
- name: rbs
|
|
16
|
-
ignore: true
|
|
17
|
-
- name: rake
|
|
18
|
-
ignore: true
|
|
19
|
-
- name: minitest
|
|
20
|
-
ignore: true
|
|
21
|
-
- name: standard
|
|
22
|
-
ignore: true
|
|
23
|
-
- name: steep
|
|
24
|
-
ignore: true
|