suspenders 1.50.0 → 1.54.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +6 -4
- data/CONTRIBUTING.md +15 -15
- data/GOALS.md +65 -0
- data/NEWS.md +55 -0
- data/README.md +7 -4
- data/docs/heroku_deploy.md +19 -0
- data/lib/suspenders.rb +10 -0
- data/lib/suspenders/actions.rb +2 -2
- data/lib/suspenders/adapters/heroku.rb +14 -5
- data/lib/suspenders/app_builder.rb +3 -91
- data/lib/suspenders/generators/advisories_generator.rb +15 -0
- data/lib/suspenders/generators/analytics_generator.rb +2 -7
- data/lib/suspenders/generators/app_generator.rb +14 -41
- data/lib/suspenders/generators/base.rb +59 -0
- data/lib/suspenders/generators/ci_generator.rb +20 -14
- data/lib/suspenders/generators/db_optimizations_generator.rb +6 -18
- data/lib/suspenders/generators/factories_generator.rb +3 -8
- data/lib/suspenders/generators/forms_generator.rb +3 -3
- data/lib/suspenders/generators/inline_svg_generator.rb +14 -0
- data/lib/suspenders/generators/jobs_generator.rb +3 -13
- data/lib/suspenders/generators/js_driver_generator.rb +9 -11
- data/lib/suspenders/generators/json_generator.rb +3 -3
- data/lib/suspenders/generators/lint_generator.rb +2 -7
- data/lib/suspenders/generators/preloader_generator.rb +122 -0
- data/lib/suspenders/generators/production/compression_generator.rb +14 -0
- data/lib/suspenders/generators/production/deployment_generator.rb +16 -0
- data/lib/suspenders/generators/production/email_generator.rb +7 -18
- data/lib/suspenders/generators/production/force_tls_generator.rb +2 -5
- data/lib/suspenders/generators/production/manifest_generator.rb +25 -0
- data/lib/suspenders/generators/production/single_redirect.rb +15 -0
- data/lib/suspenders/generators/production/timeout_generator.rb +3 -2
- data/lib/suspenders/generators/profiler_generator.rb +35 -0
- data/lib/suspenders/generators/runner_generator.rb +48 -0
- data/lib/suspenders/generators/staging/pull_requests_generator.rb +4 -26
- data/lib/suspenders/generators/static_generator.rb +7 -3
- data/lib/suspenders/generators/stylelint_generator.rb +70 -0
- data/lib/suspenders/generators/stylesheet_base_generator.rb +8 -13
- data/lib/suspenders/generators/testing_generator.rb +6 -22
- data/lib/suspenders/generators/views_generator.rb +2 -7
- data/lib/suspenders/version.rb +2 -2
- data/spec/adapters/heroku_spec.rb +28 -2
- data/spec/expand_json_spec.rb +89 -0
- data/spec/features/advisories_spec.rb +24 -0
- data/spec/features/api_spec.rb +1 -1
- data/spec/features/ci_spec.rb +31 -0
- data/spec/features/db_optimizations_spec.rb +19 -0
- data/spec/features/heroku_spec.rb +7 -14
- data/spec/features/inline_svg_spec.rb +10 -0
- data/spec/features/json_spec.rb +1 -1
- data/spec/features/new_project_spec.rb +17 -35
- data/spec/features/preloader_spec.rb +25 -0
- data/spec/features/production/compression_spec.rb +23 -0
- data/spec/features/production/deployment_spec.rb +22 -0
- data/spec/features/production/email_spec.rb +1 -1
- data/spec/features/production/manifest_spec.rb +37 -0
- data/spec/features/production/single_redirect_spec.rb +25 -0
- data/spec/features/profiler_spec.rb +20 -0
- data/spec/features/runner_spec.rb +30 -0
- data/spec/features/staging/pull_requests_spec.rb +1 -1
- data/spec/features/static_spec.rb +17 -0
- data/spec/features/stylelint_spec.rb +60 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/be_executable_matcher.rb +7 -0
- data/spec/support/contain_json_matcher.rb +16 -10
- data/spec/support/generators.rb +5 -0
- data/spec/support/project_files.rb +25 -0
- data/spec/support/rails_template.rb +1 -0
- data/spec/support/suspenders.rb +18 -15
- data/suspenders.gemspec +1 -1
- data/templates/Gemfile.erb +5 -11
- data/templates/_javascript.html.erb +1 -1
- data/templates/application.scss +0 -1
- data/templates/bin_auto_migrate +5 -0
- data/templates/bin_deploy +0 -2
- data/templates/bin_setup +2 -2
- data/templates/bin_setup_review_app.erb +0 -1
- data/templates/capybara_silence_puma.rb +1 -0
- data/templates/chromedriver.rb +14 -4
- data/templates/descriptions/advisories.md +5 -0
- data/templates/descriptions/analytics.md +4 -0
- data/templates/descriptions/ci.md +4 -0
- data/templates/descriptions/compression.md +4 -0
- data/templates/descriptions/db_optimizations.md +2 -0
- data/templates/descriptions/deployment.md +5 -0
- data/templates/descriptions/email.md +9 -0
- data/templates/descriptions/factories.md +12 -0
- data/templates/descriptions/force_tls.md +1 -0
- data/templates/descriptions/forms.md +1 -0
- data/templates/descriptions/inline_svg.md +2 -0
- data/templates/descriptions/jobs.md +3 -0
- data/templates/descriptions/js_driver.md +4 -0
- data/templates/descriptions/json.md +1 -0
- data/templates/descriptions/lint.md +3 -0
- data/templates/descriptions/manifest.md +2 -0
- data/templates/descriptions/preloader.md +3 -0
- data/templates/descriptions/profiler.md +7 -0
- data/templates/descriptions/pull_requests.md +4 -0
- data/templates/descriptions/runner.md +10 -0
- data/templates/descriptions/single_redirect.md +1 -0
- data/templates/descriptions/static.md +5 -0
- data/templates/descriptions/stylelint.md +3 -0
- data/templates/descriptions/stylesheet_base.md +4 -0
- data/templates/descriptions/testing.md +9 -0
- data/templates/descriptions/timeout.md +4 -0
- data/templates/descriptions/views.md +8 -0
- data/templates/hound.yml +3 -1
- data/templates/inline_svg.rb +3 -0
- data/templates/partials/ci_simplecov.rb +16 -0
- data/templates/partials/db_optimizations_configuration.rb +7 -0
- data/templates/partials/deployment_readme.md +8 -0
- data/templates/partials/email_smtp.rb +3 -0
- data/templates/partials/profiler_readme.md +8 -0
- data/templates/partials/pull_requests_config.rb +5 -0
- data/templates/partials/runner_readme.md +31 -0
- data/templates/partials/runner_setup.rb +3 -0
- data/templates/rack_mini_profiler.rb +2 -0
- data/templates/rails_helper.rb +7 -4
- data/templates/{dotfiles/.env → sample_env} +0 -2
- data/templates/spec_helper.rb +4 -7
- data/templates/spring.rb +6 -0
- data/templates/stylelintrc.json +3 -0
- data/templates/suspenders_gitignore +1 -1
- metadata +119 -17
- data/templates/app.json.erb +0 -27
- data/templates/browserslist +0 -3
- data/templates/dotfiles/.ctags +0 -2
- data/templates/puma.rb +0 -28
@@ -0,0 +1,23 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "suspenders:production:compression", type: :generator do
|
4
|
+
context "generate" do
|
5
|
+
it "adds Rack::Deflater to the middleware" do
|
6
|
+
with_app { generate("suspenders:production:compression") }
|
7
|
+
|
8
|
+
expect("config/environments/production.rb").to match_contents(
|
9
|
+
%r{config.middleware.use Rack::Deflater},
|
10
|
+
)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context "destroy" do
|
15
|
+
it "removes Rack::Deflater to the middleware" do
|
16
|
+
with_app { destroy("suspenders:production:compression") }
|
17
|
+
|
18
|
+
expect("config/environments/production.rb").not_to match_contents(
|
19
|
+
%r{Rack::Deflater},
|
20
|
+
)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "suspenders:production:deployment", type: :generator do
|
4
|
+
it "generates the configuration for a production deployment" do
|
5
|
+
rm "bin/deploy"
|
6
|
+
|
7
|
+
with_app { generate("suspenders:production:deployment") }
|
8
|
+
|
9
|
+
expect("bin/deploy").to exist_as_a_file
|
10
|
+
expect("bin/deploy").to be_executable
|
11
|
+
expect("README.md").to match_contents(%r{bin/deploy})
|
12
|
+
end
|
13
|
+
|
14
|
+
it "destroys the configuration for a production deployment" do
|
15
|
+
touch "bin/deploy"
|
16
|
+
|
17
|
+
with_app { destroy("suspenders:production:deployment") }
|
18
|
+
|
19
|
+
expect("bin/deploy").not_to exist_as_a_file
|
20
|
+
expect("README.md").not_to match_contents(%r{bin/deploy})
|
21
|
+
end
|
22
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
RSpec.describe "suspenders:production:email" do
|
3
|
+
RSpec.describe "suspenders:production:email", type: :generator do
|
4
4
|
it "generates the configuration for a production email deployment" do
|
5
5
|
with_app { generate("suspenders:production:email") }
|
6
6
|
|
@@ -0,0 +1,37 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "suspenders:production:manifest", type: :generator do
|
4
|
+
it "generates the manifest for a production build" do
|
5
|
+
with_app { generate("suspenders:production:manifest") }
|
6
|
+
|
7
|
+
expect("app.json").to contain_json(
|
8
|
+
name: SuspendersTestHelpers::APP_NAME.dasherize,
|
9
|
+
env: {
|
10
|
+
APPLICATION_HOST: { required: true },
|
11
|
+
AUTO_MIGRATE_DB: { value: true },
|
12
|
+
EMAIL_RECIPIENTS: { required: true },
|
13
|
+
HEROKU_APP_NAME: { required: true },
|
14
|
+
HEROKU_PARENT_APP_NAME: { required: true },
|
15
|
+
RACK_ENV: { required: true },
|
16
|
+
SECRET_KEY_BASE: { generator: "secret" },
|
17
|
+
},
|
18
|
+
)
|
19
|
+
end
|
20
|
+
|
21
|
+
it "destroys the manifest for a production build" do
|
22
|
+
with_app { destroy("suspenders:production:manifest") }
|
23
|
+
|
24
|
+
expect("app.json").not_to contain_json(
|
25
|
+
name: SuspendersTestHelpers::APP_NAME.dasherize,
|
26
|
+
env: {
|
27
|
+
APPLICATION_HOST: { required: true },
|
28
|
+
AUTO_MIGRATE_DB: { value: true },
|
29
|
+
EMAIL_RECIPIENTS: { required: true },
|
30
|
+
HEROKU_APP_NAME: { required: true },
|
31
|
+
HEROKU_PARENT_APP_NAME: { required: true },
|
32
|
+
RACK_ENV: { required: true },
|
33
|
+
SECRET_KEY_BASE: { generator: "secret" },
|
34
|
+
},
|
35
|
+
)
|
36
|
+
end
|
37
|
+
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "suspenders:production:single_redirect", type: :generator do
|
4
|
+
context "generate" do
|
5
|
+
it "adds Rack::CanonicalHost to the production middleware" do
|
6
|
+
with_app { generate("suspenders:production:single_redirect") }
|
7
|
+
middleware_canonical_host = %r{config.middleware.use Rack::CanonicalHost, ENV.fetch\("APPLICATION_HOST"\)}
|
8
|
+
|
9
|
+
expect("config/environments/production.rb").to match_contents(
|
10
|
+
middleware_canonical_host,
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context "destroy" do
|
16
|
+
it "removes Rack::CanonicalHost from the production middleware" do
|
17
|
+
with_app { destroy("suspenders:production:single_redirect") }
|
18
|
+
middleware_canonical_host = %r{config.middleware.use Rack::CanonicalHost, ENV.fetch\("APPLICATION_HOST"\)}
|
19
|
+
|
20
|
+
expect("config/environments/production.rb").not_to match_contents(
|
21
|
+
middleware_canonical_host,
|
22
|
+
)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "suspenders:profiler", type: :generator do
|
4
|
+
it "sets up rack-min-profiler" do
|
5
|
+
with_app { generate("suspenders:profiler") }
|
6
|
+
|
7
|
+
expect("config/initializers/rack_mini_profiler.rb").to \
|
8
|
+
match_contents(/Rack::MiniProfilerRails.initialize/)
|
9
|
+
expect("Gemfile").to match_contents(/rack-mini-profiler/)
|
10
|
+
expect(".env").to match_contents(/RACK_MINI_PROFILER=0/)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "removes rack-min-profiler" do
|
14
|
+
with_app { destroy("suspenders:profiler") }
|
15
|
+
|
16
|
+
expect("config/initializers/rack_mini_profiler.rb").not_to exist_as_a_file
|
17
|
+
expect("Gemfile").not_to match_contents(/rack-mini-profiler/)
|
18
|
+
expect(".env").not_to exist_as_a_file
|
19
|
+
end
|
20
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "suspenders:runner", type: :generator do
|
4
|
+
it "configures the app for running" do
|
5
|
+
with_app { generate("suspenders:runner") }
|
6
|
+
|
7
|
+
expect("Procfile").to exist_as_a_file
|
8
|
+
expect(".sample.env").to exist_as_a_file
|
9
|
+
expect("bin/setup").to match_contents(/\.sample\.env/)
|
10
|
+
expect("README.md").to match_contents(/\.sample\.env/)
|
11
|
+
end
|
12
|
+
|
13
|
+
it "removes custom app running configuration" do
|
14
|
+
with_app { destroy("suspenders:runner") }
|
15
|
+
|
16
|
+
expect("README.md").not_to match_contents(/\.sample\.env/)
|
17
|
+
expect("bin/setup").not_to match_contents(/\.sample\.env/)
|
18
|
+
expect(".sample.env").not_to exist_as_a_file
|
19
|
+
expect("Procfile").not_to exist_as_a_file
|
20
|
+
end
|
21
|
+
|
22
|
+
it "configures the app with a shell script bin/setup" do
|
23
|
+
with_app do
|
24
|
+
copy_file "bin_setup", "bin/setup"
|
25
|
+
generate("suspenders:runner")
|
26
|
+
end
|
27
|
+
|
28
|
+
expect("bin/setup").to match_contents(/\.sample\.env/)
|
29
|
+
end
|
30
|
+
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "spec_helper"
|
2
2
|
|
3
|
-
RSpec.describe "suspenders:staging:pull_requests" do
|
3
|
+
RSpec.describe "suspenders:staging:pull_requests", type: :generator do
|
4
4
|
it "generates the configuration for Heroku pipeline review apps" do
|
5
5
|
with_app { generate("suspenders:staging:pull_requests") }
|
6
6
|
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "suspenders:static", type: :generator do
|
4
|
+
it "adds the gem and pages directory" do
|
5
|
+
with_app { generate("suspenders:static") }
|
6
|
+
|
7
|
+
expect("Gemfile").to match_contents(/high_voltage/)
|
8
|
+
expect("app/views/pages/.keep").to exist_as_a_file
|
9
|
+
end
|
10
|
+
|
11
|
+
it "removes the gem and pages directory" do
|
12
|
+
with_app { destroy("suspenders:static") }
|
13
|
+
|
14
|
+
expect("app/views/pages/.keep").not_to exist_as_a_file
|
15
|
+
expect("Gemfile").not_to match_contents(/high_voltage/)
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
RSpec.describe "suspenders:stylelint", type: :generator do
|
4
|
+
context "generate" do
|
5
|
+
it "creates .stylelintrc.json" do
|
6
|
+
with_app { generate("suspenders:stylelint") }
|
7
|
+
|
8
|
+
expect(".stylelintrc.json").
|
9
|
+
to match_contents(%r{"extends": "@thoughtbot/stylelint-config"})
|
10
|
+
end
|
11
|
+
|
12
|
+
it "adds stylelint and @thoughtbot/stylelint-config to the package.json" do
|
13
|
+
with_app { generate("suspenders:stylelint") }
|
14
|
+
|
15
|
+
expect("package.json").to match_contents(/devDependencies/)
|
16
|
+
expect("package.json").to match_contents(/stylelint/)
|
17
|
+
expect("package.json").to match_contents(%r{@thoughtbot/stylelint-config})
|
18
|
+
end
|
19
|
+
|
20
|
+
it "uncomments the hound config_file option" do
|
21
|
+
with_app { generate("suspenders:stylelint") }
|
22
|
+
|
23
|
+
expect(".hound.yml").to(
|
24
|
+
match_contents(/^ config_file: \.stylelintrc\.json/),
|
25
|
+
)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context "destroy" do
|
30
|
+
it "removes .stylelintrc.json" do
|
31
|
+
with_app do
|
32
|
+
generate("suspenders:stylelint")
|
33
|
+
destroy("suspenders:stylelint")
|
34
|
+
end
|
35
|
+
|
36
|
+
expect(".stylelintrc.json").not_to exist_as_a_file
|
37
|
+
end
|
38
|
+
|
39
|
+
it "removes stylelint and @thoughtbot/stylelint-config from package.json" do
|
40
|
+
with_app do
|
41
|
+
generate("suspenders:stylelint")
|
42
|
+
destroy("suspenders:stylelint")
|
43
|
+
end
|
44
|
+
|
45
|
+
expect("package.json").not_to match_contents(/stylelint/)
|
46
|
+
expect("package.json").
|
47
|
+
not_to match_contents(%r{@thoughtbot/stylelint-config})
|
48
|
+
end
|
49
|
+
|
50
|
+
it "comments in the hound config_file option" do
|
51
|
+
with_app do
|
52
|
+
generate("suspenders:stylelint")
|
53
|
+
destroy("suspenders:stylelint")
|
54
|
+
end
|
55
|
+
|
56
|
+
expect(".hound.yml").
|
57
|
+
to match_contents(/^ # config_file: \.stylelintrc\.json/)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
data/spec/spec_helper.rb
CHANGED
@@ -4,21 +4,27 @@ require "json"
|
|
4
4
|
|
5
5
|
RSpec::Matchers.define :contain_json do
|
6
6
|
match do
|
7
|
-
sub_json = expected
|
8
|
-
filename = actual
|
7
|
+
@sub_json = expected
|
8
|
+
@filename = actual
|
9
9
|
|
10
|
-
filepath = File.join(project_path, filename)
|
11
|
-
json = JSON.parse(IO.read(filepath), symbolize_names: true)
|
12
|
-
|
10
|
+
@filepath = File.join(project_path, @filename)
|
11
|
+
@json = JSON.parse(IO.read(@filepath), symbolize_names: true)
|
12
|
+
|
13
|
+
subhash?(@sub_json, @json)
|
13
14
|
end
|
14
15
|
|
15
16
|
failure_message do
|
16
|
-
|
17
|
-
|
17
|
+
"in #{@filename}, expected to find\n#{@sub_json.inspect}\n" \
|
18
|
+
"in\n#{@json.inspect}"
|
19
|
+
end
|
18
20
|
|
19
|
-
|
20
|
-
json = JSON.parse(IO.read(filepath), symbolize_names: true)
|
21
|
+
private
|
21
22
|
|
22
|
-
|
23
|
+
def subhash?(inner, outer)
|
24
|
+
if inner.is_a?(Hash) && outer.is_a?(Hash)
|
25
|
+
inner.all? { |key, value| subhash?(value, outer[key]) }
|
26
|
+
else
|
27
|
+
inner == outer
|
28
|
+
end
|
23
29
|
end
|
24
30
|
end
|
@@ -0,0 +1,25 @@
|
|
1
|
+
module ProjectFiles
|
2
|
+
def touch(filename)
|
3
|
+
path = File.join(project_path, filename)
|
4
|
+
dirname = File.dirname(path)
|
5
|
+
FileUtils.mkdir_p(dirname)
|
6
|
+
FileUtils.touch(path)
|
7
|
+
end
|
8
|
+
|
9
|
+
def rm(filename)
|
10
|
+
path = File.join(project_path, filename)
|
11
|
+
FileUtils.rm_rf(path)
|
12
|
+
end
|
13
|
+
|
14
|
+
def copy_file(from_in_templates, to_in_project)
|
15
|
+
destination = File.join(project_path, to_in_project)
|
16
|
+
destination_dirname = File.dirname(destination)
|
17
|
+
|
18
|
+
FileUtils.mkdir_p(destination_dirname)
|
19
|
+
|
20
|
+
FileUtils.cp(
|
21
|
+
File.join(root_path, "templates", from_in_templates),
|
22
|
+
destination,
|
23
|
+
)
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
gem "suspenders", path: File.expand_path("../..", __dir__)
|
data/spec/support/suspenders.rb
CHANGED
@@ -19,10 +19,7 @@ module SuspendersTestHelpers
|
|
19
19
|
end
|
20
20
|
|
21
21
|
Dir.chdir(APP_NAME) do
|
22
|
-
|
23
|
-
debug `git add .`
|
24
|
-
debug `git commit -m 'Initial commit'`
|
25
|
-
end
|
22
|
+
commit_all
|
26
23
|
end
|
27
24
|
end
|
28
25
|
end
|
@@ -41,18 +38,11 @@ module SuspendersTestHelpers
|
|
41
38
|
add_fakes_to_path
|
42
39
|
|
43
40
|
with_revision_for_honeybadger do
|
44
|
-
debug `#{system_rails_bin} new #{APP_NAME}`
|
41
|
+
debug `#{system_rails_bin} new #{APP_NAME} -m #{rails_template_path}`
|
45
42
|
end
|
46
43
|
|
47
44
|
Dir.chdir(APP_NAME) do
|
48
|
-
|
49
|
-
file.puts %{gem "suspenders", path: #{root_path.inspect}}
|
50
|
-
end
|
51
|
-
|
52
|
-
with_env("HOME", tmp_path) do
|
53
|
-
debug `git add .`
|
54
|
-
debug `git commit -m 'Initial commit'`
|
55
|
-
end
|
45
|
+
commit_all
|
56
46
|
end
|
57
47
|
end
|
58
48
|
end
|
@@ -135,6 +125,19 @@ module SuspendersTestHelpers
|
|
135
125
|
File.expand_path('../../../', __FILE__)
|
136
126
|
end
|
137
127
|
|
128
|
+
def rails_template_path
|
129
|
+
File.join(root_path, "spec", "support", "rails_template.rb")
|
130
|
+
end
|
131
|
+
|
132
|
+
def commit_all
|
133
|
+
with_env("HOME", tmp_path) do
|
134
|
+
debug `git config user.email suspenders@example.com`
|
135
|
+
debug `git config user.name "Suspenders Boy"`
|
136
|
+
debug `git add .`
|
137
|
+
debug `git commit -m 'Initial commit'`
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
138
141
|
def with_env(name, new_value)
|
139
142
|
had_key = ENV.has_key?(name)
|
140
143
|
prior = ENV[name]
|
@@ -158,7 +161,7 @@ module SuspendersTestHelpers
|
|
158
161
|
|
159
162
|
def run_in_tmp
|
160
163
|
Dir.chdir(tmp_path) do
|
161
|
-
Bundler.
|
164
|
+
Bundler.with_unbundled_env do
|
162
165
|
yield
|
163
166
|
end
|
164
167
|
end
|
@@ -166,7 +169,7 @@ module SuspendersTestHelpers
|
|
166
169
|
|
167
170
|
def run_in_project
|
168
171
|
Dir.chdir(project_path) do
|
169
|
-
Bundler.
|
172
|
+
Bundler.with_unbundled_env do
|
170
173
|
yield
|
171
174
|
end
|
172
175
|
end
|
data/suspenders.gemspec
CHANGED
@@ -28,7 +28,7 @@ rush to build something amazing; don't use it if you like missing deadlines.
|
|
28
28
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
29
29
|
s.version = Suspenders::VERSION
|
30
30
|
|
31
|
-
s.add_dependency 'bitters', '
|
31
|
+
s.add_dependency 'bitters', '>= 2.0.4'
|
32
32
|
s.add_dependency 'rails', Suspenders::RAILS_VERSION
|
33
33
|
|
34
34
|
s.add_development_dependency 'rspec', '~> 3.2'
|
data/templates/Gemfile.erb
CHANGED
@@ -7,35 +7,30 @@ end
|
|
7
7
|
|
8
8
|
ruby "<%= Suspenders::RUBY_VERSION %>"
|
9
9
|
|
10
|
+
<% unless options[:api] %>
|
10
11
|
gem "autoprefixer-rails"
|
12
|
+
<% end %>
|
13
|
+
gem "bootsnap", require: false
|
11
14
|
gem "honeybadger"
|
12
15
|
gem "pg"
|
13
16
|
gem "puma"
|
14
17
|
gem "rack-canonical-host"
|
15
18
|
gem "rails", "<%= Suspenders::RAILS_VERSION %>"
|
16
19
|
gem "recipient_interceptor"
|
17
|
-
gem "
|
20
|
+
gem "sassc-rails"
|
18
21
|
gem "skylight"
|
19
|
-
gem "sprockets", "
|
22
|
+
gem "sprockets", "< 4"
|
20
23
|
gem "title"
|
21
24
|
gem "tzinfo-data", platforms: [:mingw, :x64_mingw, :mswin, :jruby]
|
22
|
-
gem "uglifier"
|
23
|
-
gem "bootsnap", require: false
|
24
|
-
<% if options[:webpack] %>
|
25
25
|
gem "webpacker"
|
26
|
-
<% end %>
|
27
26
|
|
28
27
|
group :development do
|
29
28
|
gem "listen"
|
30
|
-
gem "rack-mini-profiler", require: false
|
31
|
-
gem "spring"
|
32
29
|
gem "web-console"
|
33
30
|
end
|
34
31
|
|
35
32
|
group :development, :test do
|
36
33
|
gem "awesome_print"
|
37
|
-
gem "bundler-audit", ">= 0.5.0", require: false
|
38
|
-
gem "dotenv-rails"
|
39
34
|
gem "pry-byebug"
|
40
35
|
gem "pry-rails"
|
41
36
|
end
|
@@ -43,7 +38,6 @@ end
|
|
43
38
|
group :test do
|
44
39
|
gem "formulaic"
|
45
40
|
gem "launchy"
|
46
|
-
gem "simplecov", require: false
|
47
41
|
gem "timecop"
|
48
42
|
gem "webmock"
|
49
43
|
end
|