Skip to content

Commit

Permalink
Merged in feature/environment_generator (pull request #50)
Browse files Browse the repository at this point in the history
Added new generator for environments

Approved-by: İsmail Akbudak <[email protected]>
  • Loading branch information
Kemal AKIN authored and İsmail Akbudak committed Mar 8, 2019
2 parents fb4b71d + ff6e546 commit b5cde72
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,9 @@ 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
5 changes: 5 additions & 0 deletions lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions templates/README.md.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
- Change email sender domain address and basic_auth info in `config/settings.yml`
- Change email sender domain address in `config/initializers/devise.rb`
- Create `.pronto.yml` file from `example.pronto.yml` file
- Run command for create environments ➜ ✗ `rails g environment`

# Infos
- Edit secret keys
Expand Down
9 changes: 9 additions & 0 deletions templates/environment/environment_generator.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
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

0 comments on commit b5cde72

Please sign in to comment.