From 148c6d4d7362d878debfc0fe9f33bb31fa571763 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20Akbudak?= Date: Wed, 4 Jul 2018 12:30:34 +0300 Subject: [PATCH 1/3] Update CHANGELOG file --- CHANGELOG.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c26cd9..19c98ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,17 @@ #### [Current] + * [ee9d462](../../commit/ee9d462) - __(İsmail AKBUDAK)__ Merge pull request [#127](../../issues/127) from lab2023/feature/update_ruby_rails_to_latest_version + +KBP-207 #time 2d - Update rails, ruby and some gems version to latest version + * [bf9734d](../../commit/bf9734d) - __(İsmail Akbudak)__ Fix rails version control spec error + * [5187400](../../commit/5187400) - __(Hamdi Bayhan)__ KBP-207 #time 30m - Add AWS S3 settings for environment variable and remove unnecessary secret key file + * [f1137c1](../../commit/f1137c1) - __(Hamdi Bayhan)__ KBP-207 #time 2d - Update rails, ruby and some gems version to latest version + * [55026e7](../../commit/55026e7) - __(İsmail Akbudak)__ Merge tag 'v2.0.0' into develop + +v2.0.0 + +#### v2.0.0 + * [4f57300](../../commit/4f57300) - __(İsmail Akbudak)__ Update CHANGELOG file * [320d265](../../commit/320d265) - __(İsmail AKBUDAK)__ Update README.md * [2b203bd](../../commit/2b203bd) - __(İsmail Akbudak)__ Update README file * [69f24dc](../../commit/69f24dc) - __(İsmail Akbudak)__ Merged in feature/remove_env_local_from_gitignore (pull request [#41](../../issues/41)) From 52832d18f6254a92e65c01485612d434fa05f051 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20Akbudak?= Date: Wed, 4 Jul 2018 12:55:00 +0300 Subject: [PATCH 2/3] Fix pronto warnings --- lib/cybele.rb | 1 + lib/cybele/app_builder.rb | 1 + lib/cybele/helpers/active_storage.rb | 40 ++++++++++++++++++++++++++++ lib/cybele/helpers/general.rb | 27 ------------------- lib/cybele/version.rb | 4 +-- 5 files changed, 44 insertions(+), 29 deletions(-) create mode 100644 lib/cybele/helpers/active_storage.rb diff --git a/lib/cybele.rb b/lib/cybele.rb index f600e30..79834af 100644 --- a/lib/cybele.rb +++ b/lib/cybele.rb @@ -19,6 +19,7 @@ require 'cybele/helpers/audited' require 'cybele/helpers/routes' require 'cybele/helpers/general' +require 'cybele/helpers/active_storage' require 'cybele/helpers/basic_authentication' require 'cybele/helpers/app_files/assets_files' require 'cybele/helpers/app_files/controller_files' diff --git a/lib/cybele/app_builder.rb b/lib/cybele/app_builder.rb index 4beae75..118eb68 100644 --- a/lib/cybele/app_builder.rb +++ b/lib/cybele/app_builder.rb @@ -29,6 +29,7 @@ class AppBuilder < Rails::AppBuilder # rubocop:disable Metrics/ClassLength include Cybele::Helpers::Docker include Cybele::Helpers::Pronto include Cybele::Helpers::General + include Cybele::Helpers::ActiveStorage def setup_gitignore_files remove_file '.gitignore', force: true diff --git a/lib/cybele/helpers/active_storage.rb b/lib/cybele/helpers/active_storage.rb new file mode 100644 index 0000000..ed69302 --- /dev/null +++ b/lib/cybele/helpers/active_storage.rb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +module Cybele + module Helpers + module ActiveStorage + def active_storage_setting + %w[config/environments/production.rb config/environments/staging.rb + config/environments/development.rb].each do |file| + gsub_file file, + /config.active_storage.service = :local/, + 'config.active_storage.service = :amazon' + end + handle_active_storage_change_file_content + %w[.env.local .env.production .env.staging .env.sample].each do |env| + append_file(env, template_content('active_storage/amazon_env_all.erb')) + end + end + + private + + def handle_active_storage_change_file_content + replace_in_file 'config/storage.yml', + 'Rails.application.credentials.dig(:aws, :access_key_id)', + "ENV['AWS_ACCESS_KEY_ID']" + replace_in_file 'config/storage.yml', + 'Rails.application.credentials.dig(:aws, :secret_access_key)', + "ENV['AWS_SECRET_ACCESS_KEY']" + replace_in_file 'config/storage.yml', + 'us-east-1', + "<%= ENV['AWS_REGION'] %>" + replace_in_file 'config/storage.yml', + 'your_own_bucket', + "<%= ENV['BUCKET_NAME'] %>" + replace_in_file 'config/storage.yml', + '# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)', + '# AWS S3 access variable' + end + end + end +end diff --git a/lib/cybele/helpers/general.rb b/lib/cybele/helpers/general.rb index d8c5779..0416557 100644 --- a/lib/cybele/helpers/general.rb +++ b/lib/cybele/helpers/general.rb @@ -29,33 +29,6 @@ def force_ssl_setting end end - def active_storage_setting - %w[config/environments/production.rb config/environments/staging.rb - config/environments/development.rb].each do |file| - gsub_file file, - /config.active_storage.service = :local/, - "config.active_storage.service = :amazon" - end - replace_in_file 'config/storage.yml', - 'Rails.application.credentials.dig(:aws, :access_key_id)', - "ENV['AWS_ACCESS_KEY_ID']" - replace_in_file 'config/storage.yml', - 'Rails.application.credentials.dig(:aws, :secret_access_key)', - "ENV['AWS_SECRET_ACCESS_KEY']" - replace_in_file 'config/storage.yml', - 'us-east-1', - "<%= ENV['AWS_REGION'] %>" - replace_in_file 'config/storage.yml', - 'your_own_bucket', - "<%= ENV['BUCKET_NAME'] %>" - replace_in_file 'config/storage.yml', - '# Use rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)', - "# AWS S3 access variable" - %w[.env.local .env.production .env.staging .env.sample].each do |env| - append_file(env, template_content('active_storage/amazon_env_all.erb')) - end - end - def add_editor_config copy_file 'editorconfig', '.editorconfig' end diff --git a/lib/cybele/version.rb b/lib/cybele/version.rb index 39d07c0..23bdb47 100644 --- a/lib/cybele/version.rb +++ b/lib/cybele/version.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Cybele - RAILS_VERSION = '~> 5.2.0', '>= 5.2.0' + RAILS_VERSION = ['~> 5.2.0', '>= 5.2.0'].freeze RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip VERSION = '2.1.0' -end \ No newline at end of file +end From f7d00fcaa4dc8a7a8fd1f0ee19627bd48b39798a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0smail=20Akbudak?= Date: Wed, 4 Jul 2018 12:55:16 +0300 Subject: [PATCH 3/3] Update CHANGELOG file --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19c98ed..b9344a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ #### [Current] + * [52832d1](../../commit/52832d1) - __(İsmail Akbudak)__ Fix pronto warnings + * [148c6d4](../../commit/148c6d4) - __(İsmail Akbudak)__ Update CHANGELOG file * [ee9d462](../../commit/ee9d462) - __(İsmail AKBUDAK)__ Merge pull request [#127](../../issues/127) from lab2023/feature/update_ruby_rails_to_latest_version KBP-207 #time 2d - Update rails, ruby and some gems version to latest version