fixings 0.1.1 → 0.1.2

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: a5b0bea364c71d1c9a69cd585b8051602bfbddc35af9ad20e4f6de775b9273fc
4
- data.tar.gz: 2b0350fd3db0b95b6346baa24d524b04700ad9488a1d548af722643ee67fb2b4
3
+ metadata.gz: 30c25a80b25e3420cea8cbfd58c9d84552015b7e9c66597e5c13397e9776e1c5
4
+ data.tar.gz: 58c2a0eda5173fe518c833d724ed689feaaf9653a569e9ecb0f58120cdb98044
5
5
  SHA512:
6
- metadata.gz: 11766c1a98bac0aa55504bccceb2ebadc9082e128bd8a2646edbfb490d4fd79a3e228f3484ff786fb9c4422fa2a38e1d0034f8ad2a044803faf5394e0d73649c
7
- data.tar.gz: 68b31a19870d584dd2e6ca730003d26a824402e36a01cddec184714a61692554d93b59081706049dafc6a3353ac88dd060a470c69d9aff9cf379478b7719b20d
6
+ metadata.gz: d5f19ae414f2e25022d46ec64ffdcf87aa14e398b1dbb276b8ffb055ba638ad5f5cb3ed296b5b3edaeee7a357c4aade9de4ff848c59a8b1d2ada76457e20b976
7
+ data.tar.gz: afda8e8d7da97f3229f1bba1e3b6d9841d2ce3a5124d1376601b84c6ca6de467203639bfd3226798ae874921fe434cb9230cf1ea106ed9cf484d51e4dea21fe9
data/.rubocop.yml CHANGED
@@ -4,7 +4,7 @@ AllCops:
4
4
  - "vendor/**/*"
5
5
  - "node_modules/**/*"
6
6
  - "test/scratch/**/*"
7
- TargetRubyVersion: 2.6
7
+ TargetRubyVersion: 2.7
8
8
 
9
9
  require:
10
10
  - rubocop-performance
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fixings (0.1.1)
4
+ fixings (0.1.2)
5
5
  active_record_query_trace
6
6
  annotate
7
7
  ar_transaction_changes
@@ -222,7 +222,7 @@ GEM
222
222
  rack (>= 1.1)
223
223
  rubocop (>= 0.72.0)
224
224
  ruby-progressbar (1.10.1)
225
- rufo (0.9.0)
225
+ rufo (0.10.0)
226
226
  safe_yaml (1.0.5)
227
227
  semantic_logger (4.6.0)
228
228
  concurrent-ruby (~> 1.0)
data/README.md CHANGED
@@ -25,7 +25,15 @@ inherit_gem:
25
25
  - .rubocop.yml
26
26
  ```
27
27
 
28
- And then set up the followings things in the app:
28
+ Fixings also couples tightly to the middleware structure to set request logging up properly. This requires `ActionDispatch::Session::CacheStore` and `ActionDispatch::Static` to be in the middleware stack. For a fresh Rails app, this isn't the case because of the session store. As of now, Fixings requires you use the `CacheStore` for your sessions, which is generally better than cookies for a production app anyways.
29
+
30
+ To use cache store, replace the contents of `config/initializers/session_store.rb` with
31
+
32
+ ```ruby
33
+ # frozen_string_literal: true
34
+ # Be sure to restart your server when you modify this file.
35
+ Rails.application.config.session_store(:cache_store, key: "spellcheck_#{Rails.env.to_s}_sessions")
36
+ ```
29
37
 
30
38
  #### Sentry (via sentry-raven)
31
39
 
@@ -73,11 +81,68 @@ end
73
81
 
74
82
  ```
75
83
 
84
+
85
+ #### Routes and Engine Mounts
86
+
87
+ Mount the various engines que brings along with it:
88
+
89
+ ```ruby
90
+ Rails.application.routes.draw do
91
+ # ...
92
+
93
+ health_check_routes # added by the health check gem included by fixings
94
+ mount Flipper::UI.app(Flipper) => "/flipper" # useful for administering beta flags powered by flipper
95
+ end
96
+ ```
97
+
98
+ A more complicated setup might look like this with a host constraint:
99
+
100
+ ```ruby
101
+ Rails.application.routes.draw do
102
+ health_check_routes
103
+
104
+ constraints host: Rails.configuration.x.domains.admin do
105
+ constraints AdminAuthConstraint.new do
106
+ mount Que::Web, at: "/que"
107
+ mount Flipper::UI.app(Flipper) => "/flipper"
108
+ end
109
+
110
+ mount Trestle::Engine => Trestle.config.path
111
+ end
112
+
113
+ # ...
114
+ end
115
+ ```
116
+
117
+ ## Rubocop Config
118
+
119
+ Getcher lint-y fixin's for Ruby code by putting this in `.rubocop.yml`:
120
+
121
+ ```yaml
122
+ AllCops:
123
+ Exclude:
124
+ - "bin/**/*"
125
+ - "vendor/**/*"
126
+ - "node_modules/**/*"
127
+ - "test/scratch/**/*"
128
+ TargetRubyVersion: 2.7
129
+
130
+ inherit_gem:
131
+ fixings:
132
+ - .rubocop.yml
133
+ ```
134
+
76
135
  ## JavaScript / TypeScript config
77
136
 
78
137
  We have those fixings too!
79
138
 
80
- Create `.eslintrc.js` in your project with this content:
139
+ Add the required packages:
140
+
141
+ ```
142
+ yarn add --dev @fixings/prettier-config @fixings/eslint-config
143
+ ```
144
+
145
+ Create `.eslintrc.json` in your project with this content:
81
146
 
82
147
  ```json
83
148
  {
@@ -79,6 +79,8 @@ module Fixings
79
79
  if SemanticLogger.appenders.all? { |appender| appender.instance_variable_get(:@log) != STDOUT }
80
80
  app.config.semantic_logger.add_appender(io: STDOUT, level: app.config.log_level, formatter: app.config.rails_semantic_logger.format)
81
81
  end
82
+ elsif Rails.env.test?
83
+ # Do nothing, leave appending to test.log file in place
82
84
  else
83
85
  # Use semantic_logger logging setup to log JSON to STDOUT
84
86
  app.config.rails_semantic_logger.add_file_appender = false
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Fixings
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fixings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Brundage
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-01-16 00:00:00.000000000 Z
11
+ date: 2020-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: active_record_query_trace