Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 686144b

Browse files
committed
7.2.0.beta1
1 parent 06d7b36 commit 686144b

31 files changed

+378
-80
lines changed

‎.dockerignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
# Ignore git directory.
44
/.git/
5+
/.gitignore
56

67
# Ignore bundler config.
78
/.bundle
@@ -35,3 +36,13 @@
3536
/app/assets/builds/*
3637
!/app/assets/builds/.keep
3738
/public/assets
39+
40+
# Ignore CI service files.
41+
/.github
42+
43+
# Ignore development files
44+
/.devcontainer
45+
46+
# Ignore Docker-related files
47+
/.dockerignore
48+
/Dockerfile*

‎.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: bundler
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

‎.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [ main ]
7+
8+
jobs:
9+
scan_ruby:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Set up Ruby
17+
uses: ruby/setup-ruby@v1
18+
with:
19+
ruby-version: .ruby-version
20+
bundler-cache: true
21+
22+
- name: Scan for security vulnerabilities in Ruby dependencies
23+
run: bin/brakeman --no-pager
24+
25+
scan_js:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@v4
31+
32+
- name: Set up Ruby
33+
uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: .ruby-version
36+
bundler-cache: true
37+
38+
- name: Scan for security vulnerabilities in JavaScript dependencies
39+
run: bin/importmap audit
40+
41+
lint:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout code
45+
uses: actions/checkout@v4
46+
47+
- name: Set up Ruby
48+
uses: ruby/setup-ruby@v1
49+
with:
50+
ruby-version: .ruby-version
51+
bundler-cache: true
52+
53+
- name: Lint code for consistent style
54+
run: bin/rubocop -f github
55+
56+
test:
57+
runs-on: ubuntu-latest
58+
59+
# services:
60+
# redis:
61+
# image: redis
62+
# ports:
63+
# - 6379:6379
64+
# options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5
65+
steps:
66+
- name: Install packages
67+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libsqlite3-0 libvips libsqlite3-0
68+
69+
- name: Checkout code
70+
uses: actions/checkout@v4
71+
72+
- name: Set up Ruby
73+
uses: ruby/setup-ruby@v1
74+
with:
75+
ruby-version: .ruby-version
76+
bundler-cache: true
77+
78+
- name: Run tests
79+
env:
80+
RAILS_ENV: test
81+
# REDIS_URL: redis://localhost:6379/0
82+
run: bin/rails db:test:prepare test test:system
83+
84+
- name: Keep screenshots from failed system tests
85+
uses: actions/upload-artifact@v4
86+
if: failure()
87+
with:
88+
name: screenshots
89+
path: ${{ github.workspace }}/tmp/screenshots
90+
if-no-files-found: ignore

‎.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
22
#
3-
# If you find yourself ignoring temporary files generated by your text editor
4-
# or operating system, you probably want to add a global ignore instead:
5-
# git config --global core.excludesfile '~/.gitignore_global'
3+
# Temporary files generated by your text editor or operating system
4+
# belong in git's global ignore instead:
5+
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`
66

77
# Ignore bundler config.
88
/.bundle

‎.rubocop.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Omakase Ruby styling for Rails
2+
inherit_gem: { rubocop-rails-omakase: rubocop.yml }
3+
4+
# Overwrite or add rules to create your own house style
5+
#
6+
# # Use `[a, [b, c]]` not `[ a, [ b, c ] ]`
7+
# Layout/SpaceInsideArrayLiteralBrackets:
8+
# Enabled: false

‎.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
your-ruby-version

‎Dockerfile

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,36 @@
11
# syntax = docker/dockerfile:1
22

3-
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
3+
# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand:
4+
# docker build -t my-app .
5+
# docker run -d -p 80:80 -p 443:443 --name my-app -e RAILS_MASTER_KEY=<value from config/master.key> my-app
6+
7+
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
8+
9+
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
410
ARG RUBY_VERSION=your-ruby-version
5-
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
11+
FROM docker.io/library/ruby:$RUBY_VERSION-slim as base
612

713
# Rails app lives here
814
WORKDIR /rails
915

16+
# Install base packages
17+
RUN apt-get update -qq && \
18+
apt-get install --no-install-recommends -y curl libjemalloc2 libsqlite3-0 libvips && \
19+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
20+
1021
# Set production environment
1122
ENV RAILS_ENV="production" \
1223
BUNDLE_DEPLOYMENT="1" \
1324
BUNDLE_PATH="/usr/local/bundle" \
1425
BUNDLE_WITHOUT="development"
1526

16-
1727
# Throw-away build stage to reduce size of final image
1828
FROM base as build
1929

2030
# Install packages needed to build gems
2131
RUN apt-get update -qq && \
22-
apt-get install --no-install-recommends -y build-essential git libvips pkg-config
32+
apt-get install --no-install-recommends -y build-essential git pkg-config && \
33+
rm -rf /var/lib/apt/lists /var/cache/apt/archives
2334

2435
# Install application gems
2536
COPY Gemfile Gemfile.lock ./
@@ -37,22 +48,20 @@ RUN bundle exec bootsnap precompile app/ lib/
3748
RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
3849

3950

51+
52+
4053
# Final stage for app image
4154
FROM base
4255

43-
# Install packages needed for deployment
44-
RUN apt-get update -qq && \
45-
apt-get install --no-install-recommends -y curl libsqlite3-0 libvips && \
46-
rm -rf /var/lib/apt/lists /var/cache/apt/archives
47-
4856
# Copy built artifacts: gems, application
49-
COPY --from=build /usr/local/bundle /usr/local/bundle
57+
COPY --from=build "${BUNDLE_PATH}""${BUNDLE_PATH}"
5058
COPY --from=build /rails /rails
5159

5260
# Run and own only the runtime files as a non-root user for security
53-
RUN useradd rails --create-home --shell /bin/bash && \
61+
RUN groupadd --system --gid 1000 rails && \
62+
useradd rails --uid 1000 --gid 1000 --create-home --shell /bin/bash && \
5463
chown -R rails:rails db log storage tmp
55-
USER rails:rails
64+
USER 1000:1000
5665

5766
# Entrypoint prepares the database.
5867
ENTRYPOINT ["/rails/bin/docker-entrypoint"]

‎Gemfile

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
11
source "https://rubygems.org"
22

3-
ruby "your-ruby-version"
4-
53
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
6-
gem "rails", "~> 7.1.5", ">= 7.1.5.2"
7-
4+
gem "rails", "~> 7.2.0.beta1"
85
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
96
gem "sprockets-rails"
10-
117
# Use sqlite3 as the database for Active Record
128
gem "sqlite3", ">= 1.4"
13-
149
# Use the Puma web server [https://github.com/puma/puma]
1510
gem "puma", ">= 5.0"
16-
1711
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
1812
gem "importmap-rails"
19-
2013
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
2114
gem "turbo-rails"
22-
2315
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
2416
gem "stimulus-rails"
25-
2617
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
2718
gem "jbuilder"
28-
2919
# Use Redis adapter to run Action Cable in production
3020
# gem "redis", ">= 4.0.1"
3121

@@ -46,18 +36,18 @@ gem "bootsnap", require: false
4636

4737
group :development, :test do
4838
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
49-
gem "debug", platforms: %i[ mri windows ]
39+
gem "debug", platforms: %i[ mri windows ], require: "debug/prelude"
40+
41+
# Static analysis for security vulnerabilities [https://brakemanscanner.org/]
42+
gem "brakeman", require: false
43+
44+
# Omakase Ruby styling [https://github.com/rails/rubocop-rails-omakase/]
45+
gem "rubocop-rails-omakase", require: false
5046
end
5147

5248
group :development do
5349
# Use console on exceptions pages [https://github.com/rails/web-console]
5450
gem "web-console"
55-
56-
# Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
57-
# gem "rack-mini-profiler"
58-
59-
# Speed up commands on slow machines / big apps [https://github.com/rails/spring]
60-
# gem "spring"
6151
end
6252

6353
group :test do
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
class ApplicationController < ActionController::Base
2+
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
3+
allow_browser versions: :modern
24
end

‎app/views/layouts/application.html.erb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>Railsdiff</title>
4+
<title><%=content_for(:title) || "Railsdiff"%></title>
55
<meta name="viewport" content="width=device-width,initial-scale=1">
6+
<meta name="apple-mobile-web-app-capable" content="yes">
67
<%= csrf_meta_tags %>
78
<%= csp_meta_tag %>
89

10+
<%= yield :head %>
11+
12+
<link rel="manifest" href="/manifest.json">
13+
<link rel="icon" href="/icon.png" type="image/png">
14+
<link rel="icon" href="/icon.svg" type="image/svg+xml">
15+
<link rel="apple-touch-icon" href="/icon.png">
916
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
1017
</head>
1118

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /