Skip to content

Commit

Permalink
KBP-127 #time 5m -Code was improved
Browse files Browse the repository at this point in the history
  • Loading branch information
hamdibayhan committed Oct 25, 2017
1 parent 8f67ade commit f207980
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 13 deletions.
1 change: 1 addition & 0 deletions lib/cybele.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
require 'cybele/version'
require 'cybele/generators/app_generator'
require 'cybele/helpers'
require 'cybele/helpers/staging'
require 'cybele/helpers/sidekiq'
require 'cybele/helpers/responders'
require 'cybele/helpers/simple_form'
Expand Down
14 changes: 1 addition & 13 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
module Cybele
class AppBuilder < Rails::AppBuilder
include Cybele::Helpers
include Cybele::Helpers::Staging
include Cybele::Helpers::Sidekiq
include Cybele::Helpers::Responders
include Cybele::Helpers::SimpleForm
Expand All @@ -24,11 +25,6 @@ def add_gems
append_file('Gemfile', template_content('Gemfile.erb'))
end

def add_simple_form_gem
# Add simple_form gems
append_file('Gemfile', template_content('simple_form/simple_form_Gemfile.erb'))
end

def add_editor_config
copy_file 'editorconfig', '.editorconfig'
end
Expand All @@ -47,10 +43,6 @@ def create_database
bundle_command 'exec rake db:create db:migrate'
end

def setup_staging_environment
run 'cp config/environments/production.rb config/environments/staging.rb'
end

def generate_config
generate 'config:install'
run 'cp config/settings/development.yml config/settings/staging.yml'
Expand All @@ -61,10 +53,6 @@ def generate_rollbar
generate 'rollbar'
end

def add_staging_secret_key_to_secrets_yml
append_file 'config/secrets.yml', template_content('secrets.yml.erb')
end

private

def configure_environment(rails_env, config)
Expand Down
5 changes: 5 additions & 0 deletions lib/cybele/helpers/simple_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ def configure_simple_form
# Remove simple_form turkish file
copy_file 'config/locales/simple_form.tr.yml', 'config/locales/simple_form.tr.yml'
end

def add_simple_form_gem
# Add simple_form gem
append_file('Gemfile', template_content('simple_form/simple_form_Gemfile.erb'))
end
end
end
end
15 changes: 15 additions & 0 deletions lib/cybele/helpers/staging.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# frozen_string_literal: true

module Cybele
module Helpers
module Staging
def setup_staging_environment
run 'cp config/environments/production.rb config/environments/staging.rb'
end

def add_staging_secret_key_to_secrets_yml
append_file 'config/secrets.yml', template_content('secrets.yml.erb')
end
end
end
end

0 comments on commit f207980

Please sign in to comment.