jt_tools 0.0.5 → 0.0.10
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 +24 -6
- data/.gitignore +1 -0
- data/.standard.yml +10 -0
- data/Gemfile +4 -1
- data/README.md +1 -0
- data/Rakefile +5 -5
- data/bin/standardrb +29 -0
- data/bin/test +20 -13
- data/jt_tools.gemspec +14 -14
- data/lib/install/.circleci/config.yml +31 -15
- data/lib/install/.editorconfig +1 -232
- data/lib/install/.erb-lint.yml +6 -6
- data/lib/install/.reek.yml +8 -13
- data/lib/install/.rubocop.yml +15 -45
- data/lib/install/.simplecov +8 -8
- data/lib/install/Brewfile +11 -13
- data/lib/install/Gemfile.tools +4 -2
- data/lib/install/app.json +19 -13
- data/lib/install/bin/circleci-auto_upgrade_tools +3 -3
- data/lib/install/bin/git-hooks/{post-merge.sample → post-merge} +5 -1
- data/lib/install/bin/git-hooks/{pre-push.sample → pre-push} +1 -1
- data/lib/install/bin/heroku-postdeploy +1 -1
- data/lib/install/bin/lint-pr +1 -1
- data/lib/install/bin/tools-setup +4 -1
- data/lib/install/bin/tools-upgrade +4 -1
- data/lib/install/config/rails_best_practices.yml +5 -5
- 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 +4 -5
- data/shipit.rubygems.yml +1 -0
- data/template.rb +120 -94
- metadata +11 -8
data/shipit.rubygems.yml
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# use defaults
|
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,119 +29,135 @@ end
|
|
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
|
-
|
59
|
-
say '=> Adds service client API gems'
|
58
|
+
say "=> Adds service client API gems"
|
60
59
|
|
61
60
|
gem_group :test do
|
62
|
-
gem
|
63
|
-
gem
|
61
|
+
gem "simplecov", require: false, group: :test
|
62
|
+
gem "codecov", require: false, group: :test
|
64
63
|
end
|
65
64
|
|
66
|
-
gem
|
65
|
+
gem "oj"
|
67
66
|
|
68
67
|
gem_group :production, :staging do
|
69
|
-
gem
|
70
|
-
gem
|
71
|
-
gem
|
68
|
+
gem "dalli"
|
69
|
+
gem "r7insight"
|
70
|
+
gem "rollbar"
|
72
71
|
end
|
73
72
|
|
74
|
-
directory
|
73
|
+
directory "lib/install/.circleci", ".circleci"
|
75
74
|
|
76
|
-
if File.read(
|
77
|
-
gem
|
75
|
+
if File.read("Gemfile").include? "rspec"
|
76
|
+
gem "rspec_junit_formatter", require: false, group: :test
|
78
77
|
insert_into_file(
|
79
|
-
|
78
|
+
"spec/spec_helper.rb",
|
80
79
|
"require 'simplecov' if ENV['COVERAGE']\n",
|
81
80
|
after: /\A/
|
82
81
|
)
|
82
|
+
insert_into_file(
|
83
|
+
".circleci/config.yml",
|
84
|
+
"\n" + " - run: bin/rspec --format RspecJunitFormatter --out tmp/reports/rspec-results.xml --format progress",
|
85
|
+
after: "# rails test"
|
86
|
+
)
|
83
87
|
else
|
84
|
-
gem
|
88
|
+
gem "minitest-ci", require: false, group: :test
|
85
89
|
insert_into_file(
|
86
|
-
|
90
|
+
"test/test_helper.rb",
|
87
91
|
"require 'simplecov' if ENV['COVERAGE']\n",
|
88
92
|
after: /\A/
|
89
93
|
)
|
94
|
+
insert_into_file(
|
95
|
+
".circleci/config.yml",
|
96
|
+
"\n" + ' - run: bin/rails test "test/**/*_test.rb"',
|
97
|
+
after: "# rails test"
|
98
|
+
)
|
99
|
+
|
100
|
+
gsub_file "test/test_helper.rb",
|
101
|
+
"parallelize(workers: :number_of_processors)",
|
102
|
+
"parallelize(workers: :number_of_processors) unless ENV['COVERAGE']"
|
90
103
|
end
|
91
104
|
|
92
|
-
directory
|
105
|
+
directory "lib/install/.dependabot", ".dependabot"
|
93
106
|
|
94
|
-
say
|
95
|
-
copy_file
|
96
|
-
copy_file
|
107
|
+
say "=> Copying heroku configuration"
|
108
|
+
copy_file "lib/install/app.json", "app.json"
|
109
|
+
copy_file "lib/install/Procfile", "Procfile"
|
97
110
|
|
98
|
-
say
|
99
|
-
copy_file
|
111
|
+
say "=> Install Brew dependencies"
|
112
|
+
copy_file "lib/install/Brewfile", "Brewfile"
|
100
113
|
|
101
|
-
say
|
102
|
-
directory
|
114
|
+
say "Setup git hooks"
|
115
|
+
directory "lib/install/bin/git-hooks", "bin/git-hooks"
|
103
116
|
|
104
|
-
require
|
117
|
+
require "bundler"
|
105
118
|
Bundler.with_original_env do
|
106
|
-
say
|
107
|
-
run
|
119
|
+
say "=> Install tools"
|
120
|
+
run "bin/tools-setup"
|
108
121
|
|
109
|
-
say
|
110
|
-
run
|
111
|
-
run
|
122
|
+
say "=> Generate binstubs for linters"
|
123
|
+
run "BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force pronto"
|
124
|
+
run "BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force rubocop"
|
125
|
+
run "BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force standard"
|
112
126
|
end
|
113
127
|
|
114
|
-
say
|
115
|
-
run
|
128
|
+
say "=> Set git hooks"
|
129
|
+
run "git config core.hooksPath ./bin/git-hooks"
|
130
|
+
say "=> Install all new dependencies"
|
116
131
|
|
117
|
-
say '=> Install all new dependencies'
|
118
132
|
run <<~BREW_INSTALL
|
119
133
|
hash brew 2> /dev/null \
|
120
|
-
&& (brew bundle check || brew bundle install) \
|
134
|
+
&& (brew bundle check || brew bundle install --no-lock) \
|
121
135
|
|| echo "Please install Homebrew: https://brew.sh/"
|
122
136
|
BREW_INSTALL
|
123
137
|
|
124
|
-
say
|
125
|
-
uncomment_lines
|
138
|
+
say "=> Update development config"
|
139
|
+
uncomment_lines "config/environments/development.rb", /config\.file_watcher = ActiveSupport::EventedFileUpdateChecker/
|
126
140
|
|
127
|
-
say
|
141
|
+
say "=> Set up R7Insight"
|
128
142
|
r7insight_config = <<-CODE
|
129
143
|
if ENV['R7INSIGHT_TOKEN'].present?
|
130
144
|
Rails.logger = R7Insight.new(ENV['R7INSIGHT_TOKEN'], ENV['R7INSIGHT_REGION'])
|
131
145
|
end
|
132
146
|
CODE
|
133
|
-
insert_into_file
|
134
|
-
|
135
|
-
|
136
|
-
environment(r7insight_config, env:
|
137
|
-
if File.exist?(
|
138
|
-
insert_into_file
|
139
|
-
|
140
|
-
|
141
|
-
environment(r7insight_config, env:
|
147
|
+
insert_into_file "config/environments/production.rb",
|
148
|
+
"require 'r7_insight.rb'" + "\n\n",
|
149
|
+
before: "Rails.application.configure do"
|
150
|
+
environment(r7insight_config, env: "production")
|
151
|
+
if File.exist?("config/environments/staging.rb")
|
152
|
+
insert_into_file "config/environments/staging.rb",
|
153
|
+
"require 'r7_insight.rb'" + "\n\n",
|
154
|
+
before: "Rails.application.configure do"
|
155
|
+
environment(r7insight_config, env: "staging")
|
142
156
|
end
|
143
157
|
|
144
|
-
|
158
|
+
gem "connection_pool"
|
159
|
+
|
160
|
+
say "=> Set up Memcachier"
|
145
161
|
memcachier_config = <<-CODE
|
146
162
|
if ENV["MEMCACHIER_SERVERS"]
|
147
163
|
config.cache_store = :mem_cache_store,
|
@@ -153,30 +169,40 @@ memcachier_config = <<-CODE
|
|
153
169
|
end
|
154
170
|
|
155
171
|
CODE
|
156
|
-
environment(memcachier_config, env:
|
157
|
-
|
172
|
+
environment(memcachier_config, env: "production")
|
173
|
+
if File.exist?("config/environments/staging.rb")
|
174
|
+
environment(memcachier_config, env: "staging")
|
175
|
+
end
|
158
176
|
|
177
|
+
Bundler.with_original_env do
|
178
|
+
say "=> Setup default bundle config"
|
179
|
+
run "bundle config jobs 4"
|
180
|
+
run "bundle config retry 3"
|
159
181
|
|
160
|
-
|
161
|
-
say '=> Setup default bundle config'
|
162
|
-
run 'bundle config jobs 4'
|
163
|
-
run 'bundle config retry 3'
|
182
|
+
run "bundle"
|
164
183
|
end
|
165
184
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
say
|
175
|
-
say
|
176
|
-
say
|
177
|
-
say
|
178
|
-
say
|
179
|
-
say
|
180
|
-
say
|
181
|
-
say
|
182
|
-
say
|
185
|
+
uncomment_lines "bin/setup", /system\(.*?\\byarn\b/
|
186
|
+
|
187
|
+
insert_into_file(
|
188
|
+
"bin/setup",
|
189
|
+
"system!('bin/tools-setup')\n",
|
190
|
+
after: "system('bundle check') || system!('bundle install')\n"
|
191
|
+
)
|
192
|
+
|
193
|
+
say "**************************************************************************"
|
194
|
+
say "**************************************************************************"
|
195
|
+
say ""
|
196
|
+
say "1. Recommended Heroku Addons: Mailtrap, Rollbar, Cloudinary"
|
197
|
+
say ""
|
198
|
+
say "2. Setup Git Hooks to auto-check code and cleanup staled branches:"
|
199
|
+
say "$ `git config core.hooksPath bin/git-hooks`"
|
200
|
+
say ""
|
201
|
+
say "3. Please, set CODECOV_TOKEN, GITHUB_TOKEN and PRONTO_GITHUB_ACCESS_TOKEN"
|
202
|
+
say "environment variables in CircleCI and your local env"
|
203
|
+
say ""
|
204
|
+
say " For code coverage report aggregator, running code static analysis"
|
205
|
+
say "and auto-update of the tools."
|
206
|
+
say ""
|
207
|
+
say "**************************************************************************"
|
208
|
+
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.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Keen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -37,12 +37,14 @@ files:
|
|
37
37
|
- ".github/ISSUE_TEMPLATE/custom.md"
|
38
38
|
- ".github/ISSUE_TEMPLATE/feature_request.md"
|
39
39
|
- ".gitignore"
|
40
|
+
- ".standard.yml"
|
40
41
|
- Gemfile
|
41
42
|
- LICENSE
|
42
43
|
- LICENSE.txt
|
43
44
|
- README.md
|
44
45
|
- Rakefile
|
45
46
|
- _config.yml
|
47
|
+
- bin/standardrb
|
46
48
|
- bin/test
|
47
49
|
- jt_tools.gemspec
|
48
50
|
- lib/install/.better-html.yml
|
@@ -62,8 +64,8 @@ files:
|
|
62
64
|
- lib/install/Procfile
|
63
65
|
- lib/install/app.json
|
64
66
|
- lib/install/bin/circleci-auto_upgrade_tools
|
65
|
-
- lib/install/bin/git-hooks/post-merge
|
66
|
-
- lib/install/bin/git-hooks/pre-push
|
67
|
+
- lib/install/bin/git-hooks/post-merge
|
68
|
+
- lib/install/bin/git-hooks/pre-push
|
67
69
|
- lib/install/bin/heroku-postdeploy
|
68
70
|
- lib/install/bin/heroku-release
|
69
71
|
- lib/install/bin/lint-pr
|
@@ -76,6 +78,7 @@ files:
|
|
76
78
|
- lib/jt_tools/version.rb
|
77
79
|
- lib/tasks/install.rake
|
78
80
|
- rejuvenation.rb
|
81
|
+
- shipit.rubygems.yml
|
79
82
|
- template.rb
|
80
83
|
homepage: https://jtway.co
|
81
84
|
licenses:
|
@@ -84,7 +87,7 @@ metadata:
|
|
84
87
|
homepage_uri: https://jtway.co
|
85
88
|
source_code_uri: https://github.com/jetthoughts/jt-tools/
|
86
89
|
changelog_uri: https://github.com/jetthoughts/jt-tools/
|
87
|
-
post_install_message:
|
90
|
+
post_install_message:
|
88
91
|
rdoc_options: []
|
89
92
|
require_paths:
|
90
93
|
- lib
|
@@ -99,8 +102,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
102
|
- !ruby/object:Gem::Version
|
100
103
|
version: '0'
|
101
104
|
requirements: []
|
102
|
-
rubygems_version: 3.1.
|
103
|
-
signing_key:
|
105
|
+
rubygems_version: 3.1.4
|
106
|
+
signing_key:
|
104
107
|
specification_version: 4
|
105
108
|
summary: Setup development scripts to manage code base effectively
|
106
109
|
test_files: []
|