welaika-suspenders 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- 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 +10 -3
- 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: 474e77da8a3ca0f407d776e0aae8f56c85d4e03d
|
4
|
+
data.tar.gz: d5f260393643afb2a1adbe95a0d976c3545ae8b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d0a43ee683a85f1b524970babc13881348e7c4d81fa4200d490ba98e93a1d737709870eb43029561cc3959a249a59ceca7b91e561744ed89e8504816b9b9c864
|
7
|
+
data.tar.gz: 7986f28fdda7d51f2260372e93e67f4a94ad8c57b1189f49eb998bfde29838fa9f6593253f61aa7bf5e93823bd62d3860039b0b5996fb275f6fce5b2b53b46bc
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
welaika-suspenders (2.
|
4
|
+
welaika-suspenders (2.5.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
@@ -18,6 +18,16 @@ Then run:
|
|
18
18
|
|
19
19
|
welaika-suspenders projectname
|
20
20
|
|
21
|
+
You can optionally specify alternate Heroku flags:
|
22
|
+
|
23
|
+
welaika-suspenders projectname \
|
24
|
+
--heroku true \
|
25
|
+
--heroku-flags "--region eu --addons newrelic,pgbackups,sendgrid,ssl"
|
26
|
+
|
27
|
+
See all possible Heroku flags:
|
28
|
+
|
29
|
+
heroku help create
|
30
|
+
|
21
31
|
This will create a rails app in `projectname`. This script creates a
|
22
32
|
new git repository. It is not meant to be used against an existing repo.
|
23
33
|
|
@@ -254,10 +254,10 @@ end
|
|
254
254
|
end
|
255
255
|
|
256
256
|
def configure_action_mailer
|
257
|
-
action_mailer_host
|
258
|
-
action_mailer_host
|
259
|
-
action_mailer_host
|
260
|
-
action_mailer_host
|
257
|
+
action_mailer_host "development", "localhost:#{port}"
|
258
|
+
action_mailer_host "test", "www.example.com"
|
259
|
+
action_mailer_host "staging", %{ENV.fetch("HOST")}
|
260
|
+
action_mailer_host "production", %{ENV.fetch("HOST")}
|
261
261
|
end
|
262
262
|
|
263
263
|
def configure_available_locales
|
@@ -328,9 +328,9 @@ end
|
|
328
328
|
run 'git init'
|
329
329
|
end
|
330
330
|
|
331
|
-
def create_heroku_apps
|
332
|
-
run_heroku "create #{app_name}-production
|
333
|
-
run_heroku "create #{app_name}-staging
|
331
|
+
def create_heroku_apps(flags)
|
332
|
+
run_heroku "create #{app_name}-production #{flags}", "production"
|
333
|
+
run_heroku "create #{app_name}-staging #{flags}", "staging"
|
334
334
|
run_heroku "config:add RACK_ENV=staging RAILS_ENV=staging", "staging"
|
335
335
|
end
|
336
336
|
|
@@ -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: "--region eu",
|
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
|
@@ -157,8 +160,8 @@ module Suspenders
|
|
157
160
|
|
158
161
|
def create_heroku_apps
|
159
162
|
if options[:heroku]
|
160
|
-
say
|
161
|
-
build :create_heroku_apps
|
163
|
+
say "Creating Heroku apps"
|
164
|
+
build :create_heroku_apps, options[:heroku_flags]
|
162
165
|
build :set_heroku_remotes
|
163
166
|
build :set_heroku_rails_secrets
|
164
167
|
build :set_memory_management_variable
|
data/lib/suspenders/version.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
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).
|
8
8
|
to have_gem_included(project_path, "rails_stdout_logging")
|
9
|
-
expect(FakeHeroku).to have_created_app_for("staging")
|
10
|
-
expect(FakeHeroku).to have_created_app_for("production")
|
9
|
+
expect(FakeHeroku).to have_created_app_for("staging", "--region eu")
|
10
|
+
expect(FakeHeroku).to have_created_app_for("production", "--region eu")
|
11
11
|
expect(FakeHeroku).to have_configured_vars("staging", "SECRET_KEY_BASE")
|
12
12
|
expect(FakeHeroku).to have_configured_vars("production", "SECRET_KEY_BASE")
|
13
13
|
|
@@ -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,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: welaika-suspenders
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.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: 2015-01-
|
12
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bitters
|