Class: Envalit::Generators::InstallGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Envalit::Generators::InstallGenerator
- Defined in:
- lib/envalit/generators/install_generator.rb
Overview
Generator for installing Envalit configuration files in a Ruby/Rails application.
This generator creates:
-
An initializer file with example environment variable configurations
-
A .env.example file with sample environment variable values
The generated files provide a starting point for:
-
Configuring required environment variables
-
Setting up type validations
-
Defining default values
-
Documenting environment requirements
Instance Method Summary collapse
-
#copy_example_env ⇒ void
Copies the example environment file template.
-
#copy_initializer ⇒ void
Copies the Envalit initializer template to the application.
Instance Method Details
#copy_example_env ⇒ void
This method returns an undefined value.
Copies the example environment file template.
Creates a .env.example file in the application root with sample values matching the initializer configuration.
44 45 46 |
# File 'lib/envalit/generators/install_generator.rb', line 44 def copy_example_env template "example.env", ".env.example" end |
#copy_initializer ⇒ void
This method returns an undefined value.
Copies the Envalit initializer template to the application.
Creates a new initializer file at config/initializers/envalit.rb with example configurations for common environment variables.
34 35 36 |
# File 'lib/envalit/generators/install_generator.rb', line 34 def copy_initializer template "envalit.rb", "config/initializers/envalit.rb" end |