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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d91d5e12afab40037b308b168125a44e3d8f447e
4
- data.tar.gz: 3b61d62c10c86a8c7d6287de1f38f78962bcddf8
3
+ metadata.gz: e08b8a40281d4be707f011d5df7476f0a2d29062
4
+ data.tar.gz: 4efce742445971ad34c0be3623b057696504a213
5
5
  SHA512:
6
- metadata.gz: d12faf4cf825d7691647cb4b744c41624f698e11ec07701112eed749e16f9c9fbdcb81b812141627585032de3a7ab6c42ebdde1834cf232b0a5980ed60e52792
7
- data.tar.gz: 9fa487b16c3ea508e44bb4a3071ea19566cc5755c15268ffb9d60fd63a8da23df3509f1d4a0fad369d67bf12acd477654e774c048fec284898c6ba0acabaa7dc
6
+ metadata.gz: b794148c43e189cbecaf7d10dff74e448477c4a2c02838b17eae0ef81f5726b28f3416d0efc02505d0d33cd228b75f91cd8fadde0b8943ca101d59e4191daef9
7
+ data.tar.gz: 9733402b9cac2f4ddf7bbfc6a66f5fb9f79b14141d5c7fd39d0c69761695d4c9f473153760fa26dd9e591fddcb4669dbfd862eacc81afa60fad0bbb95e8a917c
data/.travis.yml CHANGED
@@ -9,3 +9,4 @@ install:
9
9
  - bundle install
10
10
  notifications:
11
11
  email: false
12
+ sudo: false
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- suspenders (1.21.0)
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.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
@@ -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 'development', "localhost:#{port}"
237
- action_mailer_host 'test', 'www.example.com'
238
- action_mailer_host 'staging', "staging.#{app_name}.com"
239
- action_mailer_host 'production', "#{app_name}.com"
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, :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: "",
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
@@ -160,8 +163,8 @@ module Suspenders
160
163
 
161
164
  def create_heroku_apps
162
165
  if options[:heroku]
163
- say 'Creating Heroku apps'
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
@@ -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.21.0"
4
+ VERSION = "1.22.0"
5
5
  end
@@ -1,7 +1,7 @@
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).
@@ -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} --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
@@ -38,7 +38,7 @@ group :development, :test do
38
38
  gem "dotenv-rails"
39
39
  gem "factory_girl_rails"
40
40
  gem "pry-rails"
41
- gem "rspec-rails", "~> 3.0.0"
41
+ gem "rspec-rails", "~> 3.1.0"
42
42
  end
43
43
 
44
44
  group :test do
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: "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
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 |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,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: suspenders
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.21.0
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-04 00:00:00.000000000 Z
11
+ date: 2015-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bitters