Browse Source

easygoing

main
pvincent 4 months ago
parent
commit
b23604b74a
  1. 46
      README.md
  2. 2
      app/views/layouts/application.html.erb
  3. 2
      app/views/scores/edit.html.erb
  4. 2
      app/views/scores/index.html.erb
  5. 6
      config/application.rb
  6. 6
      config/boot.rb
  7. 2
      config/environment.rb
  8. 10
      config/importmap.rb
  9. 18
      config/puma.rb

46
README.md

@ -1,4 +1,4 @@
# README
# Easy Going Rails
## Install from scratch Debian 12 (bookworm)
@ -26,29 +26,27 @@ development:
rails generate scaffold score name:string grade:integer
rails db:migrate
## Gemfile
```yaml
group :development do
[...]
gem 'rubocop', require: false
end
```
## Debugger via ruby-lsp
* run OK, but without Procfile (no more tailwincss/watch)
* attach disfunctions (attach PORT but no interaction/stop/run)
## Extensions
* [x] Ruby-lsp
* [x] Ruby-lsp-rails
* [x] Ruby Db Schema
* [x] Markdown All in One
* [x] TODO Highliter
* [x] run ` rails notes` to show up any TODO or FIXME
## Featuring
* [x] VsCodium development improvement
* [x] Ruby-lsp
* [x] Ruby-lsp-rails
* [x] Ruby Db Schema
* [x] Markdown All in One
* [x] TODO Highliter
* [x] run ` rails notes` to show up any TODO or FIXME
* [x] Debugger friendly
* [x] ask before killing ./bin/dev
* [x] Tailwind CSS
* [x] plugin for completion
* [x] Rails Live Reload
* [x] compliance with Tailwind
* [x] Custom Progress Bar
* [x] compliant with Tailwind build
## TODO
* [x] Customized Turbo
* [x] Progress Bar
* [ ] Confirm Method using HTML modal
* [ ] Production Ready
* [ ] ./bin/prod
* [ ] Log

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

@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title><%=Rails.application.class.module_parent%></title>
<title><%=Rails.configuration.application_title%></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

2
app/views/scores/edit.html.erb

@ -3,6 +3,6 @@
<%= render "form", score: @score %>
<%= link_to "Show this score", @score, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<%= link_to "Show this score", @score, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<%= link_to "Back to scores", scores_path, class: "ml-2 rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
</div>

2
app/views/scores/index.html.erb

@ -1,4 +1,4 @@
<div class="w-full bg-yellow-300">
<div class="w-full bg-yellow-300 p-4">
<% if notice.present? %>
<p class="py-2 px-3 bg-green-50 mb-5 text-green-500 font-medium rounded-lg inline-block" id="notice"><%= notice %></p>
<% end %>

6
config/application.rb

@ -5,7 +5,8 @@ require 'rails/all'
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)
module EasyRails
# Module name provides the main application title, ie: config.application_title defined below
module EasyGoingRails
# Main Application
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
@ -16,6 +17,9 @@ module EasyRails
# Common ones are `templates`, `generators`, or `middleware`, for example.
config.autoload_lib(ignore: %w[assets tasks])
# main application title defined from current module name, see module above
config.application_title = module_parent.to_s.titleize
# Configuration for the application, engines, and railties goes here.
#
# These settings can be overridden in specific environments using the files

6
config/boot.rb

@ -1,4 +1,4 @@
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
require 'bundler/setup' # Set up gems listed in the Gemfile.
require 'bootsnap/setup' # Speed up boot time by caching expensive operations.

2
config/environment.rb

@ -1,5 +1,5 @@
# Load the Rails application.
require_relative "application"
require_relative 'application'
# Initialize the Rails application.
Rails.application.initialize!

10
config/importmap.rb

@ -1,7 +1,7 @@
# Pin npm packages by running ./bin/importmap
pin "application"
pin "@hotwired/turbo-rails", to: "turbo.min.js", preload: true
pin "@hotwired/stimulus", to: "stimulus.min.js"
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
pin_all_from "app/javascript/controllers", under: "controllers"
pin 'application'
pin '@hotwired/turbo-rails', to: 'turbo.min.js', preload: true
pin '@hotwired/stimulus', to: 'stimulus.min.js'
pin '@hotwired/stimulus-loading', to: 'stimulus-loading.js'
pin_all_from 'app/javascript/controllers', under: 'controllers'

18
config/puma.rb

@ -7,29 +7,29 @@
# Any libraries that use thread pools should be configured to match
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
max_threads_count = ENV.fetch('RAILS_MAX_THREADS') { 5 }
min_threads_count = ENV.fetch('RAILS_MIN_THREADS') { max_threads_count }
threads min_threads_count, max_threads_count
# Specifies that the worker count should equal the number of processors in production.
if ENV["RAILS_ENV"] == "production"
require "concurrent-ruby"
worker_count = Integer(ENV.fetch("WEB_CONCURRENCY") { Concurrent.physical_processor_count })
if ENV['RAILS_ENV'] == 'production'
require 'concurrent-ruby'
worker_count = Integer(ENV.fetch('WEB_CONCURRENCY') { Concurrent.physical_processor_count })
workers worker_count if worker_count > 1
end
# Specifies the `worker_timeout` threshold that Puma will use to wait before
# terminating a worker in development environments.
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development"
worker_timeout 3600 if ENV.fetch('RAILS_ENV', 'development') == 'development'
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
port ENV.fetch("PORT") { 3000 }
port ENV.fetch('PORT') { 3000 }
# Specifies the `environment` that Puma will run in.
environment ENV.fetch("RAILS_ENV") { "development" }
environment ENV.fetch('RAILS_ENV') { 'development' }
# Specifies the `pidfile` that Puma will use.
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
pidfile ENV.fetch('PIDFILE') { 'tmp/pids/server.pid' }
# Allow puma to be restarted by `bin/rails restart` command.
plugin :tmp_restart
Loading…
Cancel
Save