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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e515a2ae4181d07d0c7d6f8a70b1a7a7b12ce861
4
- data.tar.gz: 4b194d1cf51111a88bc5cc5554a2a621dc02639f
3
+ metadata.gz: 474e77da8a3ca0f407d776e0aae8f56c85d4e03d
4
+ data.tar.gz: d5f260393643afb2a1adbe95a0d976c3545ae8b3
5
5
  SHA512:
6
- metadata.gz: 96603f5bfc50773d45f19b01a098dfaab7e23d984bbf51a0371c735e1f2bf5bb7cb50360fed0f649c7177a33c9ad26a07f2c264c5d709d449aca8b9fc46ca759
7
- data.tar.gz: bba6c405841e065de805c923ec72fcfc5a5de1acb3b8ea62a3e5b60392023aff104577f19b660175de0ba5b5ee8eb7dbe69da698f4ee68d6679c4a659f0e44cc
6
+ metadata.gz: d0a43ee683a85f1b524970babc13881348e7c4d81fa4200d490ba98e93a1d737709870eb43029561cc3959a249a59ceca7b91e561744ed89e8504816b9b9c864
7
+ data.tar.gz: 7986f28fdda7d51f2260372e93e67f4a94ad8c57b1189f49eb998bfde29838fa9f6593253f61aa7bf5e93823bd62d3860039b0b5996fb275f6fce5b2b53b46bc
@@ -9,3 +9,4 @@ install:
9
9
  - bundle install
10
10
  notifications:
11
11
  email: false
12
+ sudo: false
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- welaika-suspenders (2.4.0)
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.2)
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 'development', "localhost:#{port}"
258
- action_mailer_host 'test', 'www.example.com'
259
- action_mailer_host 'staging', "staging.#{app_name}.com"
260
- action_mailer_host 'production', "#{app_name}.com"
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 --region eu", "production"
333
- run_heroku "create #{app_name}-staging --region eu", "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, :type => :string, :aliases => '-d', :default => 'postgresql',
7
- :desc => "Preconfigure for selected database (options: #{DATABASES.join('/')})"
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, :type => :boolean, :aliases => '-H', :default => false,
10
- :desc => 'Create staging and production Heroku apps'
9
+ class_option :heroku, type: :boolean, aliases: "-H", default: false,
10
+ desc: "Create staging and production Heroku apps"
11
11
 
12
- class_option :github, :type => :string, :aliases => '-G', :default => nil,
13
- :desc => 'Create Github repository and add remote origin pointed to repo'
12
+ class_option :heroku_flags, type: :string, default: "--region eu",
13
+ desc: "Set extra Heroku flags"
14
14
 
15
- class_option :skip_test_unit, :type => :boolean, :aliases => '-T', :default => true,
16
- :desc => 'Skip Test::Unit files'
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 'Creating Heroku apps'
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
@@ -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.4.0"
4
+ VERSION = "2.5.0"
5
5
  end
@@ -1,13 +1,13 @@
1
1
  require "spec_helper"
2
2
 
3
3
  feature "Heroku" do
4
- scenario "Suspend a project with --heroku=true" do
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
@@ -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
- expected_line = "create #{app_name} --region eu --remote #{remote_name}\n"
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
@@ -43,7 +43,7 @@ group :development, :test do
43
43
  gem "pry-bloodline"
44
44
  gem "pry-byebug"
45
45
  gem "pry-rails"
46
- gem "rspec-rails", "~> 3.0.0"
46
+ gem "rspec-rails", "~> 3.1.0"
47
47
  end
48
48
 
49
49
  group :test do
@@ -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: "this-app.com"
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",
@@ -19,3 +19,4 @@ rvm:
19
19
  - <%= Suspenders::RUBY_VERSION %>
20
20
  addons:
21
21
  postgresql: "9.3"
22
+ sudo: false
@@ -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 |server, worker|
7
+ before_fork do |_server, _worker|
8
8
  Signal.trap "TERM" do
9
- puts "Unicorn master intercepting TERM and sending myself QUIT instead"
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 |server, worker|
18
+ after_fork do |_server, _worker|
19
19
  Signal.trap "TERM" do
20
- puts "Unicorn worker intercepting TERM and doing nothing. Wait for master to send QUIT"
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.0
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-05 00:00:00.000000000 Z
12
+ date: 2015-01-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bitters