suspenders 1.21.0 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/Gemfile.lock +2 -2
- data/NEWS.md +10 -0
- data/README.md +10 -0
- data/lib/suspenders/app_builder.rb +7 -7
- data/lib/suspenders/generators/app_generator.rb +13 -10
- data/lib/suspenders/version.rb +1 -1
- data/spec/features/heroku_spec.rb +8 -1
- data/spec/support/fake_heroku.rb +7 -2
- data/templates/Gemfile.erb +1 -1
- data/templates/smtp.rb +1 -1
- data/templates/travis.yml.erb +1 -0
- data/templates/unicorn.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e08b8a40281d4be707f011d5df7476f0a2d29062
|
|
4
|
+
data.tar.gz: 4efce742445971ad34c0be3623b057696504a213
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b794148c43e189cbecaf7d10dff74e448477c4a2c02838b17eae0ef81f5726b28f3416d0efc02505d0d33cd228b75f91cd8fadde0b8943ca101d59e4191daef9
|
|
7
|
+
data.tar.gz: 9733402b9cac2f4ddf7bbfc6a66f5fb9f79b14141d5c7fd39d0c69761695d4c9f473153760fa26dd9e591fddcb4669dbfd862eacc81afa60fad0bbb95e8a917c
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
suspenders (1.
|
|
4
|
+
suspenders (1.22.0)
|
|
5
5
|
bitters (~> 0.10.0)
|
|
6
6
|
bundler (~> 1.3)
|
|
7
7
|
rails (= 4.2.0)
|
|
@@ -53,7 +53,7 @@ GEM
|
|
|
53
53
|
bourbon (>= 3.2)
|
|
54
54
|
sass (>= 3.2)
|
|
55
55
|
thor
|
|
56
|
-
bourbon (4.0
|
|
56
|
+
bourbon (4.1.0)
|
|
57
57
|
sass (~> 3.3)
|
|
58
58
|
thor
|
|
59
59
|
builder (3.2.2)
|
data/NEWS.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
1.22.0 (January 11, 2015)
|
|
2
|
+
|
|
3
|
+
* Allow additional
|
|
4
|
+
[Heroku flags](https://github.com/thoughtbot/suspenders#heroku)
|
|
5
|
+
such as `--addons` and `--region`.
|
|
6
|
+
* Use RSpec 3.1.0.
|
|
7
|
+
* Use Travis' new Docker container infrastructure
|
|
8
|
+
for builds that start sooner and run faster.
|
|
9
|
+
* Improve SMTP and ActionMailer default settings.
|
|
10
|
+
|
|
1
11
|
1.21.0 (January 4, 2015)
|
|
2
12
|
|
|
3
13
|
* Use Ruby 2.2.0.
|
data/README.md
CHANGED
|
@@ -125,6 +125,16 @@ This:
|
|
|
125
125
|
[logging-gem]: https://github.com/heroku/rails_stdout_logging
|
|
126
126
|
[heroku-logging]: https://devcenter.heroku.com/articles/logging#writing-to-your-log
|
|
127
127
|
|
|
128
|
+
You can optionally specify alternate Heroku flags:
|
|
129
|
+
|
|
130
|
+
suspenders app \
|
|
131
|
+
--heroku true \
|
|
132
|
+
--heroku-flags "--region eu --addons newrelic,pgbackups,sendgrid,ssl"
|
|
133
|
+
|
|
134
|
+
See all possible Heroku flags:
|
|
135
|
+
|
|
136
|
+
heroku help create
|
|
137
|
+
|
|
128
138
|
## Git
|
|
129
139
|
|
|
130
140
|
This will initialize a new git repository for your Rails app. You can
|
|
@@ -233,10 +233,10 @@ end
|
|
|
233
233
|
end
|
|
234
234
|
|
|
235
235
|
def configure_action_mailer
|
|
236
|
-
action_mailer_host
|
|
237
|
-
action_mailer_host
|
|
238
|
-
action_mailer_host
|
|
239
|
-
action_mailer_host
|
|
236
|
+
action_mailer_host "development", "localhost:#{port}"
|
|
237
|
+
action_mailer_host "test", "www.example.com"
|
|
238
|
+
action_mailer_host "staging", %{ENV.fetch("HOST")}
|
|
239
|
+
action_mailer_host "production", %{ENV.fetch("HOST")}
|
|
240
240
|
end
|
|
241
241
|
|
|
242
242
|
def fix_i18n_deprecation_warning
|
|
@@ -295,9 +295,9 @@ end
|
|
|
295
295
|
run 'git init'
|
|
296
296
|
end
|
|
297
297
|
|
|
298
|
-
def create_heroku_apps
|
|
299
|
-
run_heroku "create #{app_name}-production", "production"
|
|
300
|
-
run_heroku "create #{app_name}-staging", "staging"
|
|
298
|
+
def create_heroku_apps(flags)
|
|
299
|
+
run_heroku "create #{app_name}-production #{flags}", "production"
|
|
300
|
+
run_heroku "create #{app_name}-staging #{flags}", "staging"
|
|
301
301
|
run_heroku "config:add RACK_ENV=staging RAILS_ENV=staging", "staging"
|
|
302
302
|
end
|
|
303
303
|
|
|
@@ -3,17 +3,20 @@ require 'rails/generators/rails/app/app_generator'
|
|
|
3
3
|
|
|
4
4
|
module Suspenders
|
|
5
5
|
class AppGenerator < Rails::Generators::AppGenerator
|
|
6
|
-
class_option :database, :
|
|
7
|
-
:
|
|
6
|
+
class_option :database, type: :string, aliases: "-d", default: "postgresql",
|
|
7
|
+
desc: "Configure for selected database (options: #{DATABASES.join("/")})"
|
|
8
8
|
|
|
9
|
-
class_option :heroku, :
|
|
10
|
-
:
|
|
9
|
+
class_option :heroku, type: :boolean, aliases: "-H", default: false,
|
|
10
|
+
desc: "Create staging and production Heroku apps"
|
|
11
11
|
|
|
12
|
-
class_option :
|
|
13
|
-
:
|
|
12
|
+
class_option :heroku_flags, type: :string, default: "",
|
|
13
|
+
desc: "Set extra Heroku flags"
|
|
14
14
|
|
|
15
|
-
class_option :
|
|
16
|
-
:
|
|
15
|
+
class_option :github, type: :string, aliases: "-G", default: nil,
|
|
16
|
+
desc: "Create Github repository and add remote origin pointed to repo"
|
|
17
|
+
|
|
18
|
+
class_option :skip_test_unit, type: :boolean, aliases: "-T", default: true,
|
|
19
|
+
desc: "Skip Test::Unit files"
|
|
17
20
|
|
|
18
21
|
def finish_template
|
|
19
22
|
invoke :suspenders_customization
|
|
@@ -160,8 +163,8 @@ module Suspenders
|
|
|
160
163
|
|
|
161
164
|
def create_heroku_apps
|
|
162
165
|
if options[:heroku]
|
|
163
|
-
say
|
|
164
|
-
build :create_heroku_apps
|
|
166
|
+
say "Creating Heroku apps"
|
|
167
|
+
build :create_heroku_apps, options[:heroku_flags]
|
|
165
168
|
build :set_heroku_remotes
|
|
166
169
|
build :set_heroku_rails_secrets
|
|
167
170
|
build :set_memory_management_variable
|
data/lib/suspenders/version.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
require "spec_helper"
|
|
2
2
|
|
|
3
3
|
feature "Heroku" do
|
|
4
|
-
scenario "Suspend a project
|
|
4
|
+
scenario "Suspend a project for Heroku" do
|
|
5
5
|
run_suspenders("--heroku=true")
|
|
6
6
|
|
|
7
7
|
expect(FakeHeroku).
|
|
@@ -26,4 +26,11 @@ feature "Heroku" do
|
|
|
26
26
|
expect(readme).to include("./bin/deploy staging")
|
|
27
27
|
expect(readme).to include("./bin/deploy production")
|
|
28
28
|
end
|
|
29
|
+
|
|
30
|
+
scenario "Suspend a project with extra Heroku flags" do
|
|
31
|
+
run_suspenders(%{--heroku=true --heroku-flags="--region eu"})
|
|
32
|
+
|
|
33
|
+
expect(FakeHeroku).to have_created_app_for("staging", "--region eu")
|
|
34
|
+
expect(FakeHeroku).to have_created_app_for("production", "--region eu")
|
|
35
|
+
end
|
|
29
36
|
end
|
data/spec/support/fake_heroku.rb
CHANGED
|
@@ -23,9 +23,14 @@ class FakeHeroku
|
|
|
23
23
|
end
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
def self.has_created_app_for?(remote_name)
|
|
26
|
+
def self.has_created_app_for?(remote_name, flags = nil)
|
|
27
27
|
app_name = "#{SuspendersTestHelpers::APP_NAME}-#{remote_name}"
|
|
28
|
-
|
|
28
|
+
|
|
29
|
+
expected_line = if flags
|
|
30
|
+
"create #{app_name} #{flags} --remote #{remote_name}\n"
|
|
31
|
+
else
|
|
32
|
+
"create #{app_name} --remote #{remote_name}\n"
|
|
33
|
+
end
|
|
29
34
|
|
|
30
35
|
File.foreach(RECORDER).any? { |line| line == expected_line }
|
|
31
36
|
end
|
data/templates/Gemfile.erb
CHANGED
data/templates/smtp.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
SMTP_SETTINGS = {
|
|
2
2
|
address: ENV.fetch("SMTP_ADDRESS"), # example: "smtp.sendgrid.net"
|
|
3
3
|
authentication: :plain,
|
|
4
|
-
domain: ENV.fetch("SMTP_DOMAIN"), # example: "
|
|
4
|
+
domain: ENV.fetch("SMTP_DOMAIN"), # example: "heroku.com"
|
|
5
5
|
enable_starttls_auto: true,
|
|
6
6
|
password: ENV.fetch("SMTP_PASSWORD"),
|
|
7
7
|
port: "587",
|
data/templates/travis.yml.erb
CHANGED
data/templates/unicorn.rb
CHANGED
|
@@ -4,9 +4,9 @@ worker_processes (ENV["UNICORN_WORKERS"] || 3).to_i
|
|
|
4
4
|
timeout (ENV["UNICORN_TIMEOUT"] || 15).to_i
|
|
5
5
|
preload_app true
|
|
6
6
|
|
|
7
|
-
before_fork do |
|
|
7
|
+
before_fork do |_server, _worker|
|
|
8
8
|
Signal.trap "TERM" do
|
|
9
|
-
puts "Unicorn master intercepting TERM
|
|
9
|
+
puts "Unicorn master intercepting TERM, sending myself QUIT instead"
|
|
10
10
|
Process.kill "QUIT", Process.pid
|
|
11
11
|
end
|
|
12
12
|
|
|
@@ -15,9 +15,9 @@ before_fork do |server, worker|
|
|
|
15
15
|
end
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
after_fork do |
|
|
18
|
+
after_fork do |_server, _worker|
|
|
19
19
|
Signal.trap "TERM" do
|
|
20
|
-
puts "Unicorn worker intercepting TERM
|
|
20
|
+
puts "Unicorn worker intercepting TERM, waiting for master to send QUIT"
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
if defined? ActiveRecord::Base
|
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.
|
|
4
|
+
version: 1.22.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoughtbot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-01-
|
|
11
|
+
date: 2015-01-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bitters
|