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.
@@ -0,0 +1 @@
1
+ # use defaults
@@ -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 'shellwords'
11
- require 'tmpdir'
10
+ require "shellwords"
11
+ require "tmpdir"
12
12
 
13
- source_paths.unshift(temp_dir = Dir.mktmpdir('jt_tools-'))
13
+ source_paths.unshift(temp_dir = Dir.mktmpdir("jt_tools-"))
14
14
  at_exit { FileUtils.remove_entry(temp_dir) }
15
15
  git clone: [
16
- '--quiet',
17
- 'https://github.com/jetthoughts/jt_tools.git',
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 '=> Copying binstubs'
33
- directory 'lib/install/bin', 'bin'
32
+ say "=> Copying binstubs"
33
+ directory "lib/install/bin", "bin"
34
34
 
35
- chmod 'bin', 0o755 & ~File.umask, verbose: false
35
+ chmod "bin", 0o755 & ~File.umask, verbose: false
36
36
 
37
- say '=> Copying tools gemfile'
38
- copy_file 'lib/install/Gemfile.tools', 'Gemfile.tools'
37
+ say "=> Copying tools gemfile"
38
+ copy_file "lib/install/Gemfile.tools", "Gemfile.tools"
39
39
 
40
- run 'yarn add -D eslint'
40
+ run "yarn add -D eslint jest-junit"
41
41
 
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'
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 '=> Copying services configuration'
55
- copy_file 'lib/install/.simplecov', '.simplecov'
56
- copy_file 'lib/install/codecov.yml', 'codecov.yml'
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 'simplecov', require: false, group: :test
63
- gem 'codecov', require: false, group: :test
61
+ gem "simplecov", require: false, group: :test
62
+ gem "codecov", require: false, group: :test
64
63
  end
65
64
 
66
- gem 'oj'
65
+ gem "oj"
67
66
 
68
67
  gem_group :production, :staging do
69
- gem 'dalli'
70
- gem 'r7insight'
71
- gem 'rollbar'
68
+ gem "dalli"
69
+ gem "r7insight"
70
+ gem "rollbar"
72
71
  end
73
72
 
74
- directory 'lib/install/.circleci', '.circleci'
73
+ directory "lib/install/.circleci", ".circleci"
75
74
 
76
- if File.read('Gemfile').include? 'rspec'
77
- gem 'rspec_junit_formatter', require: false, group: :test
75
+ if File.read("Gemfile").include? "rspec"
76
+ gem "rspec_junit_formatter", require: false, group: :test
78
77
  insert_into_file(
79
- 'spec/spec_helper.rb',
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 'minitest-ci', require: false, group: :test
88
+ gem "minitest-ci", require: false, group: :test
85
89
  insert_into_file(
86
- 'test/test_helper.rb',
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 'lib/install/.dependabot', '.dependabot'
105
+ directory "lib/install/.dependabot", ".dependabot"
93
106
 
94
- say '=> Copying heroku configuration'
95
- copy_file 'lib/install/app.json', 'app.json'
96
- copy_file 'lib/install/Procfile', 'Procfile'
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 '=> Install Brew dependencies'
99
- copy_file 'lib/install/Brewfile', 'Brewfile'
111
+ say "=> Install Brew dependencies"
112
+ copy_file "lib/install/Brewfile", "Brewfile"
100
113
 
101
- say 'Setup git hooks'
102
- directory 'lib/install/bin/git-hooks', 'bin/git-hooks'
114
+ say "Setup git hooks"
115
+ directory "lib/install/bin/git-hooks", "bin/git-hooks"
103
116
 
104
- require 'bundler'
117
+ require "bundler"
105
118
  Bundler.with_original_env do
106
- say '=> Install tools'
107
- run 'bin/tools-setup'
119
+ say "=> Install tools"
120
+ run "bin/tools-setup"
108
121
 
109
- say '=> Generate binstubs for linters'
110
- run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force pronto'
111
- run 'BUNDLE_GEMFILE=Gemfile.tools bundle binstub --force rubocop'
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 '=> Set git hooks'
115
- run 'git config core.hooksPath ./bin/git-hooks'
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 '=> Update development config'
125
- uncomment_lines 'config/environments/development.rb', /config\.file_watcher = ActiveSupport::EventedFileUpdateChecker/
138
+ say "=> Update development config"
139
+ uncomment_lines "config/environments/development.rb", /config\.file_watcher = ActiveSupport::EventedFileUpdateChecker/
126
140
 
127
- say '=> Set up R7Insight'
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 'config/environments/production.rb',
134
- "require 'r7_insight.rb'" + "\n\n",
135
- before: 'Rails.application.configure do'
136
- environment(r7insight_config, env: 'production')
137
- if File.exist?('config/environments/staging.rb')
138
- insert_into_file 'config/environments/staging.rb',
139
- "require 'r7_insight.rb'" + "\n\n",
140
- before: 'Rails.application.configure do'
141
- environment(r7insight_config, env: 'staging')
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
- say '=> Set up Memcachier'
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: 'production')
157
- environment(memcachier_config, env: 'staging') if File.exist?('config/environments/staging.rb')
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
- after_bundle do
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
- say '**************************************************************************'
167
- say '**************************************************************************'
168
- say ''
169
- say '1. Recommended Heroku Addons: Mailtrap, Rollbar, Cloudinary'
170
- say ''
171
- say '2. Setup Git Hooks to auto-check code and cleanup staled branches'
172
- say '$ `cp bin/git-hooks/pre-push.sample bin/git-hooks/pre-push`'
173
- say '$ `cp bin/git-hooks/post-merge.sample bin/git-hooks/post-merge`'
174
- say ''
175
- say '3. Please, set CODECOV_TOKEN, GITHUB_TOKEN and PRONTO_GITHUB_ACCESS_TOKEN'
176
- say 'environment variables in CircleCI and your local env'
177
- say ''
178
- say ' For code coverage report aggregator, running code static analysis'
179
- say 'and auto-update of the tools.'
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.5
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-05-21 00:00:00.000000000 Z
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.sample
66
- - lib/install/bin/git-hooks/pre-push.sample
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.3
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: []