Skip to content

Commit 666a0c1

Browse files
setup .env for testing
1 parent b626c07 commit 666a0c1

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

lib/generators/pu/gem/dotenv/dotenv_generator.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ class DotenvGenerator < Rails::Generators::Base
1313

1414
def start
1515
in_root do
16-
[".env", ".env.local", ".env.template", ".env.local.template"].each do |file|
16+
[".env", ".env.local", ".env.template", ".env.local.template", ".env.test.local"].each do |file|
1717
copy_file file
1818
end
1919

2020
copy_file "config/initializers/001_ensure_required_env.rb"
2121

22-
gitignore "!/.env.template", "!/.env.local.template", "!/.env"
22+
gitignore "!/.env", "!/.env.template", "!/.env.local.template", "!/.env.test.local"
2323

2424
insert_into_file "Gemfile", "\ngem \"dotenv\", groups: %i[development test]\n", after: /^gem ["']rails["'].*\n/
2525
bundle!

lib/generators/pu/gem/dotenv/templates/.env.local

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Secrets for local testing should be added here.
1+
# Secrets for development should be added here.
22

33
# # == S3
44
# S3_ACCESS_KEY_ID=S3_ACCESS_KEY_ID

lib/generators/pu/gem/dotenv/templates/.env.local.template

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Secrets for local testing should be added here.
1+
# Secrets for development should be added here.
22

33
# # == S3
44
# S3_ACCESS_KEY_ID=S3_ACCESS_KEY_ID
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Secrets for testing should be added here.
2+
3+
# # == S3
4+
# S3_ACCESS_KEY_ID=S3_ACCESS_KEY_ID
5+
# S3_SECRET_ACCESS_KEY=S3_SECRET_ACCESS_KEY

0 commit comments

Comments
 (0)