-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
KBP-175 #time 5h improve code quality
- Loading branch information
İsmail Akbudak
committed
Jan 3, 2018
1 parent
2daa208
commit f45680e
Showing
90 changed files
with
766 additions
and
510 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
linters: | ||
LineLength: | ||
max: 100 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
character_limit: | ||
enabled: false | ||
number: 72 | ||
|
||
summary_character_limit: | ||
enabled: false | ||
number: 50 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2.3.3 | ||
2.3.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
"lib/cybele/": | ||
IrresponsibleModule: | ||
enabled: false | ||
"templates/": | ||
IrresponsibleModule: | ||
enabled: false | ||
"templates/app_files/app/controllers/": | ||
InstanceVariableAssumption: | ||
enabled: false | ||
IrresponsibleModule: | ||
enabled: false | ||
"templates/app_files/app/mailers": | ||
InstanceVariableAssumption: | ||
enabled: false | ||
IrresponsibleModule: | ||
enabled: false | ||
|
||
UtilityFunction: | ||
public_methods_only: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
# frozen_string_literal: true | ||
|
||
module Cybele | ||
module Helpers | ||
module General | ||
def readme | ||
template 'README.md.erb', | ||
'README.md', | ||
force: true | ||
end | ||
|
||
def remove_readme_rdoc | ||
remove_file 'README.rdoc', | ||
force: true | ||
end | ||
|
||
def add_gems | ||
# Add gems | ||
append_file('Gemfile', template_content('Gemfile.erb')) | ||
end | ||
|
||
def force_ssl_setting | ||
gsub_file 'config/environments/production.rb', | ||
/# config.force_ssl = true/, "config.force_ssl = ENV['RAILS_FORCE_SSL'].present?" | ||
gsub_file 'config/environments/staging.rb', | ||
/# config.force_ssl = true/, "config.force_ssl = ENV['RAILS_FORCE_SSL'].present?" | ||
append_file('.env.staging', template_content('ssl/ssl_env_staging.erb')) | ||
append_file('.env.production', template_content('ssl/ssl_env_production.erb')) | ||
end | ||
|
||
def add_editor_config | ||
copy_file 'editorconfig', '.editorconfig' | ||
end | ||
|
||
def add_ruby_version | ||
copy_file 'ruby-version', '.ruby-version' | ||
end | ||
|
||
def add_cybele_version | ||
copy_file 'VERSION.txt', 'VERSION.txt' | ||
run 'ln -s ../VERSION.txt public/VERSION.txt' | ||
end | ||
|
||
def use_postgres_config_template | ||
template 'postgresql_database.yml.erb', | ||
'config/database.yml', | ||
force: true | ||
end | ||
|
||
def create_database | ||
bundle_command 'exec rake db:create db:migrate' | ||
end | ||
|
||
def generate_config | ||
generate 'config:install' | ||
run 'cp config/settings/development.yml config/settings/staging.yml' | ||
append_file('config/settings.yml', template_content('settings.yml.erb')) | ||
remove_file 'config/settings.local.yml', force: true | ||
end | ||
|
||
def generate_rollbar | ||
generate 'rollbar' | ||
end | ||
|
||
def generate_guard | ||
bundle_command 'exec guard init' | ||
inject_into_file('Guardfile', "\n\n#{template_content('guardfile/guardfile_settings.rb.erb')}", | ||
after: 'config/Guardfile" instead of "Guardfile"') | ||
end | ||
|
||
def configure_bullet | ||
configure_environment 'development', template_content('bullet/bullet_settings.rb.erb') | ||
end | ||
|
||
private | ||
|
||
def configure_environment(rails_env, config) | ||
inject_into_file("config/environments/#{rails_env}.rb", "\n#{config}", before: "\nend") | ||
end | ||
|
||
def action_mailer_host(rails_env) | ||
configure_environment(rails_env, template_content('mailer/host.rb.erb')) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.