suspenders 1.49.0 → 1.50.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/.ruby-version +1 -1
- data/.travis.yml +1 -1
- data/NEWS.md +10 -0
- data/README.md +1 -3
- data/lib/suspenders.rb +2 -0
- data/lib/suspenders/adapters/heroku.rb +0 -9
- data/lib/suspenders/app_builder.rb +0 -6
- data/lib/suspenders/generators/app_generator.rb +4 -3
- data/lib/suspenders/generators/json_generator.rb +10 -0
- data/lib/suspenders/generators/staging/pull_requests_generator.rb +47 -0
- data/lib/suspenders/version.rb +1 -1
- data/spec/features/json_spec.rb +15 -0
- data/spec/features/new_project_spec.rb +3 -2
- data/spec/features/staging/pull_requests_spec.rb +22 -0
- data/templates/Gemfile.erb +1 -1
- data/templates/_javascript.html.erb +0 -7
- data/templates/factory_bot_rspec.rb +2 -0
- metadata +9 -21
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8da6287b8db00f55d3055a907f8c8e38b449ef15d3f98c1e898770594a8b9134
|
|
4
|
+
data.tar.gz: 54e3a53194b0b996d5971681d44269122bbf181c8d34f1638e2255592dcbf497
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 407d7b2087c72518a79276894c1b7c4c7d8ebd9d0d6d5cbbb2f5b068935d1543a976f86bba1314bcf698e4cf1cb54ac279a6c21f0dd5ee485c0f8357f82133f5
|
|
7
|
+
data.tar.gz: b1bdb1c214097d96bb793614c822ddc20e090fe4cffc11b71841534c20d0108d03bb9fafaebc905b5b5923a26a5e364a2b6de21c03d41f9e2e523f4be6a4eeab
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.5.
|
|
1
|
+
2.5.3
|
data/.travis.yml
CHANGED
data/NEWS.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
1.50.0 (December 28, 2018)
|
|
2
|
+
|
|
3
|
+
* Removed: jquery-rails.
|
|
4
|
+
* Changed: default FactoryBot to `use_parent_strategy = true`.
|
|
5
|
+
* Upgraded: Ruby 2.5.3.
|
|
6
|
+
* Fixed: set `ASSET_HOST` and `APPLICATION_HOST` at top of `production.rb`.
|
|
7
|
+
* Fixed: `tzinfo-data` gem for Windows.
|
|
8
|
+
* New generator: `suspenders:json` for JSON parsing.
|
|
9
|
+
* New generator: `suspenders:staging:pull_requests` for Heroku app per PR.
|
|
10
|
+
|
|
1
11
|
1.49.0 (October 19, 2018)
|
|
2
12
|
|
|
3
13
|
* Removed: NOODP robots meta tags
|
data/README.md
CHANGED
|
@@ -36,13 +36,11 @@ It includes application gems like:
|
|
|
36
36
|
* [Bitters](https://github.com/thoughtbot/bitters) for scaffold application styles
|
|
37
37
|
* [Delayed Job](https://github.com/collectiveidea/delayed_job) for background
|
|
38
38
|
processing
|
|
39
|
-
* [Flutie](https://github.com/thoughtbot/flutie) for `page_title` and `body_class` view
|
|
40
|
-
helpers
|
|
41
39
|
* [High Voltage](https://github.com/thoughtbot/high_voltage) for static pages
|
|
42
40
|
* [Honeybadger](https://honeybadger.io) for exception notification
|
|
43
|
-
* [jQuery Rails](https://github.com/rails/jquery-rails) for jQuery
|
|
44
41
|
* [Neat](https://github.com/thoughtbot/neat) for semantic grids
|
|
45
42
|
* [Normalize](https://necolas.github.io/normalize.css/) for resetting browser styles
|
|
43
|
+
* [Oj](http://www.ohler.com/oj/)
|
|
46
44
|
* [Postgres](https://github.com/ged/ruby-pg) for access to the Postgres database
|
|
47
45
|
* [Rack Canonical Host](https://github.com/tylerhunt/rack-canonical-host) to
|
|
48
46
|
ensure all requests are served from the same domain
|
data/lib/suspenders.rb
CHANGED
|
@@ -11,10 +11,12 @@ require "suspenders/generators/jobs_generator"
|
|
|
11
11
|
require "suspenders/generators/analytics_generator"
|
|
12
12
|
require "suspenders/generators/views_generator"
|
|
13
13
|
require "suspenders/generators/js_driver_generator"
|
|
14
|
+
require "suspenders/generators/json_generator"
|
|
14
15
|
require "suspenders/generators/testing_generator"
|
|
15
16
|
require "suspenders/generators/production/force_tls_generator"
|
|
16
17
|
require "suspenders/generators/production/email_generator"
|
|
17
18
|
require "suspenders/generators/production/timeout_generator"
|
|
19
|
+
require "suspenders/generators/staging/pull_requests_generator"
|
|
18
20
|
require "suspenders/actions"
|
|
19
21
|
require "suspenders/adapters/heroku"
|
|
20
22
|
require "suspenders/app_builder"
|
|
@@ -55,15 +55,6 @@ module Suspenders
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def create_review_apps_setup_script
|
|
59
|
-
app_builder.template(
|
|
60
|
-
"bin_setup_review_app.erb",
|
|
61
|
-
"bin/setup_review_app",
|
|
62
|
-
force: true,
|
|
63
|
-
)
|
|
64
|
-
app_builder.run "chmod a+x bin/setup_review_app"
|
|
65
|
-
end
|
|
66
|
-
|
|
67
58
|
def create_heroku_application_manifest_file
|
|
68
59
|
app_builder.template "app.json.erb", "app.json"
|
|
69
60
|
end
|
|
@@ -10,7 +10,6 @@ module Suspenders
|
|
|
10
10
|
:create_heroku_application_manifest_file,
|
|
11
11
|
:create_heroku_pipeline,
|
|
12
12
|
:create_production_heroku_app,
|
|
13
|
-
:create_review_apps_setup_script,
|
|
14
13
|
:create_staging_heroku_app,
|
|
15
14
|
:set_heroku_application_host,
|
|
16
15
|
:set_heroku_backup_schedule,
|
|
@@ -100,11 +99,6 @@ module Suspenders
|
|
|
100
99
|
|
|
101
100
|
def enable_rack_canonical_host
|
|
102
101
|
config = <<-RUBY
|
|
103
|
-
|
|
104
|
-
if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
|
|
105
|
-
ENV["APPLICATION_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
|
|
106
|
-
end
|
|
107
|
-
|
|
108
102
|
config.middleware.use Rack::CanonicalHost, ENV.fetch("APPLICATION_HOST")
|
|
109
103
|
RUBY
|
|
110
104
|
|
|
@@ -57,7 +57,7 @@ module Suspenders
|
|
|
57
57
|
invoke :setup_default_directories
|
|
58
58
|
invoke :create_local_heroku_setup
|
|
59
59
|
invoke :create_heroku_apps
|
|
60
|
-
invoke :
|
|
60
|
+
invoke :generate_deployment_default
|
|
61
61
|
invoke :remove_config_comment_lines
|
|
62
62
|
invoke :remove_routes_comment_lines
|
|
63
63
|
invoke :outro
|
|
@@ -115,7 +115,6 @@ module Suspenders
|
|
|
115
115
|
|
|
116
116
|
def create_local_heroku_setup
|
|
117
117
|
say "Creating local Heroku setup"
|
|
118
|
-
build :create_review_apps_setup_script
|
|
119
118
|
build :create_deploy_script
|
|
120
119
|
build :create_heroku_application_manifest_file
|
|
121
120
|
end
|
|
@@ -179,6 +178,7 @@ module Suspenders
|
|
|
179
178
|
|
|
180
179
|
def generate_default
|
|
181
180
|
run("spring stop")
|
|
181
|
+
generate("suspenders:json")
|
|
182
182
|
generate("suspenders:static")
|
|
183
183
|
generate("suspenders:stylesheet_base")
|
|
184
184
|
generate("suspenders:testing")
|
|
@@ -195,7 +195,8 @@ module Suspenders
|
|
|
195
195
|
generate("suspenders:views")
|
|
196
196
|
end
|
|
197
197
|
|
|
198
|
-
def
|
|
198
|
+
def generate_deployment_default
|
|
199
|
+
generate("suspenders:staging:pull_requests")
|
|
199
200
|
generate("suspenders:production:force_tls")
|
|
200
201
|
generate("suspenders:production:email")
|
|
201
202
|
generate("suspenders:production:timeout")
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
require "rails/generators"
|
|
2
|
+
require_relative "../../actions"
|
|
3
|
+
|
|
4
|
+
module Suspenders
|
|
5
|
+
module Staging
|
|
6
|
+
class PullRequestsGenerator < Rails::Generators::Base
|
|
7
|
+
include Suspenders::Actions
|
|
8
|
+
|
|
9
|
+
source_root File.expand_path(
|
|
10
|
+
File.join("..", "..", "..", "..", "templates"),
|
|
11
|
+
File.dirname(__FILE__),
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
def configure_heroku_staging_pr_pipeline_host
|
|
15
|
+
config = <<-RUBY
|
|
16
|
+
|
|
17
|
+
if ENV.fetch("HEROKU_APP_NAME", "").include?("staging-pr-")
|
|
18
|
+
ENV["APPLICATION_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
|
|
19
|
+
ENV["ASSET_HOST"] = ENV["HEROKU_APP_NAME"] + ".herokuapp.com"
|
|
20
|
+
end
|
|
21
|
+
RUBY
|
|
22
|
+
|
|
23
|
+
inject_into_file(
|
|
24
|
+
"config/environments/production.rb",
|
|
25
|
+
config,
|
|
26
|
+
after: "Rails.application.configure do\n",
|
|
27
|
+
)
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def create_review_apps_setup_script
|
|
31
|
+
template(
|
|
32
|
+
"bin_setup_review_app.erb",
|
|
33
|
+
"bin/setup_review_app",
|
|
34
|
+
force: true,
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
run "chmod a+x bin/setup_review_app"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
private
|
|
41
|
+
|
|
42
|
+
def app_name
|
|
43
|
+
Rails.application.class.parent_name.demodulize.underscore.dasherize
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
47
|
+
end
|
data/lib/suspenders/version.rb
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
RSpec.describe "suspenders:json" do
|
|
4
|
+
it "generates the Gemfile for JSON parsing" do
|
|
5
|
+
with_app { generate("suspenders:json") }
|
|
6
|
+
|
|
7
|
+
expect("Gemfile").to match_contents(%r{gem .oj.})
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
it "cleans up the Gemfile from JSON parsing" do
|
|
11
|
+
with_app { destroy("suspenders:json") }
|
|
12
|
+
|
|
13
|
+
expect("Gemfile").not_to match_contents(%r{gem .oj.})
|
|
14
|
+
end
|
|
15
|
+
end
|
|
@@ -242,8 +242,9 @@ RSpec.describe "Suspend a new project with default configuration" do
|
|
|
242
242
|
]
|
|
243
243
|
|
|
244
244
|
config_files.each do |file|
|
|
245
|
-
expect(file).not_to match(
|
|
246
|
-
expect(file).not_to
|
|
245
|
+
expect(file).not_to match(%r{.*#.*})
|
|
246
|
+
expect(file).not_to eq(file.strip)
|
|
247
|
+
expect(file).not_to match(%r{^$\n\n})
|
|
247
248
|
end
|
|
248
249
|
end
|
|
249
250
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
require "spec_helper"
|
|
2
|
+
|
|
3
|
+
RSpec.describe "suspenders:staging:pull_requests" do
|
|
4
|
+
it "generates the configuration for Heroku pipeline review apps" do
|
|
5
|
+
with_app { generate("suspenders:staging:pull_requests") }
|
|
6
|
+
|
|
7
|
+
expect("config/environments/production.rb").to \
|
|
8
|
+
match_contents(%r{HEROKU_APP_NAME})
|
|
9
|
+
|
|
10
|
+
expect("bin/setup_review_app").to \
|
|
11
|
+
match_contents(%r{APP_NAME=dummy-app-staging-pr-\$1})
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
it "destroys the configuration for Heroku pipeline review apps" do
|
|
15
|
+
with_app { destroy("suspenders:staging:pull_requests") }
|
|
16
|
+
|
|
17
|
+
expect("config/environments/production.rb").not_to \
|
|
18
|
+
match_contents(%r{APP_NAME=dummy-app-staging-pr-\$1})
|
|
19
|
+
|
|
20
|
+
expect("bin/setup_review_app").not_to exist_as_a_file
|
|
21
|
+
end
|
|
22
|
+
end
|
data/templates/Gemfile.erb
CHANGED
|
@@ -9,7 +9,6 @@ ruby "<%= Suspenders::RUBY_VERSION %>"
|
|
|
9
9
|
|
|
10
10
|
gem "autoprefixer-rails"
|
|
11
11
|
gem "honeybadger"
|
|
12
|
-
gem "jquery-rails"
|
|
13
12
|
gem "pg"
|
|
14
13
|
gem "puma"
|
|
15
14
|
gem "rack-canonical-host"
|
|
@@ -19,6 +18,7 @@ gem "sass-rails", "~> 5.0"
|
|
|
19
18
|
gem "skylight"
|
|
20
19
|
gem "sprockets", ">= 3.0.0"
|
|
21
20
|
gem "title"
|
|
21
|
+
gem "tzinfo-data", platforms: [:mingw, :x64_mingw, :mswin, :jruby]
|
|
22
22
|
gem "uglifier"
|
|
23
23
|
gem "bootsnap", require: false
|
|
24
24
|
<% if options[:webpack] %>
|
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.50.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- thoughtbot
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-
|
|
11
|
+
date: 2018-12-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bitters
|
|
@@ -91,10 +91,12 @@ files:
|
|
|
91
91
|
- lib/suspenders/generators/forms_generator.rb
|
|
92
92
|
- lib/suspenders/generators/jobs_generator.rb
|
|
93
93
|
- lib/suspenders/generators/js_driver_generator.rb
|
|
94
|
+
- lib/suspenders/generators/json_generator.rb
|
|
94
95
|
- lib/suspenders/generators/lint_generator.rb
|
|
95
96
|
- lib/suspenders/generators/production/email_generator.rb
|
|
96
97
|
- lib/suspenders/generators/production/force_tls_generator.rb
|
|
97
98
|
- lib/suspenders/generators/production/timeout_generator.rb
|
|
99
|
+
- lib/suspenders/generators/staging/pull_requests_generator.rb
|
|
98
100
|
- lib/suspenders/generators/static_generator.rb
|
|
99
101
|
- lib/suspenders/generators/stylesheet_base_generator.rb
|
|
100
102
|
- lib/suspenders/generators/testing_generator.rb
|
|
@@ -107,8 +109,10 @@ files:
|
|
|
107
109
|
- spec/features/cli_help_spec.rb
|
|
108
110
|
- spec/features/github_spec.rb
|
|
109
111
|
- spec/features/heroku_spec.rb
|
|
112
|
+
- spec/features/json_spec.rb
|
|
110
113
|
- spec/features/new_project_spec.rb
|
|
111
114
|
- spec/features/production/email_spec.rb
|
|
115
|
+
- spec/features/staging/pull_requests_spec.rb
|
|
112
116
|
- spec/spec_helper.rb
|
|
113
117
|
- spec/support/contain_json_matcher.rb
|
|
114
118
|
- spec/support/exist_as_a_file_matcher.rb
|
|
@@ -170,7 +174,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
170
174
|
requirements:
|
|
171
175
|
- - ">="
|
|
172
176
|
- !ruby/object:Gem::Version
|
|
173
|
-
version: 2.5.
|
|
177
|
+
version: 2.5.3
|
|
174
178
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
175
179
|
requirements:
|
|
176
180
|
- - ">="
|
|
@@ -178,24 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
178
182
|
version: 2.7.4
|
|
179
183
|
requirements: []
|
|
180
184
|
rubyforge_project:
|
|
181
|
-
rubygems_version: 2.7.
|
|
185
|
+
rubygems_version: 2.7.6
|
|
182
186
|
signing_key:
|
|
183
187
|
specification_version: 4
|
|
184
188
|
summary: Generate a Rails app using thoughtbot's best practices.
|
|
185
|
-
test_files:
|
|
186
|
-
- spec/adapters/heroku_spec.rb
|
|
187
|
-
- spec/fakes/bin/heroku
|
|
188
|
-
- spec/fakes/bin/hub
|
|
189
|
-
- spec/features/api_spec.rb
|
|
190
|
-
- spec/features/cli_help_spec.rb
|
|
191
|
-
- spec/features/github_spec.rb
|
|
192
|
-
- spec/features/heroku_spec.rb
|
|
193
|
-
- spec/features/new_project_spec.rb
|
|
194
|
-
- spec/features/production/email_spec.rb
|
|
195
|
-
- spec/spec_helper.rb
|
|
196
|
-
- spec/support/contain_json_matcher.rb
|
|
197
|
-
- spec/support/exist_as_a_file_matcher.rb
|
|
198
|
-
- spec/support/fake_github.rb
|
|
199
|
-
- spec/support/fake_heroku.rb
|
|
200
|
-
- spec/support/match_contents_matcher.rb
|
|
201
|
-
- spec/support/suspenders.rb
|
|
189
|
+
test_files: []
|