Skip to content

Commit

Permalink
setup .env for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
thedumbtechguy committed Feb 6, 2025
1 parent b626c07 commit c69a95c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/generators/pu/gem/dotenv/dotenv_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ class DotenvGenerator < Rails::Generators::Base

def start
in_root do
[".env", ".env.local", ".env.template", ".env.local.template"].each do |file|
[".env", ".env.local", ".env.template", ".env.local.template", ".env.test.local"].each do |file|
copy_file file
end

copy_file "config/initializers/001_ensure_required_env.rb"

gitignore "!/.env.template", "!/.env.local.template", "!/.env"
gitignore "!/.env.template", "!/.env.local.template", "!/.env", "!/.env.test.local"

insert_into_file "Gemfile", "\ngem \"dotenv\", groups: %i[development test]\n", after: /^gem ["']rails["'].*\n/
bundle!
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/pu/gem/dotenv/templates/.env.local
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Secrets for local testing should be added here.
# Secrets for development should be added here.

# # == S3
# S3_ACCESS_KEY_ID=S3_ACCESS_KEY_ID
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/pu/gem/dotenv/templates/.env.local.template
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Secrets for local testing should be added here.
# Secrets for development should be added here.

# # == S3
# S3_ACCESS_KEY_ID=S3_ACCESS_KEY_ID
Expand Down
5 changes: 5 additions & 0 deletions lib/generators/pu/gem/dotenv/templates/.env.test.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Secrets for testing should be added here.

# # == S3
# S3_ACCESS_KEY_ID=S3_ACCESS_KEY_ID
# S3_SECRET_ACCESS_KEY=S3_SECRET_ACCESS_KEY

0 comments on commit c69a95c

Please sign in to comment.