-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues #10 and #12 #13
Changes from all commits
3b15fd0
1bbd4d5
4aac9ff
fc1c4f7
5ae51dc
4282644
d03a05f
f7fd57a
e28a142
cb15b3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace :test do | ||
task :coverage do | ||
task coverage: :environment do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does loading the environment influence the coverage at all? I was under the impression that simplecov needed to be loaded before the application to corrrectly calculate the coverage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmmm I did this because rubocop yelled at me about it. I take your point about coverage tho. I'll look into this. |
||
require "simplecov" | ||
Rake::Task["test"].execute | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
# directory. Alternatively, in the individual `*_spec.rb` files, manually | ||
# require only the support files necessary. | ||
# | ||
Dir[Rails.root.join("spec", "support", "**", "*.rb")].each { |f| require f } | ||
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rubocop has changed it's mind about separators because There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 TIL |
||
|
||
# Checks for pending migrations and applies them before tests are run. | ||
# If you are not using ActiveRecord, you can remove these lines. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# encoding: utf-8 | ||
|
||
require "fileutils" | ||
require "shellwords" | ||
|
||
RAILS_REQUIREMENT = "~> 6.0.0".freeze | ||
|
||
def apply_template! | ||
|
@@ -36,39 +39,39 @@ def apply_template! | |
apply "public/template.rb" | ||
apply "spec/template.rb" | ||
|
||
git :init unless preexisting_git_repo? | ||
empty_directory ".git/safe" | ||
# The block passed to "after_bundle" seems to run after `bundle install` | ||
# but also after `webpacker:install` and after Rails has initialized the git | ||
# repo | ||
after_bundle do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This diff is a bit messy but basically I moved lots of commands inside the |
||
run_with_clean_bundler_env "bin/setup" | ||
|
||
apply "variants/frontend-base/template.rb" | ||
|
||
run_with_clean_bundler_env "bin/setup" | ||
run_with_clean_bundler_env "bin/rails webpacker:install" | ||
create_initial_migration | ||
create_initial_migration | ||
|
||
# Apply variants after setup and initial install, but before commit | ||
apply "variants/accessibility/template.rb" | ||
apply "variants/frontend-base/template.rb" | ||
apply "variants/frontend-foundation/template.rb" if apply_variant?(:foundation) | ||
# Apply variants after setup and initial install, but before commit | ||
apply "variants/accessibility/template.rb" | ||
apply "variants/frontend-foundation/template.rb" if apply_variant?(:foundation) | ||
|
||
binstubs = %w[ | ||
brakeman bundler bundler-audit rubocop sidekiq | ||
] | ||
run_with_clean_bundler_env "bundle binstubs #{binstubs.join(' ')} --force" | ||
binstubs = %w[ | ||
brakeman bundler bundler-audit rubocop sidekiq | ||
] | ||
run_with_clean_bundler_env "bundle binstubs #{binstubs.join(' ')} --force" | ||
|
||
template "rubocop.yml.tt", ".rubocop.yml" | ||
run_rubocop_autocorrections | ||
template "rubocop.yml.tt", ".rubocop.yml" | ||
run_rubocop_autocorrections | ||
|
||
unless any_local_git_commits? | ||
git add: "-A ." | ||
git commit: "-n -m 'Set up project'" | ||
if git_repo_specified? | ||
git remote: "add origin #{git_repo_url.shellescape}" | ||
git push: "-u origin --all" | ||
unless any_local_git_commits? | ||
git add: "-A ." | ||
git commit: "-n -m 'Set up project'" | ||
if git_repo_specified? | ||
git remote: "add origin #{git_repo_url.shellescape}" | ||
git push: "-u origin --all" | ||
end | ||
end | ||
end | ||
end | ||
|
||
require "fileutils" | ||
require "shellwords" | ||
|
||
# Add this template directory to source_paths so that Thor actions like | ||
# copy_file and template resolve against our source files. If this file was | ||
# invoked remotely via HTTP, that means the files are not present locally. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
source_paths.unshift(File.dirname(__FILE__)) | ||
|
||
run "mv app/assets app/frontend" | ||
run "mkdir app/assets" | ||
run "mv app/frontend/config app/assets/config" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This moves There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is that just Sprockets? I did find putting things in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sprockets hard codes this path. rails/sprockets-rails#369 is open to see if it can be made customisable. I take your point on the defaults. I'm loathe to give it up because the default feels gross but accepting the default might be the most pragmatic. |
||
|
||
run "mv app/javascript/* app/frontend" | ||
run "rm -rf app/javascript" | ||
apply "config/template.rb" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that since this route definition includes three different routes:
I think we should probably define these with three different route definitions, so that they are inherently three different routes