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 cb835b6

Browse files
committed
8.0.0.beta1
1 parent e08902c commit cb835b6

File tree

27 files changed

+702
-413
lines changed

27 files changed

+702
-413
lines changed

‎.dockerignore‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
# Ignore bundler config.
88
/.bundle
99

10-
# Ignore all environment files (except templates).
10+
# Ignore all environment files.
1111
/.env*
12-
!/.env*.erb
1312

1413
# Ignore all default key files.
1514
/config/master.key

‎.gitignore‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
# Ignore bundler config.
88
/.bundle
99

10-
# Ignore all environment files (except templates).
10+
# Ignore all environment files.
1111
/.env*
12-
!/.env*.erb
1312

1413
# Ignore all logfiles and tempfiles.
1514
/log/*

‎Dockerfile‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# syntax = docker/dockerfile:1
1+
# syntax=docker/dockerfile:1
2+
# check=error=true
23

34
# 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
5+
# docker build -t railsdiff .
6+
# docker run -d -p 80:80 -e RAILS_MASTER_KEY=<value from config/master.key> --name railsdiff railsdiff
7+
8+
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
69

710
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
811
ARG RUBY_VERSION=your-ruby-version
@@ -64,6 +67,6 @@ USER 1000:1000
6467
# Entrypoint prepares the database.
6568
ENTRYPOINT ["/rails/bin/docker-entrypoint"]
6669

67-
# Start the server by default, this can be overwritten at runtime
68-
EXPOSE 3000
69-
CMD ["./bin/rails", "server"]
70+
# Start server via Thruster by default, this can be overwritten at runtime
71+
EXPOSE 80
72+
CMD ["./bin/thrust", "./bin/rails", "server"]

‎Gemfile‎

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

33
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
4-
gem "rails", "~> 7.2.2",">= 7.2.2.1"
5-
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
6-
gem "sprockets-rails"
4+
gem "rails", "~> 8.0.0.beta1"
5+
# The modern asset pipeline for Rails [https://github.com/rails/propshaft]
6+
gem "propshaft"
77
# Use sqlite3 as the database for Active Record
8-
gem "sqlite3", ">= 1.4"
8+
gem "sqlite3", ">= 2.1"
99
# Use the Puma web server [https://github.com/puma/puma]
1010
gem "puma", ">= 5.0"
1111
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
@@ -16,21 +16,27 @@ gem "turbo-rails"
1616
gem "stimulus-rails"
1717
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
1818
gem "jbuilder"
19-
# Use Redis adapter to run Action Cable in production
20-
# gem "redis", ">= 4.0.1"
21-
22-
# Use Kredis to get higher-level data types in Redis [https://github.com/rails/kredis]
23-
# gem "kredis"
2419

2520
# Use Active Model has_secure_password [https://guides.rubyonrails.org/active_model_basics.html#securepassword]
2621
# gem "bcrypt", "~> 3.1.7"
2722

2823
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
2924
gem "tzinfo-data", platforms: %i[ windows jruby ]
3025

26+
# Use the database-backed adapters for Rails.cache, Active Job, and Action Cable
27+
gem "solid_cache"
28+
gem "solid_queue"
29+
gem "solid_cable"
30+
3131
# Reduces boot times through caching; required in config/boot.rb
3232
gem "bootsnap", require: false
3333

34+
# Deploy this application anywhere as a Docker container [https://kamal-deploy.org]
35+
gem "kamal", ">= 2.0.0.rc2", require: false
36+
37+
# Add HTTP asset caching/compression and X-Sendfile acceleration to Puma [https://github.com/basecamp/thruster/]
38+
gem "thruster", require: false
39+
3440
# Use Active Storage variants [https://guides.rubyonrails.org/active_storage_overview.html#transforming-images]
3541
# gem "image_processing", "~> 1.2"
3642

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
/*
2-
* This is a manifest file that'll be compiled into application.css, which will include all the files
3-
* listed below.
2+
* This is a manifest file that'll be compiled into application.css.
43
*
5-
* Any CSS (and SCSS, if configured) file within this directory, lib/assets/stylesheets, or any plugin's
6-
* vendor/assets/stylesheets directory can be referenced here using a relative path.
4+
* With Propshaft, assets are served efficiently without preprocessing steps. You can still include
5+
* application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
6+
* cascading order, meaning styles declared later in the document or manifest will override earlier ones,
7+
* depending on specificity.
78
*
8-
* You're free to add application-wide styles to this file and they'll appear at the bottom of the
9-
* compiled file so the styles you add here take precedence over styles defined in any other CSS
10-
* files in this directory. Styles in this file should be added after the last require_* statement.
11-
* It is generally better to create a new file per style scope.
12-
*
13-
*= require_tree .
14-
*= require_self
9+
* Consider organizing styles into separate files for maintainability.
1510
*/

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,21 @@
44
<title><%= content_for(:title) || "Railsdiff" %></title>
55
<meta name="viewport" content="width=device-width,initial-scale=1">
66
<meta name="apple-mobile-web-app-capable" content="yes">
7+
<meta name="mobile-web-app-capable" content="yes">
78
<%= csrf_meta_tags %>
89
<%= csp_meta_tag %>
910

1011
<%= yield :head %>
1112

12-
<link rel="manifest" href="/manifest.json">
13+
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
14+
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
15+
1316
<link rel="icon" href="/icon.png" type="image/png">
1417
<link rel="icon" href="/icon.svg" type="image/svg+xml">
1518
<link rel="apple-touch-icon" href="/icon.png">
16-
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
19+
20+
<%# Includes all stylesheet files in app/views/stylesheets %>
21+
<%= stylesheet_link_tag :app, "data-turbo-track": "reload" %>
1722
</head>
1823

1924
<body>

‎bin/dev‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env ruby
2+
exec "./bin/rails", "server", *ARGV

‎bin/docker-entrypoint‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#!/bin/bash -e
22

33
# Enable jemalloc for reduced memory usage and latency.
4-
if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then
5-
export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)"
4+
if [ -z "${LD_PRELOAD+x}" ]; then
5+
LD_PRELOAD=$(find /usr/lib -name libjemalloc.so.2 -print -quit)
6+
export LD_PRELOAD
67
fi
78

89
# If running the rails server then create or migrate existing database
9-
if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then
10+
if [ "${@: -2:1}" == "./bin/rails" ] && [ "${@: -1:1}" == "server" ]; then
1011
./bin/rails db:prepare
1112
fi
1213

‎bin/setup‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ FileUtils.chdir APP_ROOT do
1414
# Add necessary setup steps to this file.
1515

1616
puts "== Installing dependencies =="
17-
system! "gem install bundler --conservative"
1817
system("bundle check") || system!("bundle install")
1918

2019
# puts "\n== Copying sample files =="
@@ -28,10 +27,9 @@ FileUtils.chdir APP_ROOT do
2827
puts "\n== Removing old logs and tempfiles =="
2928
system! "bin/rails log:clear tmp:clear"
3029

31-
puts "\n== Restarting application server =="
32-
system! "bin/rails restart"
33-
34-
# puts "\n== Configuring puma-dev =="
35-
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
36-
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
30+
unless ARGV.include?("--skip-server")
31+
puts "\n== Starting development server =="
32+
STDOUT.flush # flush the output before exec(2) so that it displays
33+
exec "bin/dev"
34+
end
3735
end

‎bin/thrust‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env ruby
2+
require "rubygems"
3+
require "bundler/setup"
4+
5+
load Gem.bin_path("thruster", "thrust")

0 commit comments

Comments
(0)

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