biscuit-rails 0.2.0 → 0.2.1
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/CHANGELOG.md +16 -0
- data/lib/biscuit/version.rb +1 -1
- data/lib/generators/biscuit/install/templates/SKILL.md +17 -8
- 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: 1eacb49f37fb2acc7796bd6574367af55d9428d4b3d83c69420a12f6c2856359
|
|
4
|
+
data.tar.gz: 22d3e98312498def4e3c0420448b1698a0fa123891dfe5e32237e90494760115
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88015405e5c6ef0cc3cdbd927008e59fa0717660c645aca958ce88bb7ebef09dc994f23a316c0b68eb129765b72847bb52cd7fef7c8e96f1b8d4e12658faea50
|
|
7
|
+
data.tar.gz: 57993714ad02872a2e6b84b489db819a52ce6f9c6fb427fd9a08434ac2e9494e400810ba48e416e908a5640859b193f361d8a17a3476be4fff6d0e6584eef9c5
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [0.2.1] - 2026-04-02
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- `biscuit-install` skill: add Sprockets manifest step — when not using Propshaft,
|
|
13
|
+
`biscuit/biscuit.css` and `biscuit/biscuit_controller.js` must be linked in
|
|
14
|
+
`app/assets/config/manifest.js` or they 404 in test and production
|
|
15
|
+
- `biscuit-install` skill: fix integration test POST syntax — `body:` is not a valid
|
|
16
|
+
Rails integration test keyword; replaced with `params: { ... }.to_json` and explicit
|
|
17
|
+
`Content-Type`/`Accept` headers
|
|
18
|
+
- `biscuit-install` skill: explain why the Stimulus controller must be registered
|
|
19
|
+
manually (`eagerLoadControllersFrom` only discovers controllers in
|
|
20
|
+
`app/javascript/controllers/`, not gem-provided ones)
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
8
24
|
## [0.2.0] - 2026-03-31
|
|
9
25
|
|
|
10
26
|
### Added
|
data/lib/biscuit/version.rb
CHANGED
|
@@ -100,6 +100,8 @@ application.register("biscuit", BiscuitController)
|
|
|
100
100
|
|
|
101
101
|
Ensure `application` is already imported at the top of that file (it will be in the standard Rails 8 scaffold).
|
|
102
102
|
|
|
103
|
+
The explicit import is required because Rails' `eagerLoadControllersFrom` only auto-discovers controllers under `app/javascript/controllers/` — it cannot find controllers provided by gems, so they must always be registered manually.
|
|
104
|
+
|
|
103
105
|
### If using esbuild / jsbundling
|
|
104
106
|
|
|
105
107
|
The same import and register lines apply, but inform the user that `@hotwired/stimulus` must be marked as external in their esbuild config so it is not bundled twice:
|
|
@@ -126,6 +128,15 @@ If the app uses `reload_on_consent: true` (from Step 4), use:
|
|
|
126
128
|
<%= biscuit_banner(reload_on_consent: true) %>
|
|
127
129
|
```
|
|
128
130
|
|
|
131
|
+
### Sprockets manifest (if not using Propshaft)
|
|
132
|
+
|
|
133
|
+
If the app uses Sprockets (no `propshaft` in Gemfile), check whether `app/assets/config/manifest.js` exists. If it does, append these two lines if they are not already present — otherwise the stylesheet and JS file will 404 in test and production:
|
|
134
|
+
|
|
135
|
+
```js
|
|
136
|
+
//= link biscuit/biscuit.css
|
|
137
|
+
//= link biscuit/biscuit_controller.js
|
|
138
|
+
```
|
|
139
|
+
|
|
129
140
|
---
|
|
130
141
|
|
|
131
142
|
## Step 7 — Cookie and tracking script audit
|
|
@@ -209,20 +220,18 @@ class BiscuitConsentTest < ActionDispatch::IntegrationTest
|
|
|
209
220
|
end
|
|
210
221
|
|
|
211
222
|
test "accept all sets consent cookie" do
|
|
212
|
-
post "/biscuit/consent",
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
body: { categories: { analytics: true, marketing: true } }.to_json
|
|
223
|
+
post "/biscuit/consent",
|
|
224
|
+
params: { categories: { analytics: true, marketing: true } }.to_json,
|
|
225
|
+
headers: { "Content-Type" => "application/json", "Accept" => "application/json" }
|
|
216
226
|
assert_response :success
|
|
217
227
|
assert Biscuit::Consent.new(cookies).given?
|
|
218
228
|
assert Biscuit::Consent.new(cookies).allowed?(:analytics)
|
|
219
229
|
end
|
|
220
230
|
|
|
221
231
|
test "reject all sets non-required categories to false" do
|
|
222
|
-
post "/biscuit/consent",
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
body: { categories: { analytics: false, marketing: false } }.to_json
|
|
232
|
+
post "/biscuit/consent",
|
|
233
|
+
params: { categories: { analytics: false, marketing: false } }.to_json,
|
|
234
|
+
headers: { "Content-Type" => "application/json", "Accept" => "application/json" }
|
|
226
235
|
assert_response :success
|
|
227
236
|
assert Biscuit::Consent.new(cookies).given?
|
|
228
237
|
assert_equal false, Biscuit::Consent.new(cookies).allowed?(:analytics)
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: biscuit-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Gareth James
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2026-
|
|
10
|
+
date: 2026-04-02 00:00:00.000000000 Z
|
|
11
11
|
dependencies:
|
|
12
12
|
- !ruby/object:Gem::Dependency
|
|
13
13
|
name: rails
|