suspenders 1.37.0 → 1.38.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: 968be501f2d79ae35eebc0e702fd06fdeb9520fd
4
- data.tar.gz: 0f499e1c7069a7b726d6c44c3b60b2c8b2051a30
3
+ metadata.gz: 39d94edf60f71093f91ed7a93fd48593d2f11c3f
4
+ data.tar.gz: 3ac3fe49c1570a2bc73512b044f7e8ca0c16e636
5
5
  SHA512:
6
- metadata.gz: 1b5d767fdd1e1c98aac56ad7b25d0c61fcbd4b54a867f3cecd42c85b455ec00c304a1f5f3f3209e8c87dcef41eb6ae518a572de619b80c920f2b3bb5c2e2dbc4
7
- data.tar.gz: f1093c609e429105deffd20e8b82c4a9beaf865f04de54bb6f5d0fd489b251b07e7577268d2f27ef47093ea5ce03267c0638c5249bdf4d513b6d06e334a46e5a
6
+ metadata.gz: c5e6d94dea4937ff82ed514950ecd9c399caf923f8013dcbe14d9f6fd017c070f5d0d09e5b2d39830a9acca9df18538cfe54c16f68221ffb8436f038ff87ab49
7
+ data.tar.gz: 3fbcf388da90d8aa42d520e911c839b8c2349a3fa4d8ad5d73e8a4ec17c190ba400dd12ec96972702c9aa8645cdc75dfaf5230800eddc1c00812c88113ef88ba
data/NEWS.md CHANGED
@@ -1,3 +1,9 @@
1
+ 1.38.0 (April 15, 2016)
2
+
3
+ * Update bourbon to `v5.0.0.beta.5`
4
+ * Drops staging environment in favor of configuration through env variables
5
+ * Bugfix: failing migrations were not making Heroku deploys fail
6
+
1
7
  1.37.0 (March 13, 2016)
2
8
 
3
9
  * Remove `RAILS_ENV` definitions
@@ -6,7 +6,12 @@ $LOAD_PATH << source_path
6
6
 
7
7
  require 'suspenders'
8
8
 
9
- if ['-v', '--version'].include? ARGV[0]
9
+ if ARGV.empty?
10
+ puts "Please provide a path for the new application"
11
+ puts
12
+ puts "See --help for more info"
13
+ exit 0
14
+ elsif ['-v', '--version'].include? ARGV[0]
10
15
  puts Suspenders::VERSION
11
16
  exit 0
12
17
  end
@@ -25,11 +25,9 @@ module Suspenders
25
25
  end
26
26
 
27
27
  def create_staging_heroku_app(flags)
28
- rack_env = "RACK_ENV=staging"
29
28
  app_name = heroku_app_name_for("staging")
30
29
 
31
30
  run_toolbelt_command "create #{app_name} #{flags}", "staging"
32
- run_toolbelt_command "config:add #{rack_env}", "staging"
33
31
  end
34
32
 
35
33
  def create_production_heroku_app(flags)
@@ -196,20 +196,6 @@ module Suspenders
196
196
  )
197
197
  end
198
198
 
199
- def setup_staging_environment
200
- staging_file = 'config/environments/staging.rb'
201
- copy_file 'staging.rb', staging_file
202
-
203
- config = <<-RUBY
204
-
205
- Rails.application.configure do
206
- # ...
207
- end
208
- RUBY
209
-
210
- append_file staging_file, config
211
- end
212
-
213
199
  def setup_secret_token
214
200
  template 'secrets.yml', 'config/secrets.yml', force: true
215
201
  end
@@ -34,7 +34,6 @@ module Suspenders
34
34
  invoke :setup_development_environment
35
35
  invoke :setup_test_environment
36
36
  invoke :setup_production_environment
37
- invoke :setup_staging_environment
38
37
  invoke :setup_secret_token
39
38
  invoke :create_suspenders_views
40
39
  invoke :configure_app
@@ -118,11 +117,6 @@ module Suspenders
118
117
  build :setup_asset_host
119
118
  end
120
119
 
121
- def setup_staging_environment
122
- say 'Setting up the staging environment'
123
- build :setup_staging_environment
124
- end
125
-
126
120
  def setup_secret_token
127
121
  say 'Moving secret token out of version control'
128
122
  build :setup_secret_token
@@ -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 = "1.37.0"
4
+ VERSION = "1.38.0"
5
5
  end
@@ -9,6 +9,7 @@ RSpec.describe "GitHub" do
9
9
  it "suspends a project with --github option" do
10
10
  repo_name = 'test'
11
11
  run_suspenders("--github=#{repo_name}")
12
+ setup_app_dependencies
12
13
 
13
14
  expect(FakeGithub).to have_created_repo(repo_name)
14
15
  end
@@ -5,6 +5,7 @@ RSpec.describe "Heroku" do
5
5
  before(:all) do
6
6
  clean_up
7
7
  run_suspenders("--heroku=true")
8
+ setup_app_dependencies
8
9
  end
9
10
 
10
11
  it "suspends a project for Heroku" do
@@ -33,7 +34,7 @@ RSpec.describe "Heroku" do
33
34
  bin_setup_path = "#{project_path}/bin/setup_review_app"
34
35
  bin_setup = IO.read(bin_setup_path)
35
36
 
36
- expect(bin_setup).to include("heroku run rake db:migrate --app #{app_name}-staging-pr-$1")
37
+ expect(bin_setup).to include("heroku run rake db:migrate --exit-code --app #{app_name}-staging-pr-$1")
37
38
  expect(bin_setup).to include("heroku ps:scale worker=1 --app #{app_name}-staging-pr-$1")
38
39
  expect(bin_setup).to include("heroku restart --app #{app_name}-staging-pr-$1")
39
40
  expect(File.stat(bin_setup_path)).to be_executable
@@ -41,7 +42,7 @@ RSpec.describe "Heroku" do
41
42
  bin_deploy_path = "#{project_path}/bin/deploy"
42
43
  bin_deploy = IO.read(bin_deploy_path)
43
44
 
44
- expect(bin_deploy).to include("heroku run rake db:migrate")
45
+ expect(bin_deploy).to include("heroku run rake db:migrate --exit-code")
45
46
  expect(File.stat(bin_deploy_path)).to be_executable
46
47
 
47
48
  readme = IO.read("#{project_path}/README.md")
@@ -77,6 +78,7 @@ RSpec.describe "Heroku" do
77
78
  before(:all) do
78
79
  clean_up
79
80
  run_suspenders(%{--heroku=true --heroku-flags="--region eu"})
81
+ setup_app_dependencies
80
82
  end
81
83
 
82
84
  it "suspends a project with extra Heroku flags" do
@@ -5,6 +5,7 @@ RSpec.describe "Suspend a new project with default configuration" do
5
5
  drop_dummy_database
6
6
  remove_project_directory
7
7
  run_suspenders
8
+ setup_app_dependencies
8
9
  end
9
10
 
10
11
  it "uses custom Gemfile" do
@@ -28,14 +29,6 @@ RSpec.describe "Suspend a new project with default configuration" do
28
29
  end
29
30
  end
30
31
 
31
- it "inherits staging config from production" do
32
- staging_file = IO.read("#{project_path}/config/environments/staging.rb")
33
- config_stub = "Rails.application.configure do"
34
-
35
- expect(staging_file).to match(/^require_relative "production"/)
36
- expect(staging_file).to match(/#{config_stub}/), staging_file
37
- end
38
-
39
32
  it "creates .ruby-version from Suspenders .ruby-version" do
40
33
  ruby_version_file = IO.read("#{project_path}/.ruby-version")
41
34
 
@@ -162,6 +155,12 @@ RSpec.describe "Suspend a new project with default configuration" do
162
155
  expect(prod_env_file).not_to match(/"HOST"/)
163
156
  end
164
157
 
158
+ it "configures email interceptor in smtp config" do
159
+ smtp_file = IO.read("#{project_path}/config/smtp.rb")
160
+ expect(smtp_file).
161
+ to match(/RecipientInterceptor.new\(ENV\["EMAIL_RECIPIENTS"\]\)/)
162
+ end
163
+
165
164
  it "configures language in html element" do
166
165
  layout_path = "/app/views/layouts/application.html.erb"
167
166
  layout_file = IO.read("#{project_path}#{layout_path}")
@@ -20,6 +20,16 @@ module SuspendersTestHelpers
20
20
  end
21
21
  end
22
22
 
23
+ def setup_app_dependencies
24
+ if File.exist?(project_path)
25
+ Dir.chdir(project_path) do
26
+ Bundler.with_clean_env do
27
+ `bundle check || bundle install`
28
+ end
29
+ end
30
+ end
31
+ end
32
+
23
33
  def drop_dummy_database
24
34
  if File.exist?(project_path)
25
35
  Dir.chdir(project_path) do
@@ -31,9 +31,4 @@ rush to build something amazing; don't use it if you like missing deadlines.
31
31
  s.add_dependency 'rails', Suspenders::RAILS_VERSION
32
32
 
33
33
  s.add_development_dependency 'rspec', '~> 3.2'
34
- s.add_development_dependency 'bitters', '~> 1.3'
35
- s.add_development_dependency 'simple_form', '~> 3.2'
36
- s.add_development_dependency 'title', '~> 0.0'
37
- s.add_development_dependency 'quiet_assets', '~> 1.1'
38
- s.add_development_dependency 'capybara-webkit', '~> 1.8'
39
34
  end
@@ -3,7 +3,7 @@ source "https://rubygems.org"
3
3
  ruby "<%= Suspenders::RUBY_VERSION %>"
4
4
 
5
5
  gem "autoprefixer-rails"
6
- gem "bourbon", "5.0.0.beta.3"
6
+ gem "bourbon", "5.0.0.beta.5"
7
7
  gem "delayed_job_active_record"
8
8
  gem "flutie"
9
9
  gem "high_voltage"
@@ -2,7 +2,6 @@
2
2
  <style type="text/css">
3
3
  * {
4
4
  transition-property: none !important;
5
- -webkit-transition-property: none !important;
6
5
  }
7
6
  </style>
8
7
  <% end %>
@@ -8,5 +8,5 @@ branch="$(git symbolic-ref HEAD --short)"
8
8
  target="${1:-staging}"
9
9
 
10
10
  git push "$target" "$branch:master"
11
- heroku run rake db:migrate --remote "$target"
11
+ heroku run rake db:migrate --exit-code --remote "$target"
12
12
  heroku restart --remote "$target"
@@ -14,6 +14,6 @@ heroku pg:backups restore \
14
14
  DATABASE_URL \
15
15
  --confirm <%= app_name.dasherize %>-staging-pr-$1 \
16
16
  --app <%= app_name.dasherize %>-staging-pr-$1
17
- heroku run rake db:migrate --app <%= app_name.dasherize %>-staging-pr-$1
17
+ heroku run rake db:migrate --exit-code --app <%= app_name.dasherize %>-staging-pr-$1
18
18
  heroku ps:scale worker=1 --app <%= app_name.dasherize %>-staging-pr-$1
19
19
  heroku restart --app <%= app_name.dasherize %>-staging-pr-$1
@@ -7,3 +7,7 @@ SMTP_SETTINGS = {
7
7
  port: "587",
8
8
  user_name: ENV.fetch("SMTP_USERNAME")
9
9
  }
10
+
11
+ if ENV["EMAIL_RECIPIENTS"].present?
12
+ Mail.register_interceptor RecipientInterceptor.new(ENV["EMAIL_RECIPIENTS"])
13
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.37.0
4
+ version: 1.38.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - thoughtbot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-13 00:00:00.000000000 Z
11
+ date: 2016-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,76 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.2'
55
- - !ruby/object:Gem::Dependency
56
- name: bitters
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: '1.3'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: '1.3'
69
- - !ruby/object:Gem::Dependency
70
- name: simple_form
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - "~>"
74
- - !ruby/object:Gem::Version
75
- version: '3.2'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - "~>"
81
- - !ruby/object:Gem::Version
82
- version: '3.2'
83
- - !ruby/object:Gem::Dependency
84
- name: title
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '0.0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - "~>"
95
- - !ruby/object:Gem::Version
96
- version: '0.0'
97
- - !ruby/object:Gem::Dependency
98
- name: quiet_assets
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - "~>"
102
- - !ruby/object:Gem::Version
103
- version: '1.1'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - "~>"
109
- - !ruby/object:Gem::Version
110
- version: '1.1'
111
- - !ruby/object:Gem::Dependency
112
- name: capybara-webkit
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - "~>"
116
- - !ruby/object:Gem::Version
117
- version: '1.8'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - "~>"
123
- - !ruby/object:Gem::Version
124
- version: '1.8'
125
55
  description: |
126
56
  Suspenders is a base Rails project that you can upgrade. It is used by
127
57
  thoughtbot to get a jump start on a working app. Use Suspenders if you're in a
@@ -204,7 +134,6 @@ files:
204
134
  - templates/shoulda_matchers_config_rspec.rb
205
135
  - templates/smtp.rb
206
136
  - templates/spec_helper.rb
207
- - templates/staging.rb
208
137
  - templates/suspenders_gitignore
209
138
  - templates/suspenders_layout.html.erb.erb
210
139
  homepage: http://github.com/thoughtbot/suspenders
@@ -228,7 +157,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
157
  version: '0'
229
158
  requirements: []
230
159
  rubyforge_project:
231
- rubygems_version: 2.5.1
160
+ rubygems_version: 2.6.2
232
161
  signing_key:
233
162
  specification_version: 4
234
163
  summary: Generate a Rails app using thoughtbot's best practices.
@@ -1,5 +0,0 @@
1
- require_relative "production"
2
-
3
- Mail.register_interceptor(
4
- RecipientInterceptor.new(ENV.fetch("EMAIL_RECIPIENTS"))
5
- )