From 76ff31761afe158ddb7bb5b7a56dc3df37b46317 Mon Sep 17 00:00:00 2001 From: Alessandro Rodi Date: Thu, 11 Sep 2025 17:17:08 +0200 Subject: [PATCH 1/3] Setup dotenv automatically --- ruby_on_rails/template.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ruby_on_rails/template.rb b/ruby_on_rails/template.rb index 7d1d159c..0c5fe38b 100644 --- a/ruby_on_rails/template.rb +++ b/ruby_on_rails/template.rb @@ -24,11 +24,16 @@ # replace bin/rails db:prepare with bin/rails db:setup in bin/setup gsub_file "bin/setup", "bin/rails db:prepare", "bin/rails db:setup" -# add the renuo fetch-secrets command in bin/setup, before bin/rails db:setup +# add the renuo fetch-secrets command and copying the dotenv file in bin/setup, before bin/rails db:setup insert_into_file "bin/setup", before: "\n puts \"\\n== Preparing database ==\"" do <<-RUBY puts "\\n== Fetching 1password dependencies ==" system! 'renuo fetch-secrets' + + puts "\n== Copying sample files ==" + unless File.exist?('.env') + system! 'cp .env.example .env' + end RUBY end From 551a17ebf852e4b458a55097a64a09cb752253c0 Mon Sep 17 00:00:00 2001 From: Alessandro Rodi Date: Thu, 11 Sep 2025 17:23:16 +0200 Subject: [PATCH 2/3] Setup dotenv --- ruby_on_rails/template.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/ruby_on_rails/template.rb b/ruby_on_rails/template.rb index 0c5fe38b..7d1d159c 100644 --- a/ruby_on_rails/template.rb +++ b/ruby_on_rails/template.rb @@ -24,16 +24,11 @@ # replace bin/rails db:prepare with bin/rails db:setup in bin/setup gsub_file "bin/setup", "bin/rails db:prepare", "bin/rails db:setup" -# add the renuo fetch-secrets command and copying the dotenv file in bin/setup, before bin/rails db:setup +# add the renuo fetch-secrets command in bin/setup, before bin/rails db:setup insert_into_file "bin/setup", before: "\n puts \"\\n== Preparing database ==\"" do <<-RUBY puts "\\n== Fetching 1password dependencies ==" system! 'renuo fetch-secrets' - - puts "\n== Copying sample files ==" - unless File.exist?('.env') - system! 'cp .env.example .env' - end RUBY end From c75b10cb44466b4ad9004a27cc6491e48f108b83 Mon Sep 17 00:00:00 2001 From: Alessandro Rodi Date: Thu, 11 Sep 2025 21:02:30 +0200 Subject: [PATCH 3/3] More changes --- configure_git_repository.md | 6 +++--- ruby_on_rails/app_initialisation.md | 8 +++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/configure_git_repository.md b/configure_git_repository.md index 00885308..8b30e822 100644 --- a/configure_git_repository.md +++ b/configure_git_repository.md @@ -7,9 +7,9 @@ Please stick to it unless you have special needs. * Features: Remove *Wikis*, *Issues* and *Projects* * Pull Requests * Disable *Allow merge commits* and *Allow rebase merging* + * Always suggest updating pull request branches * Allow auto-merge * Automatically delete head branches - * Always suggest updating pull request branches * Manage access * Add *staff* team as a collaborator with Admin access * Add *security* team as collaborator with Write access @@ -18,13 +18,13 @@ Please stick to it unless you have special needs. * Rules/Rulesets * `develop` * Enforcement status: `Active` - * Branch targeting criteria: `develop` * Bypass list: add `Repository Admin` Role with *allow for pull requests only* option + * Branch targeting criteria: `develop` * Restrict deletions * Require linear history * Require a pull request before merging * Require status checks to pass - * Select `ci/semaphore/push` + * Select `ci/semaphore/push` (WRONG. NOT AVAILABLE NOW) * Block force pushes * `main` (same as develop but...) * Branch targeting criteria: `main` diff --git a/ruby_on_rails/app_initialisation.md b/ruby_on_rails/app_initialisation.md index 2a1ef551..55be5605 100644 --- a/ruby_on_rails/app_initialisation.md +++ b/ruby_on_rails/app_initialisation.md @@ -74,8 +74,8 @@ Check existing projects for an example of the usage. * Update `config/application.rb` and set the default language and timezone ```ruby - config.time_zone = 'Zurich' # may vary - config.i18n.default_locale = :de # may vary + config.time_zone = 'Zurich' + config.i18n.default_locale = :de ``` * Update your `config/environments/production.rb` settings: @@ -91,9 +91,7 @@ Check existing projects for an example of the usage. config.action_controller.action_on_unpermitted_parameters = :raise config.i18n.raise_on_missing_translations = :strict - config.generators do |g| - g.apply_rubocop_autocorrect_after_generate! - end + config.generators.apply_rubocop_autocorrect_after_generate! ``` * Update `config/environments/test.rb` settings: