Skip to content
This repository was archived by the owner on Apr 22, 2025. It is now read-only.

Commit 1a57ac9

Browse files
committed
Add new Persist module to persist encoded ids in database if desired (w ActiveRecord). Also add devcontainer,set minimum rails and ruby versiont to supported ones
1 parent 81e9d70 commit 1a57ac9

File tree

21 files changed

+182
-437
lines changed

21 files changed

+182
-437
lines changed

.devcontainer/Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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"

.devcontainer/compose.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "encoded_id-rails"
2+
3+
services:
4+
encoded-id-rails-dev-env:
5+
container_name: encoded-id-rails-dev-env
6+
build:
7+
context: ..
8+
dockerfile: .devcontainer/Dockerfile
9+
ports:
10+
- "3000"

.devcontainer/devcontainer.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
}

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
strategy:
1010
fail-fast: false
1111
matrix:
12-
ruby: [ "3.0", "3.1", "3.2", "3.3" ]
13-
rails: [ "6.1", "7.0", "7.1" ]
12+
ruby: [ "3.2", "3.3", "3.4" ]
13+
rails: [ "7.2", "8.0" ]
1414
steps:
1515
- uses: actions/checkout@v3
1616
- name: Set up Ruby

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ rbs_collection.lock.yaml
1313
.tool-versions
1414
test.db
1515
test.log
16+
gemfiles/*.lock

Appraisals

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
appraise "rails-6.1" do
2-
gem "activesupport", "~> 6.1.7", ">= 6.1.0"
3-
gem "activerecord", "~> 6.1.7", ">= 6.1.0"
1+
appraise "rails-7.2" do
2+
gem "activesupport", "~> 7.2.0"
3+
gem "activerecord", "~> 7.2.0"
44
end
55

6-
appraise "rails-7.0" do
7-
gem "activesupport", "~> 7.0.4"
8-
gem "activerecord", "~> 7.0.4"
9-
end
10-
11-
appraise "rails-7.1" do
12-
gem "activesupport", "~> 7.1"
13-
gem "activerecord", "~> 7.1"
6+
appraise "rails-8.0" do
7+
gem "activesupport", "~> 8.0.0"
8+
gem "activerecord", "~> 8.0.0"
149
end

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,7 @@ group :development, :test do
1414

1515
gem "steep", "~> 1.5"
1616

17-
gem "sqlite3", "~> 1.5"
17+
gem "sqlite3"
1818
end
19+
20+
gem "appraisal"

encoded_id-rails.gemspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
1212
spec.description = "ActiveRecord concern to use EncodedID to turn IDs into reversible and human friendly obfuscated strings."
1313
spec.homepage = "https://github.com/stevegeek/encoded_id-rails"
1414
spec.license = "MIT"
15-
spec.required_ruby_version = ">= 2.6.0"
15+
spec.required_ruby_version = ">= 3.2.0"
1616

1717
spec.metadata["homepage_uri"] = spec.homepage
1818
spec.metadata["source_code_uri"] = "https://github.com/stevegeek/encoded_id-rails"
@@ -30,9 +30,9 @@ Gem::Specification.new do |spec|
3030
spec.require_paths = ["lib"]
3131

3232
# Uncomment to register a new dependency of your gem
33-
spec.add_dependency "activesupport", ">= 6.0", "< 8.0"
34-
spec.add_dependency "activerecord", ">= 6.0", "< 8.0"
35-
spec.add_dependency "encoded_id", "~> 1.0.0.rc4"
33+
spec.add_dependency "activesupport", ">= 7.2", "< 9"
34+
spec.add_dependency "activerecord", ">= 7.2", "< 9"
35+
spec.add_dependency "encoded_id", "1.0.0.rc5" # "~> 1.0.0", "< 2.0"
3636
spec.add_development_dependency "appraisal"
3737

3838
# For more information and examples about making a new gem, check out our

gemfiles/rails_6.1.gemfile.lock

Lines changed: 0 additions & 130 deletions
This file was deleted.

gemfiles/rails_7.0.gemfile

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)