diff --git a/lib/cybele/app_builder.rb b/lib/cybele/app_builder.rb index e149638..c1da5af 100644 --- a/lib/cybele/app_builder.rb +++ b/lib/cybele/app_builder.rb @@ -70,5 +70,10 @@ def add_pronto_to_gemfile bundle_command 'update' bundle_command 'install' end + + + def add_environment_to_lib + copy_file 'environment/environment_generator.rb', 'lib/generators/environment/environment_generator.rb' + end end end diff --git a/lib/cybele/generators/app_generator.rb b/lib/cybele/generators/app_generator.rb index b031a2d..ea0f351 100644 --- a/lib/cybele/generators/app_generator.rb +++ b/lib/cybele/generators/app_generator.rb @@ -262,6 +262,11 @@ def setup_pronto build :add_pronto_to_gemfile end + def setup_environment_generator + say 'Environment generator setup', :green + build :add_environment_to_lib + end + def setup_git_and_git_flow say 'Initialize git and git flow' build :git_and_git_flow_commands diff --git a/templates/environment/environment_generator.rb b/templates/environment/environment_generator.rb new file mode 100644 index 0000000..dd386e2 --- /dev/null +++ b/templates/environment/environment_generator.rb @@ -0,0 +1,10 @@ + +class EnvironmentGenerator < Rails::Generators::Base + desc 'This generetor create .env.local file from .env.sample' + + source_root File.expand_path(Rails.root, __dir__) + + def copy_environment_file + copy_file ".env.sample", ".environments/.env.local" + end +end