jt_tools 0.0.14 → 0.0.15
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/.circleci/config.yml +11 -12
- data/.gitattributes +5 -1
- data/.github/workflows/test.yml +84 -0
- data/.rubocop.yml +11 -0
- data/.standard.yml +5 -1
- data/Gemfile +10 -3
- data/README.md +1 -1
- data/Rakefile +5 -5
- data/bin/ci-test +13 -0
- data/bin/lint +10 -0
- data/bin/rubocop +29 -0
- data/bin/test +13 -8
- data/jt_tools.gemspec +14 -14
- data/lib/install/.circleci/config.yml +43 -34
- data/lib/install/.gitattributes +4 -4
- data/lib/install/.rubocop.yml +15 -12
- data/lib/install/.simplecov +6 -6
- data/lib/install/Brewfile +11 -11
- data/lib/install/Gemfile.tools +7 -6
- data/lib/install/app.json +1 -1
- data/lib/install/bin/tools-setup +3 -1
- data/lib/install/bin/tools-upgrade +2 -2
- data/lib/jt_tools.rb +2 -2
- data/lib/jt_tools/railtie.rb +2 -2
- data/lib/jt_tools/version.rb +1 -1
- data/lib/tasks/install.rake +3 -3
- data/rejuvenation.rb +6 -4
- data/template.rb +126 -105
- metadata +8 -4
- data/bin/standardrb +0 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 546f1c903d3ee920591bf6c3fd5d622f9a38714762148f05fbf1c221862b34fd
|
|
4
|
+
data.tar.gz: d719294b0c1573c574622ee66612650c7d93d270c83ceb1e9565e7a9f7a00945
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0feb0f9ef79b73f11d91c3c043935cc2f68de2a6c992f0c85228d78ee429fabf85347bf6bd3c05b65371a4b3e4eae53036d4643174558e80651cd68f492eae8f
|
|
7
|
+
data.tar.gz: 4652b8b1f95a35011ea21085cd34bea3a39bd466ec4974f7292acf3cd16ed2b4f5ad5c1ce8abb2a3c761e56db6ee027e884cc6bb591c9273e638090eb340c314
|
data/.circleci/config.yml
CHANGED
|
@@ -3,11 +3,13 @@ version: 2.1
|
|
|
3
3
|
jobs:
|
|
4
4
|
test:
|
|
5
5
|
docker:
|
|
6
|
-
- image: cimg/ruby:
|
|
6
|
+
- image: cimg/ruby:3.0-node
|
|
7
7
|
environment:
|
|
8
8
|
DATABASE_URL: postgresql://ubuntu@127.0.0.1/db_test
|
|
9
|
+
BUNDLE_PATH: /home/circleci/project/vendor/bundle
|
|
9
10
|
BUNDLE_JOBS: 4
|
|
10
11
|
BUNDLE_RETRY: 3
|
|
12
|
+
DEBIAN_FRONTEND: noninteractive
|
|
11
13
|
|
|
12
14
|
- image: circleci/postgres:alpine-ram
|
|
13
15
|
environment:
|
|
@@ -22,22 +24,15 @@ jobs:
|
|
|
22
24
|
- rails-v2-{{ arch }}-
|
|
23
25
|
- rails-v2-
|
|
24
26
|
|
|
25
|
-
- run: gem install rails -N --update-sources
|
|
26
|
-
|
|
27
|
-
- run: sudo apt-get update -qq && sudo apt-get install -yq --no-install-recommends
|
|
28
|
-
cmake curl yamllint python3-setuptools python3-pkg-resources pkg-config
|
|
29
|
-
- run: curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh |
|
|
30
|
-
sudo bash
|
|
31
|
-
- run: git config --global user.email "you@example.com" && git config --global user.name "Your Name"
|
|
32
|
-
|
|
33
27
|
- run: |
|
|
34
|
-
[[ $CIRCLE_NODE_INDEX == "0" ]] || bin/test
|
|
28
|
+
[[ $CIRCLE_NODE_INDEX == "0" ]] || bin/ci-test
|
|
35
29
|
- run: |
|
|
36
|
-
[[ $CIRCLE_NODE_INDEX == "1" ]] || TEST_APP_TEMPLATE=true bin/test
|
|
30
|
+
[[ $CIRCLE_NODE_INDEX == "1" ]] || TEST_APP_TEMPLATE=true bin/ci-test
|
|
37
31
|
|
|
38
32
|
- save_cache:
|
|
39
33
|
key: rails-v2-{{ arch }}-{{ .Revision }}
|
|
40
34
|
paths:
|
|
35
|
+
- /home/circleci/project/vendor/bundle
|
|
41
36
|
- /home/circleci/.rubygems
|
|
42
37
|
- /home/circleci/.cache
|
|
43
38
|
|
|
@@ -55,4 +50,8 @@ workflows:
|
|
|
55
50
|
only:
|
|
56
51
|
- master
|
|
57
52
|
jobs:
|
|
58
|
-
-
|
|
53
|
+
- hold:
|
|
54
|
+
type: approval
|
|
55
|
+
- test:
|
|
56
|
+
requires:
|
|
57
|
+
- hold
|
data/.gitattributes
CHANGED
|
@@ -3,5 +3,9 @@
|
|
|
3
3
|
*.rb diff=ruby
|
|
4
4
|
*.js diff=javascript
|
|
5
5
|
|
|
6
|
-
/
|
|
6
|
+
db/schema.rb merge=ours diff=ruby linguist-generated
|
|
7
|
+
yarn.lock merge=ours linguist-generated
|
|
8
|
+
Gemfile.lock merge=ours linguist-generated
|
|
7
9
|
|
|
10
|
+
vendor/* linguist-vendored
|
|
11
|
+
bin/* linguist-generated
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
pull_request:
|
|
8
|
+
pull_request_target:
|
|
9
|
+
branches:
|
|
10
|
+
- master
|
|
11
|
+
|
|
12
|
+
env:
|
|
13
|
+
DEBIAN_FRONTEND: noninteractive
|
|
14
|
+
CIRCLECI: true
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
lint:
|
|
18
|
+
name: Lint
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v2
|
|
24
|
+
|
|
25
|
+
- name: Set up Ruby
|
|
26
|
+
uses: ruby/setup-ruby@v1
|
|
27
|
+
with:
|
|
28
|
+
ruby-version: '3.0'
|
|
29
|
+
bundler-cache: true
|
|
30
|
+
|
|
31
|
+
- name: Run standard Ruby linter
|
|
32
|
+
run: bundle exec rubocop -P -c ./.rubocop.yml ./
|
|
33
|
+
|
|
34
|
+
test:
|
|
35
|
+
name: Functional testing
|
|
36
|
+
env:
|
|
37
|
+
DATABASE_URL: postgresql://postgres_user:postgres@localhost:5432/postgres_db
|
|
38
|
+
|
|
39
|
+
strategy:
|
|
40
|
+
matrix:
|
|
41
|
+
os-version: [ 'ubuntu-20.04', 'ubuntu-latest' ]
|
|
42
|
+
fail-fast: true
|
|
43
|
+
|
|
44
|
+
runs-on: ${{ matrix.os-version }}
|
|
45
|
+
|
|
46
|
+
services:
|
|
47
|
+
postgres:
|
|
48
|
+
image: postgres # circleci/postgres:alpine-ram
|
|
49
|
+
env:
|
|
50
|
+
POSTGRES_DB: postgres_db
|
|
51
|
+
POSTGRES_USER: postgres_user
|
|
52
|
+
POSTGRES_PASSWORD: postgres
|
|
53
|
+
ports:
|
|
54
|
+
- 5432:5432
|
|
55
|
+
options: >-
|
|
56
|
+
--health-cmd pg_isready
|
|
57
|
+
--health-interval 10s
|
|
58
|
+
--health-timeout 5s
|
|
59
|
+
--health-retries 5
|
|
60
|
+
|
|
61
|
+
steps:
|
|
62
|
+
- name: Checkout code
|
|
63
|
+
uses: actions/checkout@v2
|
|
64
|
+
|
|
65
|
+
- name: Install PostgreSQL client
|
|
66
|
+
run: sudo apt-get -yqq install libpq-dev
|
|
67
|
+
|
|
68
|
+
- name: Set up Ruby
|
|
69
|
+
uses: ruby/setup-ruby@v1
|
|
70
|
+
with:
|
|
71
|
+
ruby-version: '3.0'
|
|
72
|
+
bundler-cache: true
|
|
73
|
+
|
|
74
|
+
- name: Use Node.js
|
|
75
|
+
uses: actions/setup-node@v1
|
|
76
|
+
with:
|
|
77
|
+
node-version: 14
|
|
78
|
+
|
|
79
|
+
- name: Disable Linuxbrew
|
|
80
|
+
run: |
|
|
81
|
+
[[ $(uname -s) == "Linux"* ]] && sudo rm -rf $(which brew)
|
|
82
|
+
|
|
83
|
+
- name: Run Tests
|
|
84
|
+
run: bin/ci-test
|
data/.rubocop.yml
ADDED
data/.standard.yml
CHANGED
|
@@ -2,9 +2,13 @@ default_ignores: false
|
|
|
2
2
|
#fix: true
|
|
3
3
|
format: progress
|
|
4
4
|
parallel: true
|
|
5
|
-
ruby_version:
|
|
5
|
+
ruby_version: 3.0
|
|
6
6
|
|
|
7
7
|
ignore:
|
|
8
|
+
- '**/*':
|
|
9
|
+
- Standard/SemanticBlocks
|
|
10
|
+
- 'db/schema.rb'
|
|
8
11
|
- 'test/**/*':
|
|
9
12
|
- Layout/AlignHash
|
|
10
13
|
- 'tmp/**/*'
|
|
14
|
+
- 'vendor/**/*'
|
data/Gemfile
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
source 'https://rubygems.org'
|
|
4
|
+
|
|
5
|
+
ruby '3.0.0'
|
|
2
6
|
|
|
3
7
|
# Specify your gem's dependencies in jt_tools.gemspec
|
|
4
8
|
gemspec
|
|
5
9
|
|
|
6
|
-
gem
|
|
7
|
-
gem
|
|
10
|
+
gem 'bump'
|
|
11
|
+
gem 'rubocop-minitest', require: false
|
|
12
|
+
gem 'rubocop-performance', require: false
|
|
13
|
+
gem 'rubocop-rails', require: false
|
|
14
|
+
gem 'standard', '>= 0.4.7', require: false
|
data/README.md
CHANGED
|
@@ -20,10 +20,10 @@ Pre-setup for service
|
|
|
20
20
|
|
|
21
21
|
* [GitHub](https://github.com)
|
|
22
22
|
* [Heroku](https://jtway.co/make-master-stable-again-b15c9ff3b129) (Heroku Reviews Apps)
|
|
23
|
+
* [MemCachier](https://www.memcachier.com/)
|
|
23
24
|
* [CircleCI](https://circleci.com/)
|
|
24
25
|
* [Codecov](https://codecov.io/) and [Simplecov](https://github.com/colszowka/simplecov)
|
|
25
26
|
* [Dependabot](https://dependabot.com/)
|
|
26
|
-
* [MemCachier](https://www.memcachier.com/)
|
|
27
27
|
* Code Styles:
|
|
28
28
|
* [Pronto](https://jtway.co/effortless-code-review-for-pull-request-changes-241206b1cb04)
|
|
29
29
|
* [Rubocop](https://github.com/rubocop-hq/rubocop)
|
data/Rakefile
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require
|
|
4
|
-
require
|
|
3
|
+
require 'bundler/gem_tasks'
|
|
4
|
+
require 'rake/testtask'
|
|
5
5
|
|
|
6
6
|
Rake::TestTask.new(:test) do |t|
|
|
7
|
-
t.libs <<
|
|
8
|
-
t.libs <<
|
|
9
|
-
t.test_files = FileList[
|
|
7
|
+
t.libs << 'test'
|
|
8
|
+
t.libs << 'lib'
|
|
9
|
+
t.test_files = FileList['test/**/*_test.rb']
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
task default: :test
|
data/bin/ci-test
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -eo pipefail
|
|
4
|
+
|
|
5
|
+
gem install rails -N --update-sources
|
|
6
|
+
|
|
7
|
+
sudo apt-get update -qq && \
|
|
8
|
+
sudo apt-get install -yq --no-install-recommends \
|
|
9
|
+
cmake curl yamllint python3-setuptools python3-pkg-resources pkg-config
|
|
10
|
+
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | sudo bash
|
|
11
|
+
git config --global user.email "you@example.com" && git config --global user.name "Your Name"
|
|
12
|
+
|
|
13
|
+
bin/test
|
data/bin/lint
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
set -eo pipefail
|
|
4
|
+
|
|
5
|
+
yamllint --config-file lib/install/.yamllint.yml --strict .*/*.yml
|
|
6
|
+
yamllint --config-file lib/install/.yamllint.yml --strict ./*.yml
|
|
7
|
+
yamllint --config-file lib/install/.yamllint.yml --strict lib/**/.*.yml
|
|
8
|
+
yamllint --config-file lib/install/.yamllint.yml --strict ./**/.*/*.yml
|
|
9
|
+
|
|
10
|
+
bundle exec rubocop -P
|
data/bin/rubocop
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env ruby
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
#
|
|
5
|
+
# This file was generated by Bundler.
|
|
6
|
+
#
|
|
7
|
+
# The application 'rubocop' is installed as part of a gem, and
|
|
8
|
+
# this file is here to facilitate running it.
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
require 'pathname'
|
|
12
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile',
|
|
13
|
+
Pathname.new(__FILE__).realpath)
|
|
14
|
+
|
|
15
|
+
bundle_binstub = File.expand_path('bundle', __dir__)
|
|
16
|
+
|
|
17
|
+
if File.file?(bundle_binstub)
|
|
18
|
+
if /This file was generated by Bundler/.match?(File.read(bundle_binstub, 300))
|
|
19
|
+
load(bundle_binstub)
|
|
20
|
+
else
|
|
21
|
+
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
+
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
require 'rubygems'
|
|
27
|
+
require 'bundler/setup'
|
|
28
|
+
|
|
29
|
+
load Gem.bin_path('rubocop', 'rubocop')
|
data/bin/test
CHANGED
|
@@ -3,11 +3,8 @@
|
|
|
3
3
|
set -eo pipefail
|
|
4
4
|
|
|
5
5
|
echo ""
|
|
6
|
-
echo "==
|
|
7
|
-
|
|
8
|
-
yamllint --config-file lib/install/.yamllint.yml --strict *.yml
|
|
9
|
-
yamllint --config-file lib/install/.yamllint.yml --strict lib/**/.*.yml
|
|
10
|
-
yamllint --config-file lib/install/.yamllint.yml --strict **/.*/*.yml
|
|
6
|
+
echo "== Lint: =="
|
|
7
|
+
bin/lint
|
|
11
8
|
|
|
12
9
|
mkdir -p tmp/
|
|
13
10
|
|
|
@@ -15,16 +12,18 @@ cd tmp
|
|
|
15
12
|
rm -rf test_tmpl
|
|
16
13
|
|
|
17
14
|
# Test installation of missed gems on applying template
|
|
18
|
-
gem uninstall oj || true
|
|
15
|
+
gem uninstall --force --silent oj || true
|
|
19
16
|
|
|
20
17
|
if [[ "$TEST_APP_TEMPLATE" == "true" ]]
|
|
21
18
|
then
|
|
22
|
-
|
|
19
|
+
echo "Adds template to existed app"
|
|
20
|
+
rails new test_tmpl --quiet --database postgresql
|
|
23
21
|
cd test_tmpl
|
|
24
22
|
bin/setup
|
|
25
23
|
bin/rails app:template LOCATION="../../template.rb"
|
|
26
24
|
else
|
|
27
|
-
|
|
25
|
+
echo "Generate app with template"
|
|
26
|
+
rails new test_tmpl --template ../template.rb --quiet --database postgresql
|
|
28
27
|
cd test_tmpl
|
|
29
28
|
bin/setup
|
|
30
29
|
fi
|
|
@@ -67,3 +66,9 @@ CIRCLECI=false bin/git-hooks/pre-push
|
|
|
67
66
|
|
|
68
67
|
bin/rubocop --config ../../lib/install/.rubocop.yml --debug --extra-details --display-style-guide --parallel ../../lib
|
|
69
68
|
node_modules/.bin/eslint --config ../../lib/install/.eslintrc.js --quiet --no-color ../../lib/**/.*.js
|
|
69
|
+
|
|
70
|
+
# For local run only
|
|
71
|
+
if [[ -z "$CIRCLECI" ]]
|
|
72
|
+
then
|
|
73
|
+
circleci local execute --job test --config .circleci/config.yml
|
|
74
|
+
fi
|
data/jt_tools.gemspec
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
lib = File.expand_path(
|
|
3
|
+
lib = File.expand_path('lib', __dir__)
|
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
5
|
-
require
|
|
5
|
+
require 'jt_tools/version'
|
|
6
6
|
|
|
7
7
|
Gem::Specification.new do |spec|
|
|
8
|
-
spec.name =
|
|
8
|
+
spec.name = 'jt_tools'
|
|
9
9
|
spec.version = JtTools::VERSION
|
|
10
|
-
spec.authors = [
|
|
11
|
-
spec.email = [
|
|
10
|
+
spec.authors = ['Paul Keen']
|
|
11
|
+
spec.email = ['pftg@users.noreply.github.com']
|
|
12
12
|
|
|
13
|
-
spec.summary =
|
|
14
|
-
spec.description =
|
|
15
|
-
spec.homepage =
|
|
16
|
-
spec.license =
|
|
13
|
+
spec.summary = 'Setup development scripts to manage code base effectively'
|
|
14
|
+
spec.description = 'Helpful scripts to run linters locally and on CI'
|
|
15
|
+
spec.homepage = 'https://jtway.co'
|
|
16
|
+
spec.license = 'MIT'
|
|
17
17
|
|
|
18
|
-
spec.metadata[
|
|
19
|
-
spec.metadata[
|
|
20
|
-
spec.metadata[
|
|
18
|
+
spec.metadata['homepage_uri'] = spec.homepage
|
|
19
|
+
spec.metadata['source_code_uri'] = 'https://github.com/jetthoughts/jt-tools/'
|
|
20
|
+
spec.metadata['changelog_uri'] = 'https://github.com/jetthoughts/jt-tools/'
|
|
21
21
|
|
|
22
|
-
spec.add_dependency
|
|
22
|
+
spec.add_dependency 'railties', '>= 4.2'
|
|
23
23
|
|
|
24
24
|
# Specify which files should be added to the gem when it is released.
|
|
25
25
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
|
@@ -27,5 +27,5 @@
|
|
|
27
27
|
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
|
28
28
|
end
|
|
29
29
|
|
|
30
|
-
spec.require_paths = [
|
|
30
|
+
spec.require_paths = ['lib']
|
|
31
31
|
end
|
|
@@ -7,8 +7,9 @@
|
|
|
7
7
|
version: 2.1
|
|
8
8
|
|
|
9
9
|
orbs:
|
|
10
|
-
|
|
11
|
-
node: circleci/node@4
|
|
10
|
+
browser-tools: circleci/browser-tools@1.1.1
|
|
11
|
+
node: circleci/node@4
|
|
12
|
+
ruby: circleci/ruby@1
|
|
12
13
|
|
|
13
14
|
workflows:
|
|
14
15
|
version: 2
|
|
@@ -38,7 +39,7 @@ jobs:
|
|
|
38
39
|
test:
|
|
39
40
|
docker:
|
|
40
41
|
# specify the version you desire here
|
|
41
|
-
- image:
|
|
42
|
+
- image: cimg/ruby:3.0-browsers
|
|
42
43
|
environment:
|
|
43
44
|
BUNDLE_GEMFILE: Gemfile
|
|
44
45
|
BUNDLE_PATH: vendor/bundle
|
|
@@ -61,6 +62,8 @@ jobs:
|
|
|
61
62
|
|
|
62
63
|
steps:
|
|
63
64
|
- checkout
|
|
65
|
+
- browser-tools/install-chrome
|
|
66
|
+
- browser-tools/install-chromedriver
|
|
64
67
|
|
|
65
68
|
- restore_cache:
|
|
66
69
|
name: Restore Bundler Cache between Branches
|
|
@@ -74,10 +77,14 @@ jobs:
|
|
|
74
77
|
with-cache: false
|
|
75
78
|
path: './vendor/bundle'
|
|
76
79
|
|
|
80
|
+
- run: bundle exec bootsnap precompile --gemfile app/ lib/
|
|
81
|
+
- run: gem install spring
|
|
82
|
+
|
|
77
83
|
- save_cache:
|
|
78
84
|
name: Save Bundler Cache between Branches
|
|
79
85
|
paths:
|
|
80
|
-
-
|
|
86
|
+
- vendor/bundle
|
|
87
|
+
- tmp/cache/bootsnap-compile-cache
|
|
81
88
|
key: v1-dependencies-{{ checksum "Gemfile.lock" }}
|
|
82
89
|
|
|
83
90
|
- node/install-packages:
|
|
@@ -106,43 +113,45 @@ jobs:
|
|
|
106
113
|
- tmp/cache/assets
|
|
107
114
|
- tmp/cache/webpacker
|
|
108
115
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
116
|
+
# Run JS Tests
|
|
117
|
+
# - restore_cache:
|
|
118
|
+
# name: Restore Jest Cache
|
|
119
|
+
# keys:
|
|
120
|
+
# - jest-cache-v1-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
|
121
|
+
# - jest-cache-v1-{{ arch }}-{{ .Branch }}-
|
|
122
|
+
# - jest-cache-v1-
|
|
123
|
+
#
|
|
124
|
+
# - run:
|
|
125
|
+
# name: JavaScript Unit Tests
|
|
126
|
+
# command: |
|
|
127
|
+
# bin/yarn test --ci --no-watchman \
|
|
128
|
+
# --coverage --coverageDirectory coverage/jest \
|
|
129
|
+
# --coverageReporters text-summary --coverageReporters html \
|
|
130
|
+
# --reporters=jest-junit
|
|
131
|
+
# environment:
|
|
132
|
+
# JEST_JUNIT_OUTPUT_DIR: tmp/reports/jest-results
|
|
133
|
+
#
|
|
134
|
+
# - save_cache:
|
|
135
|
+
# name: Save Jest Cache
|
|
136
|
+
# key: jest-cache-v1-{{ arch }}-{{ .Branch }}-{{ .Environment.CIRCLE_SHA1 }}
|
|
137
|
+
# paths:
|
|
138
|
+
# - tmp/cache/jest
|
|
139
|
+
|
|
140
|
+
- run: bin/rails db:test:prepare
|
|
141
|
+
- run: bin/rails test "test/**/*_test.rb"
|
|
142
|
+
|
|
143
|
+
# Collect reports
|
|
136
144
|
- store_test_results:
|
|
137
145
|
path: ./tmp/reports/
|
|
138
146
|
- store_artifacts:
|
|
139
147
|
path: ./coverage
|
|
140
148
|
lint:
|
|
141
149
|
docker:
|
|
142
|
-
- image: cimg/ruby:
|
|
150
|
+
- image: cimg/ruby:3.0-node
|
|
143
151
|
environment:
|
|
144
152
|
DISABLE_SPRING: 1
|
|
145
153
|
BUNDLE_GEMFILE: Gemfile.tools
|
|
154
|
+
BUNDLE_PATH: vendor/bundle-tools
|
|
146
155
|
BUNDLE_JOBS: 4
|
|
147
156
|
BUNDLE_RETRY: 3
|
|
148
157
|
|
|
@@ -162,7 +171,7 @@ jobs:
|
|
|
162
171
|
|
|
163
172
|
- run:
|
|
164
173
|
name: Install Bundle Dependencies
|
|
165
|
-
command: bin/bundle check
|
|
174
|
+
command: bin/bundle check || bin/bundle install
|
|
166
175
|
|
|
167
176
|
- run:
|
|
168
177
|
name: Install Node Packages
|
|
@@ -178,7 +187,7 @@ jobs:
|
|
|
178
187
|
|
|
179
188
|
upgrade_tools:
|
|
180
189
|
docker:
|
|
181
|
-
- image: cimg/ruby:
|
|
190
|
+
- image: cimg/ruby:3.0-node
|
|
182
191
|
environment:
|
|
183
192
|
DISABLE_SPRING: 1
|
|
184
193
|
BUNDLE_GEMFILE: Gemfile.tools
|
data/lib/install/.gitattributes
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
*.rb diff=ruby
|
|
4
4
|
*.js diff=javascript
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
db/schema.rb merge=ours diff=ruby
|
|
7
|
+
yarn.lock merge=ours
|
|
8
|
+
Gemfile.lock merge=ours
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
vendor/* linguist-vendored
|
data/lib/install/.rubocop.yml
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
---
|
|
2
2
|
require:
|
|
3
|
-
-
|
|
3
|
+
- rubocop-minitest
|
|
4
4
|
- rubocop-rails
|
|
5
|
+
- rubocop-performance
|
|
6
|
+
- standard
|
|
5
7
|
|
|
6
8
|
inherit_gem:
|
|
7
9
|
standard: config/base.yml
|
|
8
10
|
|
|
9
11
|
AllCops:
|
|
10
|
-
|
|
12
|
+
NewCops: enable
|
|
13
|
+
TargetRubyVersion: 3.0
|
|
11
14
|
|
|
12
15
|
Exclude:
|
|
16
|
+
- 'bin/**/*'
|
|
13
17
|
- 'db/migrate/**/*'
|
|
14
18
|
- 'db/schema.rb'
|
|
15
19
|
- 'vendor/**/*'
|
|
@@ -63,6 +67,13 @@ Naming/PredicateName:
|
|
|
63
67
|
Exclude:
|
|
64
68
|
- 'app/helpers/application_helper.rb'
|
|
65
69
|
|
|
70
|
+
Standard/SemanticBlocks:
|
|
71
|
+
Enabled: false
|
|
72
|
+
|
|
73
|
+
Style/BlockDelimiters:
|
|
74
|
+
Enabled: true
|
|
75
|
+
EnforcedStyle: braces_for_chaining
|
|
76
|
+
|
|
66
77
|
Style/ClassAndModuleChildren:
|
|
67
78
|
Exclude:
|
|
68
79
|
- 'test/**/*.rb'
|
|
@@ -70,23 +81,15 @@ Style/ClassAndModuleChildren:
|
|
|
70
81
|
Style/Documentation:
|
|
71
82
|
Enabled: false
|
|
72
83
|
|
|
73
|
-
Style/ExponentialNotation:
|
|
74
|
-
Enabled: true
|
|
75
|
-
|
|
76
84
|
Style/FrozenStringLiteralComment:
|
|
77
85
|
Enabled: true
|
|
78
86
|
|
|
79
87
|
Style/HashEachMethods:
|
|
80
88
|
Enabled: true
|
|
81
89
|
|
|
82
|
-
Style/
|
|
83
|
-
Enabled: true
|
|
84
|
-
|
|
85
|
-
Style/HashTransformValues:
|
|
86
|
-
Enabled: true
|
|
87
|
-
|
|
88
|
-
Style/SlicingWithRange:
|
|
90
|
+
Style/StringLiterals:
|
|
89
91
|
Enabled: true
|
|
92
|
+
EnforcedStyle: single_quotes
|
|
90
93
|
|
|
91
94
|
# Rails
|
|
92
95
|
|
data/lib/install/.simplecov
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
if defined?(Spring) && ENV[
|
|
4
|
-
puts
|
|
5
|
-
puts
|
|
3
|
+
if defined?(Spring) && ENV['DISABLE_SPRING'].nil?
|
|
4
|
+
puts '**** NO COVERAGE FOR YOU! ****'
|
|
5
|
+
puts 'Please disable Spring to get COVERAGE by `DISABLE_SPRING=1 COVERAGE=1 bin/rspec`'
|
|
6
6
|
else
|
|
7
|
-
SimpleCov.start
|
|
7
|
+
SimpleCov.start 'rails' do
|
|
8
8
|
add_filter %w[app/views bin spec test]
|
|
9
9
|
|
|
10
10
|
maximum_coverage_drop 0.5
|
|
11
11
|
end
|
|
12
12
|
|
|
13
|
-
if ENV[
|
|
14
|
-
require
|
|
13
|
+
if ENV['CODECOV_TOKEN']
|
|
14
|
+
require 'codecov'
|
|
15
15
|
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
|
16
16
|
end
|
|
17
17
|
end
|
data/lib/install/Brewfile
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
tap
|
|
3
|
+
tap 'heroku/brew'
|
|
4
4
|
|
|
5
|
-
brew
|
|
6
|
-
brew
|
|
7
|
-
brew
|
|
8
|
-
brew
|
|
9
|
-
brew
|
|
10
|
-
brew
|
|
11
|
-
brew
|
|
12
|
-
brew
|
|
13
|
-
brew
|
|
14
|
-
brew
|
|
5
|
+
brew 'circleci'
|
|
6
|
+
brew 'graphicsmagick' # For ActiveStorage
|
|
7
|
+
brew 'heroku'
|
|
8
|
+
brew 'hub' # For creating Pull Request from CLI
|
|
9
|
+
brew 'postgresql'
|
|
10
|
+
brew 'rbenv'
|
|
11
|
+
brew 'ruby-build'
|
|
12
|
+
brew 'vips' # For ActiveStorage
|
|
13
|
+
brew 'yamllint' # For Linters
|
|
14
|
+
brew 'yarn'
|
data/lib/install/Gemfile.tools
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
1
|
source 'https://rubygems.org'
|
|
4
2
|
|
|
5
3
|
git_source(:github) do |repo_name|
|
|
@@ -10,19 +8,22 @@ end
|
|
|
10
8
|
gem 'oj'
|
|
11
9
|
|
|
12
10
|
group :tools do
|
|
13
|
-
gem 'pronto'
|
|
11
|
+
gem 'pronto', require: false
|
|
14
12
|
gem 'pronto-blacklist', require: false
|
|
15
13
|
gem 'pronto-erb_lint', require: false
|
|
16
14
|
gem 'pronto-eslint_npm', require: false
|
|
17
15
|
gem 'pronto-fasterer', require: false
|
|
18
16
|
gem 'pronto-rails_best_practices', require: false
|
|
19
17
|
gem 'pronto-reek', require: false
|
|
20
|
-
gem 'pronto-rubocop', require: false
|
|
18
|
+
gem 'pronto-rubocop', require: false, github: 'prontolabs/pronto-rubocop'
|
|
21
19
|
# gem 'pronto-standardrb', require: false
|
|
22
20
|
gem 'pronto-yamllint', require: false
|
|
23
21
|
|
|
24
|
-
|
|
22
|
+
gem 'rubocop-performance', require: false
|
|
25
23
|
gem 'rubocop-rails', require: false
|
|
26
|
-
|
|
24
|
+
gem 'rubocop-minitest', require: false
|
|
25
|
+
|
|
27
26
|
gem 'standard', '>= 0.4.7', require: false
|
|
27
|
+
# gem 'pronto-standardrb', require: false
|
|
28
|
+
# gem 'rubocop-rspec', require: false
|
|
28
29
|
end
|
data/lib/install/app.json
CHANGED
data/lib/install/bin/tools-setup
CHANGED
data/lib/jt_tools.rb
CHANGED
data/lib/jt_tools/railtie.rb
CHANGED
data/lib/jt_tools/version.rb
CHANGED
data/lib/tasks/install.rake
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
install_template_path = File.expand_path(
|
|
4
|
-
bin_path = ENV[
|
|
3
|
+
install_template_path = File.expand_path('../../template.rb', __dir__).freeze
|
|
4
|
+
bin_path = ENV['BUNDLE_BIN'] || './bin'
|
|
5
5
|
|
|
6
6
|
namespace :jt_tools do
|
|
7
|
-
desc
|
|
7
|
+
desc 'Install jt-tools in this application'
|
|
8
8
|
task install: :environment do
|
|
9
9
|
exec "#{RbConfig.ruby} #{bin_path}/rails app:template LOCATION=#{install_template_path}"
|
|
10
10
|
end
|
data/rejuvenation.rb
CHANGED
|
@@ -1,17 +1,19 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'json'
|
|
2
4
|
|
|
3
5
|
EXTRACT_DEPENDENCY_NAME = /"?(.+?)@.+?"?(?:,\s+|\Z)/.freeze
|
|
4
6
|
EXTRACT_DEPENDENCY_DETAILS = /(^((?!= ).*?):\n.*?(?:\n\n|\Z))/m.freeze
|
|
5
7
|
|
|
6
8
|
def direct_dependencies_names
|
|
7
|
-
package_json = JSON.parse(File.open(
|
|
8
|
-
direct_dependencies = package_json.fetch_values(
|
|
9
|
+
package_json = JSON.parse(File.open('package.json').read)
|
|
10
|
+
direct_dependencies = package_json.fetch_values('dependencies', 'devDependencies', 'peerDependencies') {}
|
|
9
11
|
direct_dependencies.compact.inject([]) { |memo, v| memo.concat(v.keys) }
|
|
10
12
|
end
|
|
11
13
|
|
|
12
14
|
@dependencies = direct_dependencies_names
|
|
13
15
|
|
|
14
|
-
yarn_lock_content = File.open(
|
|
16
|
+
yarn_lock_content = File.open('yarn.lock').read
|
|
15
17
|
yarn_lock_content.scan(EXTRACT_DEPENDENCY_DETAILS).each do |dependency_block|
|
|
16
18
|
direct_dep = @dependencies.include?(dependency_block[1].match(EXTRACT_DEPENDENCY_NAME).to_a[1])
|
|
17
19
|
puts dependency_block[0] if direct_dep
|
data/template.rb
CHANGED
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
# In that case, use `git clone` to download them to a local temporary dir.
|
|
8
8
|
def add_template_repository_to_source_path
|
|
9
9
|
if __FILE__.match?(%r{\Ahttps?://})
|
|
10
|
-
require
|
|
11
|
-
require
|
|
10
|
+
require 'shellwords'
|
|
11
|
+
require 'tmpdir'
|
|
12
12
|
|
|
13
|
-
source_paths.unshift(temp_dir = Dir.mktmpdir(
|
|
13
|
+
source_paths.unshift(temp_dir = Dir.mktmpdir('jt_tools-'))
|
|
14
14
|
at_exit { FileUtils.remove_entry(temp_dir) }
|
|
15
15
|
git clone: [
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
'--quiet',
|
|
17
|
+
'https://github.com/jetthoughts/jt_tools.git',
|
|
18
18
|
temp_dir
|
|
19
19
|
].map { |args| Shellwords.escape(args) }
|
|
20
|
-
.join(
|
|
20
|
+
.join(' ')
|
|
21
21
|
|
|
22
22
|
if (branch = __FILE__[%r{jt_tools/(.+)/template.rb}, 1])
|
|
23
23
|
Dir.chdir(temp_dir) { git checkout: branch }
|
|
@@ -29,107 +29,123 @@ def add_template_repository_to_source_path
|
|
|
29
29
|
|
|
30
30
|
add_template_repository_to_source_path
|
|
31
31
|
|
|
32
|
-
say
|
|
33
|
-
directory
|
|
32
|
+
say '=> Copying binstubs'
|
|
33
|
+
directory 'lib/install/bin', 'bin'
|
|
34
34
|
|
|
35
|
-
chmod
|
|
35
|
+
chmod 'bin', 0o755 & ~File.umask, verbose: false
|
|
36
36
|
|
|
37
|
-
say
|
|
38
|
-
copy_file
|
|
37
|
+
say '=> Copying tools gemfile'
|
|
38
|
+
copy_file 'lib/install/Gemfile.tools', 'Gemfile.tools'
|
|
39
39
|
|
|
40
|
-
run
|
|
40
|
+
run 'yarn add -D eslint jest-junit'
|
|
41
41
|
|
|
42
|
-
say
|
|
43
|
-
copy_file
|
|
44
|
-
copy_file
|
|
45
|
-
copy_file
|
|
46
|
-
copy_file
|
|
47
|
-
copy_file
|
|
48
|
-
copy_file
|
|
49
|
-
copy_file
|
|
50
|
-
copy_file
|
|
51
|
-
copy_file
|
|
52
|
-
copy_file
|
|
42
|
+
say 'Copying lint configurations'
|
|
43
|
+
copy_file 'lib/install/.better-html.yml', '.better-html.yml'
|
|
44
|
+
copy_file 'lib/install/.erb-lint.yml', '.erb-lint.yml'
|
|
45
|
+
copy_file 'lib/install/.eslintrc.js', '.eslintrc.js'
|
|
46
|
+
copy_file 'lib/install/.pronto.yml', '.pronto.yml'
|
|
47
|
+
copy_file 'lib/install/.pronto_eslint_npm.yml', '.pronto_eslint_npm.yml'
|
|
48
|
+
copy_file 'lib/install/.rubocop.yml', '.rubocop.yml'
|
|
49
|
+
copy_file 'lib/install/.yamllint.yml', '.yamllint.yml'
|
|
50
|
+
copy_file 'lib/install/.reek.yml', '.reek.yml'
|
|
51
|
+
copy_file 'lib/install/config/rails_best_practices.yml', 'config/rails_best_practices.yml'
|
|
52
|
+
copy_file 'lib/install/.editorconfig', '.editorconfig'
|
|
53
53
|
|
|
54
|
-
say
|
|
55
|
-
copy_file
|
|
56
|
-
copy_file
|
|
54
|
+
say '=> Copying services configuration'
|
|
55
|
+
copy_file 'lib/install/.simplecov', '.simplecov'
|
|
56
|
+
copy_file 'lib/install/codecov.yml', 'codecov.yml'
|
|
57
57
|
|
|
58
|
-
say
|
|
58
|
+
say '=> Adds service client API gems'
|
|
59
59
|
|
|
60
60
|
gem_group :test do
|
|
61
|
-
gem
|
|
62
|
-
gem
|
|
61
|
+
gem 'simplecov', require: false, group: :test
|
|
62
|
+
gem 'codecov', require: false, group: :test
|
|
63
|
+
gem 'rexml', require: false, group: :test # for hot fix of webdrivers and ruby 3
|
|
63
64
|
end
|
|
64
65
|
|
|
65
|
-
gem
|
|
66
|
+
gem 'oj'
|
|
66
67
|
|
|
67
68
|
gem_group :production, :staging do
|
|
68
|
-
gem
|
|
69
|
-
gem
|
|
70
|
-
gem
|
|
69
|
+
gem 'dalli'
|
|
70
|
+
gem 'r7insight'
|
|
71
|
+
gem 'rollbar'
|
|
71
72
|
end
|
|
72
73
|
|
|
73
|
-
directory
|
|
74
|
+
directory 'lib/install/.circleci', '.circleci'
|
|
74
75
|
|
|
75
|
-
if File.read(
|
|
76
|
-
gem
|
|
76
|
+
if File.read('Gemfile').include? 'rspec'
|
|
77
|
+
gem 'rspec_junit_formatter', require: false, group: :test
|
|
77
78
|
insert_into_file(
|
|
78
|
-
|
|
79
|
+
'spec/spec_helper.rb',
|
|
79
80
|
"require 'simplecov' if ENV['COVERAGE']\n",
|
|
80
81
|
after: /\A/
|
|
81
82
|
)
|
|
82
83
|
insert_into_file(
|
|
83
|
-
|
|
84
|
-
"\n"
|
|
85
|
-
|
|
84
|
+
'.circleci/config.yml',
|
|
85
|
+
"\n" \
|
|
86
|
+
' - run: bin/rspec --format RspecJunitFormatter --out tmp/reports/rspec-results.xml --format progress',
|
|
87
|
+
after: '# rails test'
|
|
86
88
|
)
|
|
87
89
|
else
|
|
88
|
-
gem
|
|
90
|
+
gem 'minitest-ci', require: false, group: :test
|
|
89
91
|
insert_into_file(
|
|
90
|
-
|
|
92
|
+
'test/test_helper.rb',
|
|
91
93
|
"require 'simplecov' if ENV['COVERAGE']\n",
|
|
92
94
|
after: /\A/
|
|
93
95
|
)
|
|
94
96
|
insert_into_file(
|
|
95
|
-
|
|
97
|
+
'.circleci/config.yml',
|
|
96
98
|
"\n" + ' - run: bin/rails test "test/**/*_test.rb"',
|
|
97
|
-
after:
|
|
99
|
+
after: '# rails test'
|
|
98
100
|
)
|
|
99
101
|
|
|
100
|
-
gsub_file
|
|
101
|
-
|
|
102
|
+
gsub_file 'test/test_helper.rb',
|
|
103
|
+
'parallelize(workers: :number_of_processors)',
|
|
102
104
|
"parallelize(workers: :number_of_processors) unless ENV['COVERAGE']"
|
|
103
105
|
end
|
|
104
106
|
|
|
105
|
-
say
|
|
106
|
-
directory
|
|
107
|
-
|
|
107
|
+
say '=> Copying git configuration'
|
|
108
|
+
directory 'lib/install/.github', '.github'
|
|
109
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('6.1.0')
|
|
110
|
+
gitattributes = <<~GITATTRIBUTES
|
|
111
|
+
*.gemspec diff=ruby
|
|
112
|
+
*.rake diff=ruby
|
|
113
|
+
*.rb diff=ruby
|
|
114
|
+
*.js diff=javascript
|
|
115
|
+
|
|
116
|
+
db/schema.rb merge=ours diff=ruby
|
|
117
|
+
yarn.lock merge=ours
|
|
118
|
+
Gemfile.lock merge=ours linguist-generated
|
|
119
|
+
GITATTRIBUTES
|
|
120
|
+
insert_into_file '.gitattributes', gitattributes
|
|
121
|
+
else
|
|
122
|
+
copy_file 'lib/install/.gitattributes', '.gitattributes'
|
|
123
|
+
end
|
|
108
124
|
|
|
109
|
-
say
|
|
110
|
-
copy_file
|
|
111
|
-
copy_file
|
|
125
|
+
say '=> Copying heroku configuration'
|
|
126
|
+
copy_file 'lib/install/app.json', 'app.json'
|
|
127
|
+
copy_file 'lib/install/Procfile', 'Procfile'
|
|
112
128
|
|
|
113
|
-
say
|
|
114
|
-
copy_file
|
|
129
|
+
say '=> Install Brew dependencies'
|
|
130
|
+
copy_file 'lib/install/Brewfile', 'Brewfile'
|
|
115
131
|
|
|
116
|
-
say
|
|
117
|
-
directory
|
|
132
|
+
say 'Setup git hooks'
|
|
133
|
+
directory 'lib/install/bin/git-hooks', 'bin/git-hooks'
|
|
118
134
|
|
|
119
|
-
require
|
|
135
|
+
require 'bundler'
|
|
120
136
|
Bundler.with_original_env do
|
|
121
|
-
say
|
|
122
|
-
run
|
|
137
|
+
say '=> Install tools'
|
|
138
|
+
run 'bin/tools-setup'
|
|
123
139
|
|
|
124
|
-
say
|
|
125
|
-
run
|
|
126
|
-
run
|
|
127
|
-
run
|
|
140
|
+
say '=> Generate binstubs for linters'
|
|
141
|
+
run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force pronto'
|
|
142
|
+
run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force rubocop'
|
|
143
|
+
run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force standard'
|
|
128
144
|
end
|
|
129
145
|
|
|
130
|
-
say
|
|
131
|
-
run
|
|
132
|
-
say
|
|
146
|
+
say '=> Set git hooks'
|
|
147
|
+
run 'git config core.hooksPath ./bin/git-hooks'
|
|
148
|
+
say '=> Install all new dependencies'
|
|
133
149
|
|
|
134
150
|
run <<~BREW_INSTALL
|
|
135
151
|
hash brew 2> /dev/null \
|
|
@@ -137,29 +153,32 @@ def add_template_repository_to_source_path
|
|
|
137
153
|
|| echo "Please install Homebrew: https://brew.sh/"
|
|
138
154
|
BREW_INSTALL
|
|
139
155
|
|
|
140
|
-
say
|
|
141
|
-
uncomment_lines
|
|
156
|
+
say '=> Update development config'
|
|
157
|
+
uncomment_lines(
|
|
158
|
+
'config/environments/development.rb',
|
|
159
|
+
/config\.file_watcher = ActiveSupport::EventedFileUpdateChecker/
|
|
160
|
+
)
|
|
142
161
|
|
|
143
|
-
say
|
|
162
|
+
say '=> Set up R7Insight'
|
|
144
163
|
r7insight_config = <<-CODE
|
|
145
164
|
if ENV['R7INSIGHT_TOKEN'].present?
|
|
146
165
|
Rails.logger = R7Insight.new(ENV['R7INSIGHT_TOKEN'], ENV['R7INSIGHT_REGION'])
|
|
147
166
|
end
|
|
148
167
|
CODE
|
|
149
|
-
insert_into_file
|
|
168
|
+
insert_into_file 'config/environments/production.rb',
|
|
150
169
|
"require 'r7_insight.rb'" + "\n\n",
|
|
151
|
-
before:
|
|
152
|
-
environment(r7insight_config, env:
|
|
153
|
-
if File.exist?(
|
|
154
|
-
insert_into_file
|
|
170
|
+
before: 'Rails.application.configure do'
|
|
171
|
+
environment(r7insight_config, env: 'production')
|
|
172
|
+
if File.exist?('config/environments/staging.rb')
|
|
173
|
+
insert_into_file 'config/environments/staging.rb',
|
|
155
174
|
"require 'r7_insight.rb'" + "\n\n",
|
|
156
|
-
before:
|
|
157
|
-
environment(r7insight_config, env:
|
|
175
|
+
before: 'Rails.application.configure do'
|
|
176
|
+
environment(r7insight_config, env: 'staging')
|
|
158
177
|
end
|
|
159
178
|
|
|
160
|
-
gem
|
|
179
|
+
gem 'connection_pool'
|
|
161
180
|
|
|
162
|
-
say
|
|
181
|
+
say '=> Set up Memcachier'
|
|
163
182
|
memcachier_config = <<-CODE
|
|
164
183
|
if ENV["MEMCACHIER_SERVERS"]
|
|
165
184
|
config.cache_store = :mem_cache_store,
|
|
@@ -171,40 +190,42 @@ def add_template_repository_to_source_path
|
|
|
171
190
|
end
|
|
172
191
|
|
|
173
192
|
CODE
|
|
174
|
-
environment(memcachier_config, env:
|
|
175
|
-
if File.exist?(
|
|
176
|
-
environment(memcachier_config, env:
|
|
193
|
+
environment(memcachier_config, env: 'production')
|
|
194
|
+
if File.exist?('config/environments/staging.rb')
|
|
195
|
+
environment(memcachier_config, env: 'staging')
|
|
177
196
|
end
|
|
178
197
|
|
|
179
198
|
Bundler.with_original_env do
|
|
180
|
-
say
|
|
181
|
-
run
|
|
182
|
-
run
|
|
199
|
+
say '=> Setup default bundle config'
|
|
200
|
+
run 'bundle config jobs 4'
|
|
201
|
+
run 'bundle config retry 3'
|
|
202
|
+
|
|
203
|
+
run 'bundle'
|
|
183
204
|
|
|
184
|
-
run
|
|
205
|
+
run 'bundle lock --add-platform x86_64-linux'
|
|
185
206
|
end
|
|
186
207
|
|
|
187
|
-
uncomment_lines
|
|
208
|
+
uncomment_lines 'bin/setup', /system\(.*?\\byarn\b/
|
|
188
209
|
|
|
189
210
|
insert_into_file(
|
|
190
|
-
|
|
191
|
-
"system!
|
|
192
|
-
after: "system!
|
|
211
|
+
'bin/setup',
|
|
212
|
+
"system! 'bin/tools-setup'\n",
|
|
213
|
+
after: "system! 'gem install bundler --conservative'\n"
|
|
193
214
|
)
|
|
194
215
|
|
|
195
|
-
say
|
|
196
|
-
say
|
|
197
|
-
say
|
|
198
|
-
say
|
|
199
|
-
say
|
|
200
|
-
say
|
|
201
|
-
say
|
|
202
|
-
say
|
|
203
|
-
say
|
|
204
|
-
say
|
|
205
|
-
say
|
|
206
|
-
say
|
|
207
|
-
say
|
|
208
|
-
say
|
|
209
|
-
say
|
|
210
|
-
say
|
|
216
|
+
say '**************************************************************************'
|
|
217
|
+
say '**************************************************************************'
|
|
218
|
+
say ''
|
|
219
|
+
say '1. Recommended Heroku Addons: Mailtrap, Rollbar, Cloudinary'
|
|
220
|
+
say ''
|
|
221
|
+
say '2. Setup Git Hooks to auto-check code and cleanup staled branches:'
|
|
222
|
+
say '$ `git config core.hooksPath bin/git-hooks`'
|
|
223
|
+
say ''
|
|
224
|
+
say '3. Please, set CODECOV_TOKEN, GITHUB_TOKEN and PRONTO_GITHUB_ACCESS_TOKEN'
|
|
225
|
+
say 'environment variables in CircleCI and your local env'
|
|
226
|
+
say ''
|
|
227
|
+
say ' For code coverage report aggregator, running code static analysis'
|
|
228
|
+
say 'and auto-update of the tools.'
|
|
229
|
+
say ''
|
|
230
|
+
say '**************************************************************************'
|
|
231
|
+
say '**************************************************************************'
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jt_tools
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.15
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Paul Keen
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2021-01-01 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: railties
|
|
@@ -37,7 +37,9 @@ files:
|
|
|
37
37
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
|
38
38
|
- ".github/ISSUE_TEMPLATE/custom.md"
|
|
39
39
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
|
40
|
+
- ".github/workflows/test.yml"
|
|
40
41
|
- ".gitignore"
|
|
42
|
+
- ".rubocop.yml"
|
|
41
43
|
- ".standard.yml"
|
|
42
44
|
- Gemfile
|
|
43
45
|
- LICENSE
|
|
@@ -45,7 +47,9 @@ files:
|
|
|
45
47
|
- README.md
|
|
46
48
|
- Rakefile
|
|
47
49
|
- _config.yml
|
|
48
|
-
- bin/
|
|
50
|
+
- bin/ci-test
|
|
51
|
+
- bin/lint
|
|
52
|
+
- bin/rubocop
|
|
49
53
|
- bin/test
|
|
50
54
|
- jt_tools.gemspec
|
|
51
55
|
- lib/install/.better-html.yml
|
|
@@ -105,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
105
109
|
- !ruby/object:Gem::Version
|
|
106
110
|
version: '0'
|
|
107
111
|
requirements: []
|
|
108
|
-
rubygems_version: 3.
|
|
112
|
+
rubygems_version: 3.2.4
|
|
109
113
|
signing_key:
|
|
110
114
|
specification_version: 4
|
|
111
115
|
summary: Setup development scripts to manage code base effectively
|
data/bin/standardrb
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env ruby
|
|
2
|
-
# frozen_string_literal: true
|
|
3
|
-
|
|
4
|
-
#
|
|
5
|
-
# This file was generated by Bundler.
|
|
6
|
-
#
|
|
7
|
-
# The application 'standardrb' is installed as part of a gem, and
|
|
8
|
-
# this file is here to facilitate running it.
|
|
9
|
-
#
|
|
10
|
-
|
|
11
|
-
require "pathname"
|
|
12
|
-
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
|
|
13
|
-
Pathname.new(__FILE__).realpath)
|
|
14
|
-
|
|
15
|
-
bundle_binstub = File.expand_path("../bundle", __FILE__)
|
|
16
|
-
|
|
17
|
-
if File.file?(bundle_binstub)
|
|
18
|
-
if File.read(bundle_binstub, 300) =~ /This file was generated by Bundler/
|
|
19
|
-
load(bundle_binstub)
|
|
20
|
-
else
|
|
21
|
-
abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
|
|
22
|
-
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
|
|
23
|
-
end
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
require "rubygems"
|
|
27
|
-
require "bundler/setup"
|
|
28
|
-
|
|
29
|
-
load Gem.bin_path("standard", "standardrb")
|