bible270 0.6.2 → 0.6.3

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: c9baaae6c81c3923b1997672d8f13ff5edd97dba42c56f29ec86fee53c508512
4
- data.tar.gz: c564d896cd9144cee1aa4321e0cc39aa77f3197fb7a6f599045053b0fb674204
3
+ metadata.gz: caccb805f18dbe442b8608eabaec724c594c0712aec78fa7a7cbc725ca7829aa
4
+ data.tar.gz: 2c571bf6ce6812776a464787cada63c732a9fe7a53cc70921f9a4192e7fa14b2
5
5
  SHA512:
6
- metadata.gz: 0d2de30b25a9be283d994aef6db3c5743e7a3c112208eae6a3aa6b66cb45d893312cba18321f02dc240699ac774f13a9361cdb59b063c95e709cf934a0d602cc
7
- data.tar.gz: cf3908da790617444a1ef1717c533912d1303ca6c5ca32624186262964a836997639940d578eea1c7f06c61ad3dd9d00f1e23401ce3cfb8e21d8f8084d62ba21
6
+ metadata.gz: c70d8f5ec550adf89c2952fd27ec2bc0eaf43ff8c6222d38677bb54ba56838a2af7de974448dbcbf9a1c45116169c90e4e5c2a56bbe72c898953fb3961edb72c
7
+ data.tar.gz: 2df597fecea51b44334239b82c88eb9e729c51ca11d947dbc41544364e6358f8c1f41cafab3a76c16cfe35f25872ee2bcac122f5c6fd11b2e0f3a8e248eb82e8
data/CHANGELOG.md CHANGED
@@ -4,6 +4,19 @@ All notable changes to bible270. Format follows [Keep a Changelog](https://keepa
4
4
  this project uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html), treating pre-1.0 minor
5
5
  bumps as the place breaking changes may land.
6
6
 
7
+ ## [0.6.3] — 2026-07-25
8
+
9
+ ### Fixed
10
+ - **`db:migrate` failed with `ActiveRecord::DuplicateMigrationNameError`.** The engine appended its
11
+ own `db/migrate` to the host application's migration paths *and* exposed
12
+ `bible270:install:migrations`. Using the task — the documented install step — meant every
13
+ migration class was defined twice, once in the host's `db/migrate` and once in the gem. The engine
14
+ no longer touches the host's migration paths; copying via the task is the single supported path,
15
+ which also means the host owns the migrations and they appear in `schema.rb` normally.
16
+
17
+ ### Added
18
+ - `spec.email` in the gemspec.
19
+
7
20
  ## [0.6.2] — 2026-07-24
8
21
 
9
22
  ### Changed
@@ -170,6 +183,7 @@ bumps as the place breaking changes may land.
170
183
  - The schedule is pure, deterministic Ruby — no rows are stored for the plan itself; the database
171
184
  holds only readers, check-offs, and comments.
172
185
 
186
+ [0.6.3]: https://github.com/avonderluft/bible270/releases/tag/v0.6.3
173
187
  [0.6.2]: https://github.com/avonderluft/bible270/releases/tag/v0.6.2
174
188
  [0.6.1]: https://github.com/avonderluft/bible270/releases/tag/v0.6.1
175
189
  [0.6.0]: https://github.com/avonderluft/bible270/releases/tag/v0.6.0
data/README.md CHANGED
@@ -31,7 +31,9 @@ nothing copyrighted is bundled). The database only holds **readers, check-offs,
31
31
  ## Requirements & compatibility
32
32
 
33
33
  - **Ruby** >= 3.0 (the gemspec's `required_ruby_version`). The plan logic is plain Ruby with
34
- no C extensions and no dependency on any gem that Ruby 4.0 unbundled.
34
+ no C extensions and no dependency on any gem that Ruby 4.0 unbundled. Installs and loads under
35
+ Ruby 4.0.6; the test suite is exercised on 3.2 and passes with
36
+ `--enable-frozen-string-literal` forced.
35
37
  - **Ruby 4.0 notes.** Audited against the 4.0 breaking changes: the gem does not use `cgi`
36
38
  (removed from default gems in 4.0 — URL escaping goes through `URI.encode_www_form_component`
37
39
  instead, which is byte-identical to `CGI.escape`), `Set`/`SortedSet`, `Ractor`, `Net::HTTP`,
@@ -50,12 +52,22 @@ nothing copyrighted is bundled). The database only holds **readers, check-offs,
50
52
  Add to the host app's `Gemfile`:
51
53
 
52
54
  ```ruby
53
- gem "bible270", path: "vendor/gems/bible270"
54
- # or, once pushed to a git remote:
55
- # gem "bible270", git: "https://github.com/avonderluft/bible270.git", branch: "main"
55
+ gem "bible270"
56
56
  ```
57
57
 
58
- Then:
58
+ <details>
59
+ <summary>Other sources (unreleased changes, local development)</summary>
60
+
61
+ ```ruby
62
+ # straight from the repository
63
+ gem "bible270", git: "https://github.com/avonderluft/bible270.git", branch: "main"
64
+
65
+ # a local checkout you're editing
66
+ gem "bible270", path: "../bible270"
67
+ ```
68
+ </details>
69
+
70
+ Then install, copy the migrations, and migrate:
59
71
 
60
72
  ```bash
61
73
  bundle install
@@ -63,14 +75,35 @@ bin/rails bible270:install:migrations
63
75
  bin/rails db:migrate
64
76
  ```
65
77
 
78
+ `install:migrations` copies four migrations into your `db/migrate` (readers, check-offs, comments,
79
+ sign-in tokens). They belong to your application from then on: they get your timestamps, appear in
80
+ your `schema.rb`, and are yours to run, roll back, or edit. The engine does **not** add its own
81
+ migration directory to your app's paths, so the copies are the only definitions in play.
82
+
66
83
  Mount it in `config/routes.rb`:
67
84
 
68
85
  ```ruby
69
86
  mount Bible270::Engine, at: "/reading-plan"
70
87
  ```
71
88
 
89
+ Optionally generate the initializers (see [Authentication](#authentication)):
90
+
91
+ ```bash
92
+ bin/rails generate bible270:install --mount-at=/reading-plan --providers=github
93
+ ```
94
+
72
95
  The plan is now live at `/reading-plan`.
73
96
 
97
+ ### Upgrading
98
+
99
+ When a new version adds a migration, re-run the copy step — already-copied migrations are skipped:
100
+
101
+ ```bash
102
+ bundle update bible270
103
+ bin/rails bible270:install:migrations
104
+ bin/rails db:migrate
105
+ ```
106
+
74
107
  ---
75
108
 
76
109
  ## Authentication
@@ -359,6 +392,54 @@ counts. That's ideal for a homelab/parish-sized community (hundreds of readers).
359
392
  you grow to many thousands, add a cached `days_completed` counter on `Reader`
360
393
  (updated in a `Checkoff` after_commit) and sort in SQL.
361
394
 
395
+ ## Troubleshooting
396
+
397
+ **`ActiveRecord::DuplicateMigrationNameError: Multiple migrations have the name CreateBible270Readers`**
398
+
399
+ You're on 0.6.2 or earlier, where the engine wrongly added its own `db/migrate` to the host app's
400
+ migration paths *as well as* providing `install:migrations` — so copying them defined every
401
+ migration class twice. Upgrade to >= 0.6.3 and keep your copied migrations:
402
+
403
+ ```bash
404
+ bundle update bible270
405
+ bin/rails db:migrate
406
+ ```
407
+
408
+ **Sign-in returns 404 on the provider callback**
409
+
410
+ OmniAuth's `path_prefix` doesn't match where the engine is mounted. They have to line up:
411
+ mounting at `/reading-plan` means `path_prefix "/reading-plan/auth"`, and the URL registered with
412
+ the provider must be `https://YOUR-HOST/reading-plan/auth/github/callback`. The install generator
413
+ writes both consistently.
414
+
415
+ **Clicking "Sign in with …" does nothing, or raises `OmniAuth::AuthenticityError`**
416
+
417
+ The request has to be a POST with a CSRF token — OmniAuth 2.0+ refuses GET
418
+ ([CVE-2015-9284](https://nvd.nist.gov/vuln/detail/CVE-2015-9284)). The engine's own controls are
419
+ already POST forms; if you've built your own link, convert it to `button_to`. Also confirm
420
+ `omniauth-rails_csrf_protection` is in the bundle.
421
+
422
+ **No sign-in email arrives**
423
+
424
+ Email sign-in needs working Action Mailer delivery in the host app — the engine only calls
425
+ `deliver_now` (or `deliver_later`). Check `config.mailer_from` is a real address your relay will
426
+ accept, and watch the logs: delivery errors surface there. Nothing about a failure is shown to the
427
+ reader, deliberately, since the "check your inbox" message is identical either way to avoid
428
+ disclosing which addresses exist.
429
+
430
+ **"That link has expired or was already used"**
431
+
432
+ Links are single-use and live for `email_sign_in_ttl` (20 minutes by default). Some mail scanners
433
+ and link-preview services fetch URLs before the recipient clicks, which consumes the token. If you
434
+ see this a lot, lengthen the TTL or check whether something upstream is prefetching links.
435
+
436
+ **Everything renders unstyled inside my layout**
437
+
438
+ The engine ships scoped CSS in a partial rendered by its own layout. If you point
439
+ `config.layout` at your application layout, add
440
+ `<%= render "bible270/shared/styles" %>` to that layout's `<head>`, or style the `b270-*` classes
441
+ yourself.
442
+
362
443
  ## Development / tests
363
444
 
364
445
  The deterministic plan logic is fully unit-tested with no Rails dependency:
@@ -8,14 +8,14 @@ module Bible270
8
8
  g.orm :active_record
9
9
  end
10
10
 
11
- # Make the engine's migrations available to the host via
11
+ # NOTE: we deliberately do NOT append the engine's db/migrate to the host
12
+ # app's migration paths. Rails already gives mountable engines the task
13
+ #
12
14
  # bin/rails bible270:install:migrations
13
- initializer "bible270.append_migrations" do |app|
14
- unless app.root.to_s.match?(root.to_s)
15
- config.paths["db/migrate"].expanded.each do |path|
16
- app.config.paths["db/migrate"] << path
17
- end
18
- end
19
- end
15
+ #
16
+ # which copies the migrations into the host's db/migrate, where the host
17
+ # owns them and they appear in schema.rb normally. Doing both would define
18
+ # each migration class twice and raise
19
+ # ActiveRecord::DuplicateMigrationNameError.
20
20
  end
21
21
  end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Bible270
3
- VERSION = "0.6.2"
3
+ VERSION = "0.6.3"
4
4
  end
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bible270
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew vonderLuft
8
+ autorequire:
8
9
  bindir: bin
9
10
  cert_chain: []
10
- date: 1980-01-02 00:00:00.000000000 Z
11
+ date: 2026-07-25 00:00:00.000000000 Z
11
12
  dependencies:
12
13
  - !ruby/object:Gem::Dependency
13
14
  name: rails
@@ -136,6 +137,7 @@ metadata:
136
137
  bug_tracker_uri: https://github.com/avonderluft/bible270/issues
137
138
  changelog_uri: https://github.com/avonderluft/bible270/blob/main/CHANGELOG.md
138
139
  rubygems_mfa_required: 'true'
140
+ post_install_message:
139
141
  rdoc_options: []
140
142
  require_paths:
141
143
  - lib
@@ -150,7 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
150
152
  - !ruby/object:Gem::Version
151
153
  version: '0'
152
154
  requirements: []
153
- rubygems_version: 4.0.16
155
+ rubygems_version: 3.4.19
156
+ signing_key:
154
157
  specification_version: 4
155
158
  summary: 'A mountable Rails engine: a 270-day, verse-balanced Bible reading plan (OT
156
159
  once, NT twice, Psalms/Proverbs alongside) with per-user check-offs, comments, and