-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Refactor heredoc * Fix lint warning * Add README and update heredocs on the main template file
- Loading branch information
Showing
32 changed files
with
227 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
append_to_file '.gitignore' do | ||
<<~EOT | ||
<<~IGNORE | ||
# Ignore folder information and IDE-specific files | ||
.DS_Store | ||
.idea/* | ||
# Ignore folder information and IDE-specific files | ||
.DS_Store | ||
.idea/* | ||
# Ignore the test coverage results from SimpleCov | ||
/coverage | ||
EOT | ||
# Ignore the test coverage results from SimpleCov | ||
/coverage | ||
IGNORE | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
insert_into_file 'Gemfile', after: /# Authentications & Authorizations.*\n/ do | ||
<<~GEM | ||
<<~RUBY | ||
gem 'devise' # Authentication solution for Rails with Warden | ||
GEM | ||
RUBY | ||
end | ||
|
||
insert_into_file 'Gemfile', after: /# Translations.*\n/ do | ||
<<~GEM | ||
<<~RUBY | ||
# gem 'devise-i18n' # Translations for Devise | ||
GEM | ||
RUBY | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
file 'spec/support/devise.rb', <<-CODE | ||
RSpec.configure do |config| | ||
config.include Devise::Test::ControllerHelpers, type: :controller | ||
config.include Devise::Test::ControllerHelpers, type: :view | ||
end | ||
CODE | ||
file 'spec/support/devise.rb', <<~RUBY | ||
RSpec.configure do |config| | ||
config.include Devise::Test::ControllerHelpers, type: :controller | ||
config.include Devise::Test::ControllerHelpers, type: :view | ||
end | ||
RUBY |
8 changes: 4 additions & 4 deletions
8
.template/addons/nginx/bin/start.sh → .template/addons/nginx/bin/start.sh.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
insert_into_file 'bin/start.sh', after: "fi\n" do | ||
<<-EOT | ||
<<~SHELL | ||
./bin/inject_port_into_nginx.sh | ||
./bin/inject_port_into_nginx.sh | ||
nginx -c /etc/nginx/conf.d/default.conf | ||
EOT | ||
nginx -c /etc/nginx/conf.d/default.conf | ||
SHELL | ||
end | ||
|
||
gsub_file('bin/start.sh', 'bundle exec rails s -p $PORT -b 0.0.0.0', 'bundle exec rails s -p 3000 -b 0.0.0.0') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
use_source_path __dir__ | ||
|
||
apply 'start.sh' | ||
apply 'start.sh.rb' | ||
copy_file 'bin/inject_port_into_nginx.sh', mode: :preserve |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 17 additions & 17 deletions
34
.template/addons/phrase_app/spec/codebase/codebase_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
insert_into_file 'spec/codebase/codebase_spec.rb', before: %r{end\Z} do | ||
<<-EOT | ||
<<~RUBY.indent(2) | ||
# rubocop:disable RSpec/ExampleLength | ||
it 'does not offend PhraseApp Pull configuration' do | ||
locale_tags = Dir[File.expand_path(Rails.root.join('config', 'locales', '*.yml'))] | ||
.map { |path| path.split('/').last } # ["campaign.en.yml", "article.en.yml", "campaign.th.yml"] | ||
.map { |path| path.split('.').first } # ["campaign", "article", "campaign"] | ||
.uniq # ["campaign", "article"] | ||
.sort # ["article", "campaign"] | ||
phrase_app_pull_tags = YAML | ||
.load_file(Rails.root.join('.phraseapp.yml')) | ||
.dig('phraseapp', 'pull', 'targets') | ||
.map { |target| target.dig('params', 'tags') } | ||
.sort | ||
# rubocop:disable RSpec/ExampleLength | ||
it 'does not offend PhraseApp Pull configuration' do | ||
locale_tags = Dir[File.expand_path(Rails.root.join('config', 'locales', '*.yml'))] | ||
.map { |path| path.split('/').last } # ["campaign.en.yml", "article.en.yml", "campaign.th.yml"] | ||
.map { |path| path.split('.').first } # ["campaign", "article", "campaign"] | ||
.uniq # ["campaign", "article"] | ||
.sort # ["article", "campaign"] | ||
phrase_app_pull_tags = YAML | ||
.load_file(Rails.root.join('.phraseapp.yml')) | ||
.dig('phraseapp', 'pull', 'targets') | ||
.map { |target| target.dig('params', 'tags') } | ||
.sort | ||
expect(phrase_app_pull_tags).to eq locale_tags | ||
end | ||
# rubocop:enable RSpec/ExampleLength | ||
EOT | ||
expect(phrase_app_pull_tags).to eq locale_tags | ||
end | ||
# rubocop:enable RSpec/ExampleLength | ||
RUBY | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
insert_into_file 'Dangerfile', after: /eslint.lint.*\n/ do | ||
<<~DANGER_PLUGIN | ||
<<~RUBY | ||
# Runs slim-lint on modified and added files in the PR | ||
slim_lint.lint | ||
DANGER_PLUGIN | ||
RUBY | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# frozen_string_literal: true | ||
|
||
insert_into_file 'Gemfile', after: /gem 'pundit'.*\n/ do | ||
<<~GEM | ||
<<~RUBY | ||
# Templating | ||
gem 'slim' # light weight template engine | ||
GEM | ||
RUBY | ||
end | ||
|
||
############################ | ||
# Group: :development, :test | ||
############################ | ||
|
||
insert_into_file 'Gemfile', after: /gem 'danger'.*\n/ do | ||
<<~GEM.indent(2) | ||
<<~RUBY.indent(2) | ||
gem 'danger-slim_lint' # Lint slim files. | ||
GEM | ||
RUBY | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# Controllers | ||
directory 'app/controllers/concerns' | ||
inject_into_class 'app/controllers/application_controller.rb', 'ApplicationController' do | ||
<<-EOT | ||
include Localization | ||
EOT | ||
<<~RUBY.indent(2) | ||
include Localization | ||
RUBY | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
append_to_file '.tool-versions' do | ||
<<~EOT | ||
<<~TOOL_VERSION | ||
nodejs #{NODE_VERSION} | ||
EOT | ||
TOOL_VERSION | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
insert_into_file 'Dangerfile', after: %r{suggester.suggest.*\n} do | ||
<<~EOT | ||
<<~RUBY | ||
# Runs ESLint on modified and added files in the PR | ||
eslint.lint | ||
EOT | ||
RUBY | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
append_to_file 'Procfile.dev' do | ||
<<~EOT | ||
<<~PROCFILE | ||
js: yarn build --watch | ||
css: yarn build:css --watch | ||
EOT | ||
PROCFILE | ||
end |
Oops, something went wrong.