Skip to content

Commit

Permalink
Added new generator for environments
Browse files Browse the repository at this point in the history
  • Loading branch information
vilusa committed Feb 27, 2019
1 parent f290325 commit 77315d9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
10 changes: 10 additions & 0 deletions templates/environment/environment_generator.rb
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 77315d9

Please sign in to comment.