fixings 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Gemfile.lock +2 -2
- data/README.md +67 -2
- data/lib/fixings/railtie.rb +2 -0
- data/lib/fixings/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30c25a80b25e3420cea8cbfd58c9d84552015b7e9c66597e5c13397e9776e1c5
|
4
|
+
data.tar.gz: 58c2a0eda5173fe518c833d724ed689feaaf9653a569e9ecb0f58120cdb98044
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d5f19ae414f2e25022d46ec64ffdcf87aa14e398b1dbb276b8ffb055ba638ad5f5cb3ed296b5b3edaeee7a357c4aade9de4ff848c59a8b1d2ada76457e20b976
|
7
|
+
data.tar.gz: afda8e8d7da97f3229f1bba1e3b6d9841d2ce3a5124d1376601b84c6ca6de467203639bfd3226798ae874921fe434cb9230cf1ea106ed9cf484d51e4dea21fe9
|
data/.rubocop.yml
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fixings (0.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.
|
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
|
-
|
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
|
-
|
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
|
{
|
data/lib/fixings/railtie.rb
CHANGED
@@ -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
|
data/lib/fixings/version.rb
CHANGED
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.
|
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-
|
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
|