jt_tools 0.0.4 → 0.0.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c63801c8e8fcffc02beb0dbe676efd7299b92dd6fda606ec8f34399defe1c77
4
- data.tar.gz: a89b329f0d055f5c664115b1f8cdaf18074650ce566c3507291fa70da79d3a56
3
+ metadata.gz: 79f6a271c87b4eca2f49f215466e6c2973d9c205b146b4c9f80e2d1967ea15ac
4
+ data.tar.gz: 53ff1177b284378248aeefc76863a190fdf9621c98c15650cef5e238414ba9d5
5
5
  SHA512:
6
- metadata.gz: 589c5368d864f56acd70e1128feb81b21864a806c592ffef62da0070194063911f9c67beaad4ce98f2606f1056c9dd0fec2e315a38189e30990c14e104d01ea1
7
- data.tar.gz: 2f7721a86dd0a52e40ee9d20eed1dfcd5f10da41ba89144eb5ccaabcd106b459235a4aa1e90b0b5e976be7e9f5e63d1acb78c3d9e0e3bc8afd520dcc1cbdca46
6
+ metadata.gz: 58a52a3c2c8a4b6f2e3cbf2edde9494354196e23d76ce93f00a93b5587c7b349cf000734f6a9977dcd579820336601a2e6718b1a94ad59f4a0775e5ee9c5d88e
7
+ data.tar.gz: 64d6138dff8145ed8415713fee0e42e68c833f7798c6455e41420df25a30e73e6f98197ef36c09d03b58ea5cf3977f5216ad114a367299b9c010739ee4008bcf
data/README.md CHANGED
@@ -22,6 +22,7 @@ Pre-setup for service
22
22
  * [CircleCI](https://circleci.com/)
23
23
  * [Codecov](https://codecov.io/) and [Simplecov](https://github.com/colszowka/simplecov)
24
24
  * [Dependabot](https://dependabot.com/)
25
+ * [MemCachier](https://www.memcachier.com/)
25
26
  * Code Styles:
26
27
  * [Pronto](https://jtway.co/effortless-code-review-for-pull-request-changes-241206b1cb04)
27
28
  * [Rubocop](https://github.com/rubocop-hq/rubocop)
@@ -39,7 +40,7 @@ rails app:template LOCATION=https://raw.githubusercontent.com/jetthoughts/jt_too
39
40
  Add this line to your application's Gemfile:
40
41
 
41
42
  ```ruby
42
- gem 'jt_tools', groups: [:development]
43
+ gem 'jt_tools', groups: [:development], github: 'jetthoughts/jt_tools'
43
44
  ```
44
45
 
45
46
  And then execute:
data/bin/test CHANGED
@@ -24,7 +24,7 @@ then
24
24
  else
25
25
  rails new test_tmpl --template ../template.rb --quiet --database postgresql
26
26
  cd test_tmpl
27
- bin/setup
27
+ DISABLE_SPRING=1 bin/setup
28
28
  fi
29
29
 
30
30
  echo " => Verify CircleCI config:"
@@ -6,6 +6,10 @@
6
6
 
7
7
  version: 2.1
8
8
 
9
+ orbs:
10
+ ruby: circleci/ruby@1.0.0
11
+ node: circleci/node@2.1.1
12
+
9
13
  workflows:
10
14
  version: 2
11
15
  test:
@@ -34,7 +38,7 @@ jobs:
34
38
  test:
35
39
  docker:
36
40
  # specify the version you desire here
37
- - image: circleci/ruby:2.6-node-browsers
41
+ - image: circleci/ruby:2.7-node-browsers
38
42
  environment:
39
43
  BUNDLE_GEMFILE: Gemfile
40
44
  BUNDLE_PATH: vendor/bundle
@@ -57,46 +61,14 @@ jobs:
57
61
 
58
62
  steps:
59
63
  - checkout
60
-
61
- - run:
62
- name: Install Bundler
63
- command: |
64
- echo 'export BUNDLER_VERSION=$(cat Gemfile.lock | tail -1 | tr -d " ")' >> $BASH_ENV
65
- source $BASH_ENV
66
- gem install bundler:$BUNDLER_VERSION
67
-
68
- # Download and cache dependencies
69
- - restore_cache:
70
- name: Restore Bundler Cache
71
- keys:
72
- - v1-dependencies-{{ checksum "Gemfile.lock" }}
73
- - v1-dependencies-
74
-
75
- - run:
76
- name: Install Bundler Dependencies
77
- command: bin/bundle check --path vendor/bundle || bin/bundle install --deployment
78
-
79
- - save_cache:
80
- name: Save Bundler Cache
81
- paths:
82
- - ./vendor/bundle
83
- key: v1-dependencies-{{ checksum "Gemfile.lock" }}
84
-
85
- - restore_cache:
86
- name: Restore Yarn Cache
87
- keys:
88
- - v1-yarn-dependencies-{{ checksum "yarn.lock" }}
89
- - v1-yarn-dependencies-
90
-
91
- - run:
92
- name: Install Yarn Dependencies
93
- command: bin/yarn check || bin/yarn install
94
-
95
- - save_cache:
96
- name: Save Yarn Cache
97
- paths:
98
- - ./node_modules
99
- key: v1-yarn-dependencies-{{ checksum "yarn.lock" }}
64
+ - ruby/install-deps:
65
+ bundler-version: '`cat Gemfile.lock | tail -1 | tr -d " "`'
66
+ key: v1-dependencies
67
+ - node/install-packages:
68
+ app-dir: .
69
+ pkg-manager: yarn
70
+ cache-key: yarn.lock
71
+ cache-version: v1
100
72
 
101
73
  - restore_cache:
102
74
  keys:
@@ -155,7 +127,7 @@ jobs:
155
127
  path: ./coverage
156
128
  lint:
157
129
  docker:
158
- - image: circleci/ruby:2.6-stretch-node
130
+ - image: circleci/ruby:2.7-stretch-node
159
131
  environment:
160
132
  DISABLE_SPRING: 1
161
133
  BUNDLE_GEMFILE: Gemfile.tools
@@ -192,7 +164,7 @@ jobs:
192
164
 
193
165
  upgrade_tools:
194
166
  docker:
195
- - image: circleci/ruby:2.6-stretch-node
167
+ - image: circleci/ruby:2.7-stretch-node
196
168
  environment:
197
169
  DISABLE_SPRING: 1
198
170
  BUNDLE_GEMFILE: Gemfile.tools
@@ -209,7 +181,7 @@ jobs:
209
181
  source $BASH_ENV
210
182
  gem install bundler:$BUNDLER_VERSION
211
183
 
212
- - run: sudo apt-get update && sudo apt-get install cmake yamllint python3-setuptools python3-pkg-resources
184
+ - run: sudo apt-get update && sudo apt-get install cmake yamllint python3-setuptools python3-pkg-resources
213
185
 
214
186
  - run:
215
187
  name: Run Gemfile tools update in separate branch
@@ -9,6 +9,9 @@ AllCops:
9
9
  - 'db/migrate/**/*'
10
10
  - 'db/schema.rb'
11
11
 
12
+ Layout/EmptyLinesAroundAttributeAccessor:
13
+ Enabled: true
14
+
12
15
  Layout/EmptyLinesAroundBlockBody:
13
16
  Exclude:
14
17
  - 'db/schema.rb'
@@ -39,9 +42,18 @@ Layout/MultilineOperationIndentation:
39
42
  Layout/ParameterAlignment:
40
43
  EnforcedStyle: with_fixed_indentation
41
44
 
45
+ Layout/SpaceAroundMethodCallOperator:
46
+ Enabled: true
47
+
42
48
  Layout/SpaceInLambdaLiteral:
43
49
  EnforcedStyle: require_space
44
50
 
51
+ Lint/RaiseException:
52
+ Enabled: true
53
+
54
+ Lint/StructNewOverride:
55
+ Enabled: true
56
+
45
57
  Metrics/AbcSize:
46
58
  Exclude:
47
59
  - 'test/**/*.rb'
@@ -75,12 +87,27 @@ Style/ClassAndModuleChildren:
75
87
  Style/Documentation:
76
88
  Enabled: false
77
89
 
90
+ Style/ExponentialNotation:
91
+ Enabled: true
92
+
78
93
  Style/FrozenStringLiteralComment:
79
94
  Enabled: true
80
95
 
96
+ Style/HashEachMethods:
97
+ Enabled: true
98
+
99
+ Style/HashTransformKeys:
100
+ Enabled: true
101
+
102
+ Style/HashTransformValues:
103
+ Enabled: true
104
+
81
105
  Style/SafeNavigation:
82
106
  Enabled: false
83
107
 
108
+ Style/SlicingWithRange:
109
+ Enabled: true
110
+
84
111
  Style/StabbyLambdaParentheses:
85
112
  EnforcedStyle: require_no_parentheses
86
113
 
@@ -22,4 +22,5 @@ group :tools do
22
22
 
23
23
  gem 'rubocop-performance', require: false
24
24
  gem 'rubocop-rails', require: false
25
+ gem 'better_html', '< 1.0.15'
25
26
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JtTools
4
- VERSION = '0.0.4'
4
+ VERSION = '0.0.5'
5
5
  end
data/template.rb CHANGED
@@ -66,8 +66,9 @@ end
66
66
  gem 'oj'
67
67
 
68
68
  gem_group :production, :staging do
69
+ gem 'dalli'
70
+ gem 'r7insight'
69
71
  gem 'rollbar'
70
- gem 'le'
71
72
  end
72
73
 
73
74
  directory 'lib/install/.circleci', '.circleci'
@@ -123,6 +124,39 @@ BREW_INSTALL
123
124
  say '=> Update development config'
124
125
  uncomment_lines 'config/environments/development.rb', /config\.file_watcher = ActiveSupport::EventedFileUpdateChecker/
125
126
 
127
+ say '=> Set up R7Insight'
128
+ r7insight_config = <<-CODE
129
+ if ENV['R7INSIGHT_TOKEN'].present?
130
+ Rails.logger = R7Insight.new(ENV['R7INSIGHT_TOKEN'], ENV['R7INSIGHT_REGION'])
131
+ end
132
+ 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')
142
+ end
143
+
144
+ say '=> Set up Memcachier'
145
+ memcachier_config = <<-CODE
146
+ if ENV["MEMCACHIER_SERVERS"]
147
+ config.cache_store = :mem_cache_store,
148
+ ENV["MEMCACHIER_SERVERS"].split(","), {
149
+ username: ENV["MEMCACHIER_USERNAME"], password: ENV["MEMCACHIER_PASSWORD"],
150
+ failover: true, socket_timeout: 1.5, socket_failure_delay: 0.2, down_retry_delay: 60,
151
+ pool_size: ENV.fetch("RAILS_MAX_THREADS") { 5 },
152
+ }
153
+ end
154
+
155
+ CODE
156
+ environment(memcachier_config, env: 'production')
157
+ environment(memcachier_config, env: 'staging') if File.exist?('config/environments/staging.rb')
158
+
159
+
126
160
  after_bundle do
127
161
  say '=> Setup default bundle config'
128
162
  run 'bundle config jobs 4'
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
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Keen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-19 00:00:00.000000000 Z
11
+ date: 2020-05-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties