philosophies-suspenders 2.0.2 → 2.1.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: f4d6c7f9c63ca8ae28fdc7a6b1e28a33287b6de1
4
- data.tar.gz: 4a0c56e3cfce4a914bd73769803beafcf1243174
3
+ metadata.gz: 9ea97f05b374f6e5bda09ac000f8100e478f4b9a
4
+ data.tar.gz: 15e7f0f8b029e605ba1a97930020c66b45027187
5
5
  SHA512:
6
- metadata.gz: 898984d912915fd1662a85593a03ef0afa38ffcfe26c39223269f2cd692edf43c3da7eda5062c51500e55fa1ef69cdc9303a65e6155c9b5995d696c80f0248c6
7
- data.tar.gz: aa1e575faabc660d67541b2c4593a6ea5f1eedab69fc42520df73afac57ef286d61b4ea270257585984232b5d3db8a83b52a5f3906c5f280dc86140f19146c98
6
+ metadata.gz: 0013e462459fe3e24abafa35e44d623ef50c838dd9c16943a4286f684451b491098c9fc80ab3e9bbc1d9c0cbb73a2d486e729da9c365201ac98ffd291ab2752c
7
+ data.tar.gz: 10d0ae355965573ab712e3b8d18877df5dc2b17e5f10e988480ce56b94e895cce473d9852d77536d16a1cdde0c1788f05142307ee4c891a354cdd8524a3bfea3
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.2.2
1
+ 2.3.0
data/Gemfile.lock CHANGED
@@ -1,43 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- philosophies-suspenders (2.0.2)
4
+ philosophies-suspenders (2.1.0)
5
5
  bundler (~> 1.3)
6
- rails (= 4.2.3)
6
+ rails (= 4.2.5.1)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionmailer (4.2.3)
12
- actionpack (= 4.2.3)
13
- actionview (= 4.2.3)
14
- activejob (= 4.2.3)
11
+ actionmailer (4.2.5.1)
12
+ actionpack (= 4.2.5.1)
13
+ actionview (= 4.2.5.1)
14
+ activejob (= 4.2.5.1)
15
15
  mail (~> 2.5, >= 2.5.4)
16
16
  rails-dom-testing (~> 1.0, >= 1.0.5)
17
- actionpack (4.2.3)
18
- actionview (= 4.2.3)
19
- activesupport (= 4.2.3)
17
+ actionpack (4.2.5.1)
18
+ actionview (= 4.2.5.1)
19
+ activesupport (= 4.2.5.1)
20
20
  rack (~> 1.6)
21
21
  rack-test (~> 0.6.2)
22
22
  rails-dom-testing (~> 1.0, >= 1.0.5)
23
23
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
24
- actionview (4.2.3)
25
- activesupport (= 4.2.3)
24
+ actionview (4.2.5.1)
25
+ activesupport (= 4.2.5.1)
26
26
  builder (~> 3.1)
27
27
  erubis (~> 2.7.0)
28
28
  rails-dom-testing (~> 1.0, >= 1.0.5)
29
29
  rails-html-sanitizer (~> 1.0, >= 1.0.2)
30
- activejob (4.2.3)
31
- activesupport (= 4.2.3)
30
+ activejob (4.2.5.1)
31
+ activesupport (= 4.2.5.1)
32
32
  globalid (>= 0.3.0)
33
- activemodel (4.2.3)
34
- activesupport (= 4.2.3)
33
+ activemodel (4.2.5.1)
34
+ activesupport (= 4.2.5.1)
35
35
  builder (~> 3.1)
36
- activerecord (4.2.3)
37
- activemodel (= 4.2.3)
38
- activesupport (= 4.2.3)
36
+ activerecord (4.2.5.1)
37
+ activemodel (= 4.2.5.1)
38
+ activesupport (= 4.2.5.1)
39
39
  arel (~> 6.0)
40
- activesupport (4.2.3)
40
+ activesupport (4.2.5.1)
41
41
  i18n (~> 0.7)
42
42
  json (~> 1.7, >= 1.7.7)
43
43
  minitest (~> 5.1)
@@ -49,6 +49,7 @@ GEM
49
49
  columnize (= 0.9.0)
50
50
  coderay (1.1.0)
51
51
  columnize (0.9.0)
52
+ concurrent-ruby (1.0.0)
52
53
  diff-lcs (1.2.5)
53
54
  erubis (2.7.0)
54
55
  globalid (0.3.6)
@@ -60,11 +61,11 @@ GEM
60
61
  mail (2.6.3)
61
62
  mime-types (>= 1.16, < 3)
62
63
  method_source (0.8.2)
63
- mime-types (2.6.1)
64
- mini_portile (0.6.2)
65
- minitest (5.8.0)
66
- nokogiri (1.6.6.2)
67
- mini_portile (~> 0.6.0)
64
+ mime-types (2.99)
65
+ mini_portile2 (2.0.0)
66
+ minitest (5.8.4)
67
+ nokogiri (1.6.7.2)
68
+ mini_portile2 (~> 2.0.0.rc2)
68
69
  pry (0.10.1)
69
70
  coderay (~> 1.1.0)
70
71
  method_source (~> 0.8.1)
@@ -75,16 +76,16 @@ GEM
75
76
  rack (1.6.4)
76
77
  rack-test (0.6.3)
77
78
  rack (>= 1.0)
78
- rails (4.2.3)
79
- actionmailer (= 4.2.3)
80
- actionpack (= 4.2.3)
81
- actionview (= 4.2.3)
82
- activejob (= 4.2.3)
83
- activemodel (= 4.2.3)
84
- activerecord (= 4.2.3)
85
- activesupport (= 4.2.3)
79
+ rails (4.2.5.1)
80
+ actionmailer (= 4.2.5.1)
81
+ actionpack (= 4.2.5.1)
82
+ actionview (= 4.2.5.1)
83
+ activejob (= 4.2.5.1)
84
+ activemodel (= 4.2.5.1)
85
+ activerecord (= 4.2.5.1)
86
+ activesupport (= 4.2.5.1)
86
87
  bundler (>= 1.3.0, < 2.0)
87
- railties (= 4.2.3)
88
+ railties (= 4.2.5.1)
88
89
  sprockets-rails
89
90
  rails-deprecated_sanitizer (1.0.3)
90
91
  activesupport (>= 4.2.0.alpha)
@@ -92,14 +93,14 @@ GEM
92
93
  activesupport (>= 4.2.0.beta, < 5.0)
93
94
  nokogiri (~> 1.6.0)
94
95
  rails-deprecated_sanitizer (>= 1.0.1)
95
- rails-html-sanitizer (1.0.2)
96
+ rails-html-sanitizer (1.0.3)
96
97
  loofah (~> 2.0)
97
- railties (4.2.3)
98
- actionpack (= 4.2.3)
99
- activesupport (= 4.2.3)
98
+ railties (4.2.5.1)
99
+ actionpack (= 4.2.5.1)
100
+ activesupport (= 4.2.5.1)
100
101
  rake (>= 0.8.7)
101
102
  thor (>= 0.18.1, < 2.0)
102
- rake (10.4.2)
103
+ rake (10.5.0)
103
104
  rspec (3.3.0)
104
105
  rspec-core (~> 3.3.0)
105
106
  rspec-expectations (~> 3.3.0)
@@ -114,12 +115,13 @@ GEM
114
115
  rspec-support (~> 3.3.0)
115
116
  rspec-support (3.3.0)
116
117
  slop (3.6.0)
117
- sprockets (3.3.2)
118
- rack (~> 1.0)
119
- sprockets-rails (2.3.2)
120
- actionpack (>= 3.0)
121
- activesupport (>= 3.0)
122
- sprockets (>= 2.8, < 4.0)
118
+ sprockets (3.5.2)
119
+ concurrent-ruby (~> 1.0)
120
+ rack (> 1, < 3)
121
+ sprockets-rails (3.0.1)
122
+ actionpack (>= 4.0)
123
+ activesupport (>= 4.0)
124
+ sprockets (>= 3.0.0)
123
125
  thor (0.19.1)
124
126
  thread_safe (0.3.5)
125
127
  tzinfo (1.2.2)
@@ -135,4 +137,4 @@ DEPENDENCIES
135
137
  rspec (~> 3.2)
136
138
 
137
139
  BUNDLED WITH
138
- 1.10.5
140
+ 1.11.2
data/README.md CHANGED
@@ -53,6 +53,8 @@ It includes application gems like:
53
53
  * [Title](https://github.com/calebthompson/title) for storing titles in
54
54
  translations
55
55
  * [Unicorn](https://github.com/defunkt/unicorn) to serve HTTP requests
56
+ * [rails_12factor](https://github.com/heroku/rails_12factor) for easier Heroku
57
+ deploys
56
58
 
57
59
  And development gems like:
58
60
 
@@ -121,7 +123,7 @@ By default, suspenders will:
121
123
  * Configures staging with `RACK_ENV` and `RAILS_ENV` environment variables set
122
124
  to `staging`
123
125
  * Adds the [Rails 12factor][rails-12factor] gem
124
- * Adds free Mandrill add-on and configure SMTP settings to use it
126
+ * Adds free Sendgrid add-on and configure SMTP settings to use it
125
127
  * Adds free Airbrake add-on
126
128
  * Adds free Papertrail add-on
127
129
 
@@ -197,6 +199,14 @@ installing QT are
197
199
 
198
200
  PostgreSQL needs to be installed and running for the `db:create` rake task.
199
201
 
202
+ ## Contributing / Feature requests
203
+
204
+ Philosophie's Suspenders is meant to support the core functionality of a new rails project. Many nice to have features are therefore not appropriate. If you have an idea for a new feature, here are the steps for having it added:
205
+
206
+ - please bring your idea up in the #nerds channel first to gauge it's popularity
207
+ - if you are able to, create a PR for the new functionality
208
+ - if you need help creating a PR find someone to pair with
209
+
200
210
  ## License
201
211
 
202
212
  Suspenders is Copyright © 2008-2015 thoughtbot.
@@ -87,6 +87,20 @@ module Suspenders
87
87
  )
88
88
  end
89
89
 
90
+ def configure_production_log_level
91
+ replace_in_file(
92
+ 'config/environments/production.rb',
93
+ " # Use the lowest log level to ensure availability of diagnostic information\n # when problems arise.",
94
+ ''
95
+ )
96
+
97
+ replace_in_file(
98
+ 'config/environments/production.rb',
99
+ ' config.log_level = :debug',
100
+ ' config.log_level = :info'
101
+ )
102
+ end
103
+
90
104
  def enable_rack_deflater
91
105
  config = <<-RUBY
92
106
 
@@ -218,10 +232,11 @@ end
218
232
  end
219
233
 
220
234
  def configure_rspec
221
- remove_file "spec/rails_helper.rb"
222
- remove_file "spec/spec_helper.rb"
223
- copy_file "rails_helper.rb", "spec/rails_helper.rb"
224
- copy_file "spec_helper.rb", "spec/spec_helper.rb"
235
+ remove_file '.rspec'
236
+ remove_file 'spec/rails_helper.rb'
237
+ remove_file 'spec/spec_helper.rb'
238
+ copy_file 'rails_helper.rb', 'spec/rails_helper.rb'
239
+ copy_file 'spec_helper.rb', 'spec/spec_helper.rb'
225
240
  end
226
241
 
227
242
  def configure_i18n_for_test_environment
@@ -247,20 +262,12 @@ end
247
262
  template "config_locales_en.yml.erb", "config/locales/en.yml"
248
263
  end
249
264
 
250
- def configure_rack_timeout
251
- rack_timeout_config = <<-RUBY
252
- Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
253
- RUBY
254
-
255
- append_file "config/environments/production.rb", rack_timeout_config
256
- end
257
-
258
265
  def configure_simple_form
259
266
  bundle_command "exec rails generate simple_form:install"
260
267
  end
261
268
 
262
269
  def configure_action_mailer
263
- action_mailer_host "development", %{"localhost:#{port}"}
270
+ action_mailer_host "development", %{ENV["HOST"] || "localhost:3000"}
264
271
  action_mailer_host "test", %{"www.example.com"}
265
272
  action_mailer_host "staging", %{ENV.fetch("HOST")}
266
273
  action_mailer_host "production", %{ENV.fetch("HOST")}
@@ -448,7 +455,7 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
448
455
  end
449
456
 
450
457
  def configure_heroku_app(environment)
451
- run_heroku "addons:create mandrill", environment
458
+ run_heroku "addons:create sendgrid", environment
452
459
  run_heroku "addons:create airbrake:free_heroku", environment
453
460
  run_heroku "addons:create papertrail", environment
454
461
 
@@ -456,10 +463,10 @@ Rack::Timeout.timeout = (ENV["RACK_TIMEOUT"] || 10).to_i
456
463
 
457
464
  env_vars = [
458
465
  'SMTP_DOMAIN=heroku.com',
459
- 'SMTP_ADDRESS=smtp.mandrillapp.com',
460
- 'SMTP_PROVIDER=mandrill',
466
+ 'SMTP_ADDRESS=smtp.sendgrid.net',
467
+ 'SMTP_PROVIDER=sendgrid',
461
468
  "HOST=#{domain}",
462
- "ASSET_HOST=#{domain}"
469
+ "ASSET_HOST=//#{domain}"
463
470
  ]
464
471
 
465
472
  run_heroku "config:add #{env_vars.join(' ')}", environment
@@ -577,10 +584,6 @@ end
577
584
  SecureRandom.hex(64)
578
585
  end
579
586
 
580
- def port
581
- @port ||= [3000, 4000, 5000, 7000, 8000, 9000].sample
582
- end
583
-
584
587
  def serve_static_files_line
585
588
  "config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?\n"
586
589
  end
@@ -117,8 +117,8 @@ module Suspenders
117
117
  say 'Setting up the production environment'
118
118
  build :configure_newrelic
119
119
  build :configure_smtp
120
- build :configure_rack_timeout
121
120
  build :enable_rack_canonical_host
121
+ build :configure_production_log_level
122
122
  build :enable_rack_deflater
123
123
  build :setup_asset_host
124
124
  end
@@ -1,5 +1,5 @@
1
1
  module Suspenders
2
- RAILS_VERSION = "4.2.3"
2
+ RAILS_VERSION = "4.2.5.1"
3
3
  RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip
4
- VERSION = "2.0.2"
4
+ VERSION = "2.1.0"
5
5
  end
@@ -3,7 +3,7 @@ source "https://rubygems.org"
3
3
  ruby "<%= Suspenders::RUBY_VERSION %>"
4
4
  gem "rails", "<%= Suspenders::RAILS_VERSION %>"
5
5
 
6
- gem "airbrake"
6
+ gem "airbrake", require: false
7
7
  gem "autoprefixer-rails"
8
8
  gem "bundler", ">= 1.8.4"
9
9
  gem "coffee-rails", "~> 4.1.0"
@@ -13,7 +13,6 @@ gem "newrelic_rpm", ">= 3.9.8"
13
13
  gem "pg"
14
14
  gem "quiet_assets"
15
15
  gem "rack-canonical-host"
16
- gem "rails", "<%= Suspenders::RAILS_VERSION %>"
17
16
  gem "recipient_interceptor"
18
17
  gem "sass-rails", "~> 5.0"
19
18
  gem "sidekiq"
@@ -55,5 +54,5 @@ group :test do
55
54
  end
56
55
 
57
56
  group :staging, :production do
58
- gem "rack-timeout"
57
+ gem "rails_12factor"
59
58
  end
@@ -1,5 +1,50 @@
1
1
  if ENV.include?('AIRBRAKE_API_KEY')
2
- Airbrake.configure do |config|
3
- config.api_key = ENV.fetch('AIRBRAKE_API_KEY')
2
+ require 'airbrake'
3
+ # Airbrake is an online tool that provides robust exception tracking in your Rails
4
+ # applications. In doing so, it allows you to easily review errors, tie an error
5
+ # to an individual piece of code, and trace the cause back to recent
6
+ # changes. Airbrake enables for easy categorization, searching, and prioritization
7
+ # of exceptions so that when errors occur, your team can quickly determine the
8
+ # root cause.
9
+ #
10
+ # Configuration details:
11
+ # https://github.com/airbrake/airbrake-ruby#configuration
12
+ Airbrake.configure do |c|
13
+ # You must set both project_id & project_key. To find your project_id and
14
+ # project_key navigate to your project's General Settings and copy the values
15
+ # from the right sidebar.
16
+ # https://github.com/airbrake/airbrake-ruby#project_id--project_key
17
+ c.project_id = ENV.fetch('AIRBRAKE_PROJECT_ID')
18
+ c.project_key = ENV.fetch('AIRBRAKE_API_KEY')
19
+
20
+ # Configures the root directory of your project. Expects a String or a
21
+ # Pathname, which represents the path to your project. Providing this option
22
+ # helps us to filter out repetitive data from backtrace frames and link to
23
+ # GitHub files from our dashboard.
24
+ # https://github.com/airbrake/airbrake-ruby#root_directory
25
+ c.root_directory = Rails.root
26
+
27
+ # By default, Airbrake Ruby outputs to STDOUT. In Rails apps it makes sense to
28
+ # use the Rails' logger.
29
+ # https://github.com/airbrake/airbrake-ruby#logger
30
+ c.logger = Rails.logger
31
+
32
+ # Configures the environment the application is running in. Helps the Airbrake
33
+ # dashboard to distinguish between exceptions occurring in different
34
+ # environments. By default, it's not set.
35
+ # https://github.com/airbrake/airbrake-ruby#environment
36
+ c.environment = Rails.env
37
+
38
+ # Setting this option allows Airbrake to filter exceptions occurring in
39
+ # unwanted environments such as :test. By default, it is equal to an empty
40
+ # Array, which means Airbrake Ruby sends exceptions occurring in all
41
+ # environments.
42
+ # https://github.com/airbrake/airbrake-ruby#ignore_environments
43
+ c.ignore_environments = %w(test)
4
44
  end
45
+
46
+ # If Airbrake doesn't send any expected exceptions, we suggest to uncomment the
47
+ # line below. It might simplify debugging of background Airbrake workers, which
48
+ # can silently die.
49
+ # Thread.abort_on_exception = ['test', 'development'].include?(Rails.env)
5
50
  end
@@ -1,5 +1,7 @@
1
1
  ENV['RAILS_ENV'] = 'test'
2
2
 
3
+ require 'spec_helper'
4
+
3
5
  require File.expand_path('../../config/environment', __FILE__)
4
6
 
5
7
  require 'rspec/rails'
@@ -8,6 +10,7 @@ require 'shoulda/matchers'
8
10
  Dir[Rails.root.join('spec/support/**/*.rb')].sort.each { |file| require file }
9
11
 
10
12
  RSpec.configure do |config|
13
+ config.include FactoryGirl::Syntax::Methods
11
14
  config.infer_base_class_for_anonymous_controllers = false
12
15
  config.infer_spec_type_from_file_location!
13
16
  config.use_transactional_fixtures = false
data/templates/setup.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  setup :secret_key_base
2
2
  env 'HOST', provide('Host', default: 'localhost:3000')
3
- env 'ASSET_HOST', provide('Asset host', default: 'localhost:3000')
3
+ env 'ASSET_HOST', provide('Asset host', default: '//localhost:3000')
4
4
 
5
5
  rake 'db:setup'
data/templates/smtp.rb CHANGED
@@ -1,17 +1,20 @@
1
1
  if ENV['SMTP_PROVIDER'] == 'mandrill'
2
- SMTP_USERNAME = ENV.fetch('MANDRILL_USERNAME')
3
- SMTP_PASSWORD = ENV.fetch('MANDRILL_APIKEY')
2
+ SMTP_USERNAME = ENV.fetch 'MANDRILL_USERNAME'
3
+ SMTP_PASSWORD = ENV.fetch 'MANDRILL_APIKEY'
4
+ elsif ENV['SMTP_PROVIDER'] == 'sendgrid'
5
+ SMTP_USERNAME = ENV.fetch 'SENDGRID_USERNAME'
6
+ SMTP_PASSWORD = ENV.fetch 'SENDGRID_PASSWORD'
4
7
  else
5
- SMTP_USERNAME = ENV.fetch('SMTP_USERNAME')
6
- SMTP_PASSWORD = ENV.fetch("SMTP_PASSWORD")
8
+ SMTP_USERNAME = ENV.fetch 'SMTP_USERNAME'
9
+ SMTP_PASSWORD = ENV.fetch 'SMTP_PASSWORD'
7
10
  end
8
11
 
9
12
  SMTP_SETTINGS = {
10
- address: ENV.fetch("SMTP_ADDRESS"), # example: "smtp.mandrillapp.com"
13
+ address: ENV.fetch('SMTP_ADDRESS'), # example: "smtp.mandrillapp.com"
11
14
  authentication: :plain,
12
- domain: ENV.fetch("SMTP_DOMAIN"), # example: "heroku.com"
15
+ domain: ENV.fetch('SMTP_DOMAIN'), # example: "heroku.com"
13
16
  enable_starttls_auto: true,
14
17
  password: SMTP_PASSWORD,
15
- port: "587",
18
+ port: '587',
16
19
  user_name: SMTP_USERNAME
17
20
  }
@@ -10,4 +10,5 @@ RSpec.configure do |config|
10
10
  end
11
11
 
12
12
  config.order = :random
13
+ config.color = true
13
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: philosophies-suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philosophie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-19 00:00:00.000000000 Z
11
+ date: 2016-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 4.2.3
33
+ version: 4.2.5.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 4.2.3
40
+ version: 4.2.5.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pry
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -164,7 +164,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
164
164
  requirements:
165
165
  - - ">="
166
166
  - !ruby/object:Gem::Version
167
- version: 2.2.2
167
+ version: 2.3.0
168
168
  required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  requirements:
170
170
  - - ">="
@@ -172,7 +172,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
172
172
  version: '0'
173
173
  requirements: []
174
174
  rubyforge_project:
175
- rubygems_version: 2.4.5
175
+ rubygems_version: 2.5.1
176
176
  signing_key:
177
177
  specification_version: 4
178
178
  summary: Generate a Rails app using Philosophie's best practices.