Sha256: 1e9a9c7aca4a51db9bf4f1c107357fdef7af4b281fff32db74a339e2ae710482
Contents?: true
Size: 845 Bytes
Versions: 33
Compression:
Stored size: 845 Bytes
Contents
# frozen_string_literal: true require_relative "../../lib/plutonium_generators" module Pu module Gem class DotenvGenerator < Rails::Generators::Base include PlutoniumGenerators::Generator source_root File.expand_path("templates", __dir__) desc "Set up dotenv" def start in_root do [".env", ".env.local", ".env.template", ".env.local.template"].each do |file| copy_file file end copy_file "config/initializers/001_ensure_required_env.rb" gitignore "!/.env.template", "!/.env.local.template", "!/.env" insert_into_file "Gemfile", "\ngem \"dotenv\", :groups => [:development, :test]\n", after: /^gem ["']rails["'].*\n/ bundle! end rescue => e exception "#{self.class} failed:", e end end end end
Version data entries
33 entries across 33 versions & 1 rubygems