Class: HeimdallAuth::Generators::DotenvGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/heimdall_auth/dotenv/dotenv_generator.rb

Instance Method Summary collapse

Instance Method Details

#add_dot_env_supportObject



6
7
8
9
10
11
# File 'lib/generators/heimdall_auth/dotenv/dotenv_generator.rb', line 6

def add_dot_env_support
  gem_group :development, :test do
    # Load ENV variables from .env file development and test
    gem 'dotenv-rails'
  end
end

#create_example_fileObject



13
14
15
# File 'lib/generators/heimdall_auth/dotenv/dotenv_generator.rb', line 13

def create_example_file
  copy_file "dot-env.example", ".env.example"
end

#ignore_dot_env_fileObject



17
18
19
20
21
# File 'lib/generators/heimdall_auth/dotenv/dotenv_generator.rb', line 17

def ignore_dot_env_file
  inject_into_file '.gitignore', after: "/.bundle\n" do
    "/.env\n"
  end
end