Skip to content

Commit

Permalink
Merged in feature/integrate_bullet_gem (pull request #13)
Browse files Browse the repository at this point in the history
KBP-131 #time 1.5h - integrate bullet gem

Approved-by: İsmail Akbudak <ismail.akbudak@lab2023.com>
Approved-by: Eşref VİDUŞLU <esref.viduslu@lab2023.com>
  • Loading branch information
FatihAvsan committed Oct 31, 2017
2 parents 0d5ab71 + 0376775 commit 2742f8a
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/cybele/app_builder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def generate_rollbar
generate 'rollbar'
end

def configure_bullet
configure_environment 'development', template_content('bullet/bullet_settings.rb')
end

private

def configure_environment(rails_env, config)
Expand Down
10 changes: 10 additions & 0 deletions lib/cybele/generators/app_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,16 @@ def add_staging_secret_key
build :add_staging_secret_key_to_secrets_yml
end

def setup_bullet_config
say 'Setup bullet config'
build :configure_bullet
end

def setup_dotenv
say 'Generate env.sample and .env files', :green
build :configure_dotenv
end

def setup_paperclip_and_add_aws
say 'Setting up paperclip, editing settings.yml and env files', :green
build :configure_paperclip
Expand Down
8 changes: 8 additions & 0 deletions spec/features/new_default_project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,12 @@
expect(File).not_to exist(file_project_path('app/views/layouts/application.html.erb'))
expect(File).to exist(file_project_path('app/views/layouts/application.html.haml'))
end

it 'uses bullet' do
gemfile_file = content('Gemfile')
expect(gemfile_file).to match("gem 'bullet'")

locale_file = content('config/environments/development.rb')
expect(locale_file).to match('Bullet')
end
end
8 changes: 8 additions & 0 deletions spec/features/new_not_default_project_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@
expect(File).to exist(file_project_path('public/VERSION.txt'))
end

it 'uses bullet' do
gemfile_file = content('Gemfile')
expect(gemfile_file).to match("gem 'bullet'")

locale_file = content('config/environments/development.rb')
expect(locale_file).to match('Bullet')
end

it 'do not use simple_form' do
gemfile_file = content('Gemfile')
expect(gemfile_file).not_to match(/^gem 'simple_form'/)
Expand Down
1 change: 1 addition & 0 deletions templates/Gemfile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ gem 'roo', '~> 2.7', '>= 2.7.1'
group :development, :test do
gem 'colorize', '~> 0.8.1'
gem 'better_errors', '~> 2.4'
gem 'bullet', '~> 5.6', '>= 5.6.1'
end

# A set of common locale data and translations to internationalize and/or localize your Rails applications.
Expand Down
8 changes: 8 additions & 0 deletions templates/bullet/bullet_settings.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
config.after_initialize do
Bullet.enable = true
Bullet.alert = true
Bullet.bullet_logger = true
Bullet.console = true
Bullet.rails_logger = true
Bullet.add_footer = false
end

0 comments on commit 2742f8a

Please sign in to comment.