Skip to content

Commit

Permalink
Merge branch 'release/v2.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
İsmail Akbudak committed Mar 8, 2019
2 parents dd9a03d + 8d761b8 commit 3062f45
Show file tree
Hide file tree
Showing 30 changed files with 161 additions and 111 deletions.
64 changes: 64 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,69 @@

#### [Current]
* [9af28ad](../../commit/9af28ad) - __(İsmail AKBUDAK)__ Merge pull request [#131](../../issues/131) from lab2023/feature/fix_broken_specs

Fix broken specs after changes
* [980fd25](../../commit/980fd25) - __(İsmail Akbudak)__ Fix broken specs after changes
* [b5cde72](../../commit/b5cde72) - __(Kemal AKIN)__ Merged in feature/environment_generator (pull request [#50](../../issues/50))

Added new generator for environments

Approved-by: İsmail Akbudak <[email protected]>

* [fb4b71d](../../commit/fb4b71d) - __(Kemal AKIN)__ Merged in feature/fix_yml_problem (pull request [#49](../../issues/49))

Re added files for build problem

Approved-by: İsmail Akbudak <[email protected]>

* [b23b525](../../commit/b23b525) - __(Kemal AKIN)__ Merged in feature/improve_views (pull request [#46](../../issues/46))

Feature/improve views

Approved-by: İsmail Akbudak <[email protected]>

* [63656c9](../../commit/63656c9) - __(Kemal AKIN)__ View i18n files revised
* [fd2ac29](../../commit/fd2ac29) - __(Kemal AKIN)__ Improve base i18n files
* [ff6e546](../../commit/ff6e546) - __(Kemal AKIN)__ Generator name edited
* [c08b07f](../../commit/c08b07f) - __(Kemal AKIN)__ Edited README.md for environment generator
* [00b3c6c](../../commit/00b3c6c) - __(Kemal AKIN)__ Deleted unless lines
* [77315d9](../../commit/77315d9) - __(Kemal AKIN)__ Added new generator for environments
* [5e997d6](../../commit/5e997d6) - __(Kemal AKIN)__ Re added files for build problem
* [f290325](../../commit/f290325) - __(Kemal AKIN)__ Merged in feature/improve_views (pull request [#44](../../issues/44))

Feature/improve views

Approved-by: İsmail Akbudak <[email protected]>

* [b6c0d0d](../../commit/b6c0d0d) - __(Kemal AKIN)__ Deleted not used keys
* [009f8b3](../../commit/009f8b3) - __(Kemal AKIN)__ Not use view keys deleted
* [73c8656](../../commit/73c8656) - __(Kemal AKIN)__ Deleted non used keys from view.tr.yml
* [77c3dc5](../../commit/77c3dc5) - __(Kemal AKIN)__ Merged in feature/fix_pronto_thor_problem (pull request [#45](../../issues/45))

Refactored app build method for pronto

Approved-by: İsmail Akbudak <[email protected]>

* [74d395b](../../commit/74d395b) - __(Kemal AKIN)__ Pronto Gem file based revised
* [9aff62d](../../commit/9aff62d) - __(Kemal AKIN)__ Bundle commands refactored
* [62a686e](../../commit/62a686e) - __(Kemal AKIN)__ Refactored app build method for pronto
* [4dfccd1](../../commit/4dfccd1) - __(Kemal AKIN)__ Merged in feature/evn_file_comments_improve (pull request [#43](../../issues/43))

Feature/evn file comments improve

Approved-by: İsmail Akbudak <[email protected]>

* [a3c4ea1](../../commit/a3c4ea1) - __(Kemal AKIN)__ Revised HQ Audits show page
* [cd84ed1](../../commit/cd84ed1) - __(Kemal AKIN)__ Application title tag improve
* [7be9213](../../commit/7be9213) - __(Kemal AKIN)__ Updated Font Awesome version
* [4664bf3](../../commit/4664bf3) - __(Kemal AKIN)__ Edited Comment lines
* [6ee9635](../../commit/6ee9635) - __(Kemal AKIN)__ Remove comments
* [c16931e](../../commit/c16931e) - __(İsmail Akbudak)__ Merge tag 'v2.2.0' into develop

v2.2.0

#### v2.2.0
* [b5b6990](../../commit/b5b6990) - __(İsmail Akbudak)__ Update version v2.2.0
* [864753a](../../commit/864753a) - __(İsmail Akbudak)__ Merged in feature/improve_gems (pull request [#42](../../issues/42))

Feature/improve gems
Expand Down
11 changes: 11 additions & 0 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,16 @@ def git_and_git_flow_commands
git add: '.'
git commit: '-m "Project initialized"'
end

def add_pronto_to_gemfile
# Add gems
append_file('Gemfile', template_content('pronto/pronto_Gemfile.erb'))
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
11 changes: 10 additions & 1 deletion lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ def initialize(*args)
def customize_gemfile
say 'Customize gem file', :green
build :add_gems
bundle_command 'update thor'
build :add_simple_form_gem unless @options[:skip_simple_form]
build :add_show_for_gem unless @options[:skip_show_for]
build :add_haml_gems unless @options[:skip_haml]
Expand Down Expand Up @@ -257,6 +256,16 @@ def docker_development_env
build :setup_docker_development_env
end

def setup_pronto
say 'Pronto is setup', :green
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
2 changes: 1 addition & 1 deletion lib/cybele/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
module Cybele
RAILS_VERSION = ['~> 5.2.2', '>= 5.2.2'].freeze
RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
VERSION = '2.2.0'
VERSION = '2.3.0'
end
6 changes: 1 addition & 5 deletions spec/features/new_default_project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@
expect(readme_file).to match(/^➜ ✗ redis-server/)
end

it 'uses postgresql database template' do
database_file = content('config/database.yml')
expect(database_file).to match(/^connection: &connection/)
expect(database_file).to match(/^ database: #{app_name}_staging/)
end
it_behaves_like 'uses postgresql database'

it_behaves_like 'uses sidekiq'

Expand Down
16 changes: 1 addition & 15 deletions spec/features/new_not_default_project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,7 @@
setup_app_dependencies
end

it 'uses sqlite3 instead of default pg in Gemfile' do
gemfile_file = content('Gemfile')
readme_file = content('README.md')
expect(gemfile_file).not_to match(/^gem 'pg'/)
expect(gemfile_file).to match(/^gem 'sqlite3'/)
expect(readme_file).to match(/^# #{app_name.capitalize}/)
expect(readme_file).not_to match(/^# Docker development/)
expect(readme_file).not_to match(/^➜ ✗ redis-server/)
end

it 'uses sqlite3 database template' do
database_file = content('config/database.yml')
expect(database_file).to match(/^default: &default/)
expect(database_file).to match(/adapter: sqlite3/)
end
it_behaves_like 'uses postgresql database'

it 'do not use sidekiq' do
gemfile_file = content('Gemfile')
Expand Down
1 change: 1 addition & 0 deletions spec/files/README_DEFAULT.md
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
1 change: 1 addition & 0 deletions spec/files/README_ONLY_NO_SKIP_DOCKER.md
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
1 change: 1 addition & 0 deletions spec/files/README_ONLY_NO_SKIP_SIDEKIQ.md
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
1 change: 1 addition & 0 deletions spec/files/README_SKIP_ALL.md
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
2 changes: 1 addition & 1 deletion spec/support/cybele_test_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def cybele_not_default_parameters(no_skips: [])
skips = commands.map do |command|
"--skip-#{command}"
end
'--database=sqlite3 ' + skips.join(' ')
'--skip-create-database ' + skips.join(' ')
end

def content(file_path)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

def file_content_control_test
locale_file = content('config/locales/tr.yml')
expect(locale_file).to match('phone:')
expect(locale_file).to match('date:')
expect(locale_file).to match('time:')
expect(locale_file).to match('number:')
Expand Down
11 changes: 11 additions & 0 deletions spec/support/shared_examples/postgresql_test_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# frozen_string_literal: true

shared_examples 'uses postgresql database' do
context do
it do
database_file = content('config/database.yml')
expect(database_file).to match(/^connection: &connection/)
expect(database_file).to match(/^ database: #{app_name}_staging/)
end
end
end
15 changes: 0 additions & 15 deletions templates/Gemfile.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@

# General requirement
gem 'thor', '~> 0.19.4'

# For never accidentally send emails to real people from staging environment.
gem 'recipient_interceptor', '~> 0.2.0'

Expand Down Expand Up @@ -36,18 +33,6 @@ group :development, :test do
gem 'colorize', '~> 0.8.1'
end

# Pronto runners
group :development do
gem 'pronto', '~> 0.9.5'
gem 'pronto-erb_lint', require: false
gem 'pronto-brakeman', require: false
gem 'pronto-fasterer', require: false
gem 'pronto-flay', require: false
gem 'pronto-haml', require: false
gem 'pronto-poper', require: false
gem 'pronto-rubocop', require: false
end

# A set of common locale data and translations to internationalize and/or localize your Rails applications.
gem 'rails-i18n', '~> 5.1'

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
3 changes: 2 additions & 1 deletion templates/active_storage/amazon_env_all.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

AWS_S3_BUCKET_NAME= # S3 Settings
# S3 Settings
AWS_S3_BUCKET_NAME=
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
26 changes: 20 additions & 6 deletions templates/app_files/app/views/hq/audits/show.html.haml
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
.card
.card-header
%i.fas.fa-microchip
= t('activerecord.models.audits')
.card-body
- @audit.audited_changes.each_key do |key|
%p
%strong
- if @audit.try(:auditable_type).present?
= t("activerecord.attributes.#{@audit.try(:auditable_type).try(:underscore)}.#{key}")
= @audit.audited_changes[key]
%table.table.table-striped.table-bordered
%thead
%tr
%th{scope: 'col'}= t('activerecord.attributes.audit.action')
%th{scope: 'col'}= t('view.previous_value')
%th{scope: 'col'}= t('view.current_value')
%tbody
- @audit.audited_changes.each_key do |key|
%tr
- if @audit.try(:auditable_type).present?
%th{scope: 'row'}= t("activerecord.attributes.#{@audit.try(:auditable_type).try(:underscore)}.#{key}")
- if @audit.audited_changes[key].is_a?(Array)
%td= @audit.audited_changes[key][0]
%td= @audit.audited_changes[key][1]
- else
%td= @audit.audited_changes[key]
%td= @audit.audited_changes[key]
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
%meta{ name: 'author', content: '<%= app_name.capitalize %>' }
%link{ rel: 'shortcut icon', href: '/images/favicon.png' }

= stylesheet_link_tag 'https://use.fontawesome.com/releases/v5.0.8/css/all.css',
= stylesheet_link_tag 'https://use.fontawesome.com/releases/v5.7.0/css/all.css',
'application', media: 'all', 'data-turbolinks-track': 'reload'
= javascript_include_tag 'application',
'data-turbolinks-track': 'reload'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
%html.no-js{ lang: I18n.locale }
%head
%title
- if content_for?(:title)
= "#{yield(:title)} - <%= app_name.capitalize %>"
- else
= '<%= app_name.capitalize %>'
= content_for?(:title) ? "#{yield(:title)} - <%= app_name.capitalize %>" : '<%= app_name.capitalize %>'
%meta{ 'http-equiv': 'content-type', content: 'text/html', charset: 'utf-8' }
%meta{ 'http-equiv': 'x-ua-compatible', content: 'ie=edge,chrome=1' }
%meta{ name: 'description', content: '<%= app_name.capitalize %>' }
Expand All @@ -25,7 +22,7 @@
= csrf_meta_tags

/ Stylesheets (Don't change include order)
= stylesheet_link_tag 'https://use.fontawesome.com/releases/v5.0.8/css/all.css',
= stylesheet_link_tag 'https://use.fontawesome.com/releases/v5.7.0/css/all.css',
'hq/application', media: 'all', 'data-turbolinks-track': 'reload'

/ Javascripts
Expand Down
19 changes: 1 addition & 18 deletions templates/config/locales/en.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,17 @@
---
en:
phone:
formats:
long: '+99 (999) 999-9999'
date:
formats:
excel:
rails: '%d/%m/%Y'
datepicker:
rails: '%d/%m/%Y'
js: 'd/m/Y'
default: "%d/%m/%Y"
year_month: "%Y-%B"
date: '%d %B %Y'
time:
formats:
certificate_completed_at_english: '%m/%d/%Y'
certificate_completed_at: '%d/%m/%Y'
datetimepicker_rails: '%d/%m/%Y %H:%M'
datetimepicker:
rails: '%d/%m/%Y %H:%M'
js: 'd/m/Y H:i'
default: "%d/%m/%Y %H:%M"
year_month: "%Y-%B"
date: '%d %B %Y'
due_at:
rails: '%d/%m/%Y %H:%M'
js: 'd/m/Y H:i'
number:
currency:
format:
format: "%u %n"
unit: ""
unit: "$"
1 change: 0 additions & 1 deletion templates/config/locales/show_for.tr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
tr:
show_for:
blank: "Belirtilmemiş"
Expand Down
1 change: 0 additions & 1 deletion templates/config/locales/simple_form.tr.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
tr:
simple_form:
"yes": 'Evet'
Expand Down
17 changes: 0 additions & 17 deletions templates/config/locales/tr.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,15 @@
---
tr:
phone:
formats:
long: '+99 (999) 999-9999'
date:
formats:
excel:
rails: '%d/%m/%Y'
datepicker:
rails: '%d/%m/%Y'
js: 'd/m/Y'
default: "%d/%m/%Y"
year_month: "%Y-%B"
date: '%d %B %Y'
time:
formats:
certificate_completed_at_english: '%m/%d/%Y'
certificate_completed_at: '%d/%m/%Y'
datetimepicker_rails: '%d/%m/%Y %H:%M'
datetimepicker:
rails: '%d/%m/%Y %H:%M'
js: 'd/m/Y H:i'
default: "%d/%m/%Y %H:%M"
year_month: "%Y-%B"
date: '%d %B %Y'
due_at:
rails: '%d/%m/%Y %H:%M'
js: 'd/m/Y H:i'
number:
currency:
format:
Expand Down
Loading

0 comments on commit 3062f45

Please sign in to comment.