-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9593738
commit cd3c36a
Showing
55 changed files
with
1,418 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,7 @@ end | |
appraise '7.2' do | ||
gem 'rails', '~> 7.2.0' | ||
end | ||
|
||
appraise '8.0' do | ||
gem 'rails', '~> 8.0.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file was generated by Appraisal | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "rails", "~> 8.0.0" | ||
|
||
gemspec path: "../" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module SaferRailsConsole | ||
VERSION = '0.10.0' | ||
VERSION = '0.11.0' | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files. | ||
|
||
# Ignore git directory. | ||
/.git/ | ||
/.gitignore | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all environment files. | ||
/.env* | ||
|
||
# Ignore all default key files. | ||
/config/master.key | ||
/config/credentials/*.key | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
|
||
# Ignore storage (uploaded files in development and any SQLite databases). | ||
/storage/* | ||
|
||
# Ignore assets. | ||
/node_modules/ | ||
/app/assets/builds/* | ||
!/app/assets/builds/.keep | ||
/public/assets | ||
|
||
# Ignore CI service files. | ||
/.github | ||
|
||
# Ignore development files | ||
/.devcontainer | ||
|
||
# Ignore Docker-related files | ||
/.dockerignore | ||
/Dockerfile* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# See https://git-scm.com/docs/gitattributes for more about git attribute files. | ||
|
||
# Mark the database schema as having been generated. | ||
db/schema.rb linguist-generated | ||
|
||
# Mark any vendored files as having been vendored. | ||
vendor/* linguist-vendored | ||
config/credentials/*.yml.enc diff=rails_credentials | ||
config/credentials.yml.enc diff=rails_credentials |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# See https://help.github.com/articles/ignoring-files for more about ignoring files. | ||
# | ||
# Temporary files generated by your text editor or operating system | ||
# belong in git's global ignore instead: | ||
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore` | ||
|
||
# Ignore bundler config. | ||
/.bundle | ||
|
||
# Ignore all environment files. | ||
/.env* | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
|
||
# Ignore storage (uploaded files in development and any SQLite databases). | ||
/storage/* | ||
|
||
/public/assets | ||
|
||
# Ignore master key for decrypting credentials and more. | ||
/config/master.key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
# syntax=docker/dockerfile:1 | ||
# check=error=true | ||
|
||
# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand: | ||
# docker build -t rails_8_0 . | ||
# docker run -d -p 80:80 -e RAILS_MASTER_KEY=<value from config/master.key> --name rails_8_0 rails_8_0 | ||
|
||
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html | ||
|
||
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version | ||
ARG RUBY_VERSION=3.3.5 | ||
FROM docker.io/library/ruby:$RUBY_VERSION-slim AS base | ||
|
||
# Rails app lives here | ||
WORKDIR /rails | ||
|
||
# Install base packages | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y curl libjemalloc2 postgresql-client && \ | ||
rm -rf /var/lib/apt/lists /var/cache/apt/archives | ||
|
||
# Set production environment | ||
ENV RAILS_ENV="production" \ | ||
BUNDLE_DEPLOYMENT="1" \ | ||
BUNDLE_PATH="/usr/local/bundle" \ | ||
BUNDLE_WITHOUT="development" | ||
|
||
# Throw-away build stage to reduce size of final image | ||
FROM base AS build | ||
|
||
# Install packages needed to build gems | ||
RUN apt-get update -qq && \ | ||
apt-get install --no-install-recommends -y build-essential git libpq-dev pkg-config && \ | ||
rm -rf /var/lib/apt/lists /var/cache/apt/archives | ||
|
||
# Install application gems | ||
COPY Gemfile Gemfile.lock ./ | ||
RUN bundle install && \ | ||
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git | ||
|
||
# Copy application code | ||
COPY . . | ||
|
||
|
||
|
||
|
||
# Final stage for app image | ||
FROM base | ||
|
||
# Copy built artifacts: gems, application | ||
COPY --from=build "${BUNDLE_PATH}" "${BUNDLE_PATH}" | ||
COPY --from=build /rails /rails | ||
|
||
# Run and own only the runtime files as a non-root user for security | ||
RUN groupadd --system --gid 1000 rails && \ | ||
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \ | ||
chown -R rails:rails db log tmp | ||
USER 1000:1000 | ||
|
||
# Entrypoint prepares the database. | ||
ENTRYPOINT ["/rails/bin/docker-entrypoint"] | ||
|
||
# Start server via Thruster by default, this can be overwritten at runtime | ||
EXPOSE 80 | ||
CMD ["./bin/thrust", "./bin/rails", "server"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# frozen_string_literal: true | ||
|
||
# Generated with: | ||
# rails new -JABTCM --skip-keeps --skip-active-storage --skip-system-test --skip-bootsnap --skip-hotwire -d postgresql spec/internal/rails_8_0 | ||
# Then modified to match the others | ||
|
||
source "https://rubygems.org" | ||
|
||
gem "mysql2" | ||
gem "pg" | ||
gem "rails", "~> 8.0.0" | ||
|
||
|
||
gem 'safer_rails_console', path: '../../../' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# README | ||
|
||
This README would normally document whatever steps are necessary to get the | ||
application up and running. | ||
|
||
Things you may want to cover: | ||
|
||
* Ruby version | ||
|
||
* System dependencies | ||
|
||
* Configuration | ||
|
||
* Database creation | ||
|
||
* Database initialization | ||
|
||
* How to run the test suite | ||
|
||
* Services (job queues, cache servers, search engines, etc.) | ||
|
||
* Deployment instructions | ||
|
||
* ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Add your own tasks in files placed in lib/tasks ending in .rake, | ||
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. | ||
|
||
require_relative "config/application" | ||
|
||
Rails.application.load_tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/* Application styles */ |
4 changes: 4 additions & 0 deletions
4
spec/internal/rails_8_0/app/controllers/application_controller.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
class ApplicationController < ActionController::Base | ||
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. | ||
allow_browser versions: :modern | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ApplicationHelper | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class ApplicationJob < ActiveJob::Base | ||
# Automatically retry jobs that encountered a deadlock | ||
# retry_on ActiveRecord::Deadlocked | ||
|
||
# Most jobs are safe to ignore if the underlying records are no longer available | ||
# discard_on ActiveJob::DeserializationError | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class ApplicationRecord < ActiveRecord::Base | ||
primary_abstract_class | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# frozen_string_literal: true | ||
|
||
class Model < ApplicationRecord | ||
end |
27 changes: 27 additions & 0 deletions
27
spec/internal/rails_8_0/app/views/layouts/application.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title><%= content_for(:title) || "Rails 8 0" %></title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<meta name="apple-mobile-web-app-capable" content="yes"> | ||
<meta name="mobile-web-app-capable" content="yes"> | ||
<%= csrf_meta_tags %> | ||
<%= csp_meta_tag %> | ||
<%= yield :head %> | ||
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %> | ||
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %> | ||
|
||
<link rel="icon" href="/icon.png" type="image/png"> | ||
<link rel="icon" href="/icon.svg" type="image/svg+xml"> | ||
<link rel="apple-touch-icon" href="/icon.png"> | ||
|
||
<%# Includes all stylesheet files in app/assets/stylesheets %> | ||
<%= stylesheet_link_tag "application" %> | ||
</head> | ||
|
||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |
Oops, something went wrong.