welaika-suspenders 2.22.0 → 2.23.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7f224ab95618cdbe16370496df9b772230d8a87a
4
- data.tar.gz: bb92d352d3bec26429c5a9b442eac8577059a1f0
3
+ metadata.gz: bbe829c6d51e19782944b5685839aab374a0beb6
4
+ data.tar.gz: 9a9b41d93bb39c3e8a0b84b5613e570bdd5574c2
5
5
  SHA512:
6
- metadata.gz: d5911bb8e7d7cd04dbb2715b925ffedd063ff3d68fecf1b5700afe9f3a6a39a35909d803756c53527c4d3da01e3558c0a228a6af39171f8ef944c2174f7c4486
7
- data.tar.gz: b07fabfc77bfacfc74b7bcefb3935c41ded52426192d3df1ce8a61931aa504bbf2fcf1d136b96520ab88ba56ea00bd404354b7e1cfbe4389072a1983bd806362
6
+ metadata.gz: de6b9bf1f9c87a2b6032549f94acfe44614e5bbfa1e8f29915f5943e007134f3a0f7c70daf0abffe84bec1ee80d24901152c1f30a0b35217281011825ab6d414
7
+ data.tar.gz: f83d2baacdc8076c9b7afacb675c258ad6ec658317c21a275e929007edb8b7139ca6965cb022584b46277d6f066eb71a0bcee42d740ade120324381b01b86766
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2008-2015 thoughtbot, inc.
3
+ Copyright (c) 2008-2016 thoughtbot, inc.
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/NEWS.md CHANGED
@@ -1,3 +1,9 @@
1
+ master (unreleased)
2
+
3
+ * Switch from Airbrake to Honeybadger
4
+ * Generate applications with `rack_mini_profiler` (disabled by default, enabled
5
+ by setting `RACK_MINI_PROFILER=1`)
6
+
1
7
  1.35.0 (December 30, 2015)
2
8
 
3
9
  * Introduce Heroku Pipelines support
data/README.md CHANGED
@@ -66,7 +66,6 @@ List of changes we made since [this is commit](https://github.com/thoughtbot/sus
66
66
  - create common folders like `app/queries`, `app/services`, etc.
67
67
  - use `application.sass` instead of `application.scss`
68
68
  - add `brakeman` gem
69
- - change `i18n_tasks` configuration: set `it` as base locale
70
69
  - set `Rome` as `time_zone`
71
70
  - set `:it` as `default_locale`
72
71
  - add [simplecov](https://github.com/colszowka/simplecov)
@@ -87,3 +86,4 @@ List of changes we made since [this is commit](https://github.com/thoughtbot/sus
87
86
  - remove bitters and refills
88
87
  - lint factory girl's factories
89
88
  - remove automatic deployment
89
+ - use airbrake instead of honeybadger
@@ -68,12 +68,17 @@ module Suspenders
68
68
  end
69
69
 
70
70
  heroku_app_name = app_builder.app_name.dasherize
71
- %w(staging production).each do |environment|
72
- run_toolbelt_command(
73
- "pipelines:create #{heroku_app_name} -a #{heroku_app_name}-#{environment} --stage #{environment}",
74
- environment,
75
- )
76
- end
71
+ run_toolbelt_command(
72
+ "pipelines:create #{heroku_app_name} \
73
+ -a #{heroku_app_name}-staging --stage staging",
74
+ "staging",
75
+ )
76
+
77
+ run_toolbelt_command(
78
+ "pipelines:add #{heroku_app_name} \
79
+ -a #{heroku_app_name}-production --stage production",
80
+ "production",
81
+ )
77
82
  end
78
83
 
79
84
  def set_heroku_serve_static_files
@@ -20,6 +20,21 @@ module Suspenders
20
20
  template 'README.md.erb', 'README.md'
21
21
  end
22
22
 
23
+ def gitignore
24
+ copy_file "suspenders_gitignore", ".gitignore"
25
+ end
26
+
27
+ def gemfile
28
+ template "Gemfile.erb", "Gemfile"
29
+ end
30
+
31
+ def setup_rack_mini_profiler
32
+ copy_file(
33
+ "rack_mini_profiler.rb",
34
+ "config/initializers/rack_mini_profiler.rb",
35
+ )
36
+ end
37
+
23
38
  def raise_on_missing_assets_in_test
24
39
  inject_into_file(
25
40
  "config/environments/test.rb",
@@ -229,11 +244,6 @@ end
229
244
  bundle_command 'exec rake db:create db:migrate'
230
245
  end
231
246
 
232
- def replace_gemfile
233
- remove_file 'Gemfile'
234
- template 'Gemfile.erb', 'Gemfile'
235
- end
236
-
237
247
  def set_ruby_to_version_being_used
238
248
  create_file '.ruby-version', "#{Suspenders::RUBY_VERSION}\n"
239
249
  end
@@ -336,14 +346,6 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
336
346
  configure_environment "test", "config.active_job.queue_adapter = :inline"
337
347
  end
338
348
 
339
- def fix_i18n_deprecation_warning
340
- config = <<-RUBY
341
- config.i18n.enforce_available_locales = true
342
- RUBY
343
-
344
- inject_into_class 'config/application.rb', 'Application', config
345
- end
346
-
347
349
  def generate_rspec
348
350
  generate 'rspec:install'
349
351
  end
@@ -362,9 +364,7 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
362
364
  'app/assets/stylesheets/application.sass'
363
365
  end
364
366
 
365
- def gitignore_files
366
- remove_file '.gitignore'
367
- copy_file 'suspenders_gitignore', '.gitignore'
367
+ def setup_default_directories
368
368
  [
369
369
  'app/forms',
370
370
  'app/decorators',
@@ -383,8 +383,7 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
383
383
  'spec/support/mixins',
384
384
  'spec/support/shared_examples'
385
385
  ].each do |dir|
386
- run "mkdir #{dir}"
387
- run "touch #{dir}/.keep"
386
+ empty_directory_with_keep_file dir
388
387
  end
389
388
  end
390
389
 
@@ -54,7 +54,6 @@ module Suspenders
54
54
  end
55
55
 
56
56
  def customize_gemfile
57
- build :replace_gemfile
58
57
  build :create_ruby_gemset_file
59
58
  build :set_ruby_to_version_being_used
60
59
 
@@ -146,10 +145,10 @@ module Suspenders
146
145
  build :configure_slim
147
146
  build :disable_xml_params
148
147
  build :configure_available_locales
149
- build :fix_i18n_deprecation_warning
150
148
  build :setup_default_rake_task
151
149
  build :configure_puma
152
150
  build :set_up_forego
151
+ build :setup_rack_mini_profiler
153
152
  end
154
153
 
155
154
  def setup_stylesheets
@@ -159,8 +158,8 @@ module Suspenders
159
158
 
160
159
  def setup_git
161
160
  if !options[:skip_git]
162
- say 'Initializing git'
163
- invoke :setup_gitignore
161
+ say "Initializing git"
162
+ invoke :setup_default_directories
164
163
  invoke :init_git
165
164
  end
166
165
  end
@@ -190,8 +189,8 @@ module Suspenders
190
189
  build :copy_dotfiles
191
190
  end
192
191
 
193
- def setup_gitignore
194
- build :gitignore_files
192
+ def setup_default_directories
193
+ build :setup_default_directories
195
194
  end
196
195
 
197
196
  def setup_spring
@@ -227,8 +226,8 @@ module Suspenders
227
226
  end
228
227
 
229
228
  def outro
230
- say "Congratulations!"
231
- say "Now read the README.md"
229
+ say "Congratulations! You just pulled our suspenders."
230
+ say "Read README.md and configure Errbit."
232
231
  end
233
232
 
234
233
  protected
@@ -1,5 +1,5 @@
1
1
  module Suspenders
2
2
  RAILS_VERSION = "~> 4.2.0"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
- VERSION = "2.22.0"
4
+ VERSION = "2.23.0"
5
5
  end
@@ -7,6 +7,19 @@ RSpec.describe "Suspend a new project with default configuration" do
7
7
  run_suspenders
8
8
  end
9
9
 
10
+ it "uses custom Gemfile" do
11
+ gemfile_file = IO.read("#{project_path}/Gemfile")
12
+ expect(gemfile_file).to match(
13
+ /^ruby "#{Suspenders::RUBY_VERSION}"$/,
14
+ )
15
+ expect(gemfile_file).to match(
16
+ /^gem "autoprefixer-rails"$/,
17
+ )
18
+ expect(gemfile_file).to match(
19
+ /^gem "rails", "#{Suspenders::RAILS_VERSION}"$/,
20
+ )
21
+ end
22
+
10
23
  it "ensures project specs pass" do
11
24
  Dir.chdir(project_path) do
12
25
  Bundler.with_clean_env do
@@ -77,6 +90,23 @@ RSpec.describe "Suspend a new project with default configuration" do
77
90
  expect(File).to exist("#{project_path}/spec/support/fixtures_helper.rb")
78
91
  end
79
92
 
93
+ it "ensures Gemfile contains `rack-mini-profiler`" do
94
+ gemfile = IO.read("#{project_path}/Gemfile")
95
+
96
+ expect(gemfile).to include %{gem "rack-mini-profiler", require: false}
97
+ end
98
+
99
+ it "ensures .sample.env defaults to RACK_MINI_PROFILER=0" do
100
+ env = IO.read("#{project_path}/.env")
101
+
102
+ expect(env).to include "RACK_MINI_PROFILER=0"
103
+ end
104
+
105
+ it "creates a rack-mini-profiler initializer" do
106
+ expect(File).
107
+ to exist("#{project_path}/config/initializers/rack_mini_profiler.rb")
108
+ end
109
+
80
110
  it "adds rspec helper for queries" do
81
111
  expect(File).to exist("#{project_path}/spec/support/queries_helper.rb")
82
112
  end
@@ -84,7 +114,6 @@ RSpec.describe "Suspend a new project with default configuration" do
84
114
  it "configs locale and timezone" do
85
115
  result = IO.read("#{project_path}/config/application.rb")
86
116
 
87
- expect(result).to match(/^ +config.i18n.enforce_available_locales = true$/)
88
117
  expect(result).to match(/^ +config.i18n.available_locales = \[:en, :it\]$/)
89
118
  expect(result).to match(/^ +config.i18n.default_locale = :it$/)
90
119
 
@@ -44,7 +44,7 @@ class FakeHeroku
44
44
 
45
45
  def self.has_setup_pipeline_for?(app_name)
46
46
  commands_ran =~ /^pipelines:create #{app_name} -a #{app_name}-staging --stage staging/ &&
47
- commands_ran =~ /^pipelines:create #{app_name} -a #{app_name}-production --stage production/
47
+ commands_ran =~ /^pipelines:add #{app_name} -a #{app_name}-production --stage production/
48
48
  end
49
49
 
50
50
  def self.commands_ran
@@ -28,7 +28,6 @@ gem "uglifier"
28
28
 
29
29
  group :development do
30
30
  gem "letter_opener"
31
- gem "quiet_assets"
32
31
  gem "spring"
33
32
  gem "spring-commands-rspec"
34
33
  gem "web-console"
@@ -45,10 +44,15 @@ group :development, :test do
45
44
  gem "priscilla"
46
45
  gem "pry-byebug"
47
46
  gem "pry-rails"
47
+ gem "quiet_assets"
48
48
  gem "rspec-rails", "~> 3.4.0"
49
49
  gem "rubocop", require: false
50
50
  end
51
51
 
52
+ group :development, :staging do
53
+ gem "rack-mini-profiler", require: false
54
+ end
55
+
52
56
  group :test do
53
57
  gem "capybara-webkit"
54
58
  gem "database_cleaner"
@@ -3,6 +3,7 @@ ASSET_HOST=localhost:3000
3
3
  APPLICATION_HOST=localhost:3000
4
4
  PORT=3000
5
5
  RACK_ENV=development
6
+ RACK_MINI_PROFILER=0
6
7
  SECRET_KEY_BASE=development_secret
7
8
  EXECJS_RUNTIME=Node
8
9
  SMTP_ADDRESS=smtp.example.com
@@ -0,0 +1,5 @@
1
+ if ENV["RACK_MINI_PROFILER"].to_i > 0
2
+ require "rack-mini-profiler"
3
+
4
+ Rack::MiniProfilerRails.initialize!(Rails.application)
5
+ end
@@ -1,5 +1,8 @@
1
+ Rails:
2
+ Enabled: true
3
+
1
4
  AllCops:
2
- RunRailsCops: true
5
+ TargetRubyVersion: 2.3
3
6
  Exclude:
4
7
  - "db/**/*"
5
8
  - "config/**/*"
@@ -15,6 +18,9 @@ Style/StringLiterals:
15
18
  Style/Documentation:
16
19
  Enabled: false
17
20
 
21
+ Style/FrozenStringLiteralComment:
22
+ Enabled: false
23
+
18
24
  Metrics/AbcSize:
19
25
  Max: 18
20
26
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: welaika-suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.22.0
4
+ version: 2.23.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-03 00:00:00.000000000 Z
12
+ date: 2016-02-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -144,6 +144,7 @@ files:
144
144
  - templates/postgresql_database.yml.erb
145
145
  - templates/puma.rb
146
146
  - templates/queries_helper_rspec.rb
147
+ - templates/rack_mini_profiler.rb
147
148
  - templates/rails_helper.rb
148
149
  - templates/rubocop.rake
149
150
  - templates/rubocop.yml