houseaccount 0.5.0 → 0.6.0

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: e940a284d7295b6c3945f86e2d5d99cff64c0f6474b9bdda190c41d782ac95c3
4
- data.tar.gz: 826e327eca8b704721e5e3e887d947d3ad714b9130bf006fd80b5a2dae803e5a
3
+ metadata.gz: aa18dd4454ada3709be81ff0ff416708064b02c2a988c37a55152099371e2179
4
+ data.tar.gz: b79f81239be25fb692c7e7fc60e1821014b61929cddc4740d29ea5d43fa15288
5
5
  SHA512:
6
- metadata.gz: 58a97334a737b8af5edaef43bbe3e68d5f9dd8cfdba7e72f65356fb48d54ba5a65f68126a04929048601e2718927cc0e65f88dd1842024fb9a57fd9780532428
7
- data.tar.gz: 548b7f79b7c64e5dcd1cc69117d7670246b9f8ece10197f0d2fcc1e11d09c7d41cef92b3145c59a6c84b890371fc152dda9736da187818a0152bb058c819dfe4
6
+ metadata.gz: bcecfd9589223bd8eb27679668b6fb441cf9d66ae8cc82cc67e19b7df8a464fef9dfdfa3b0044c344289156e8f9342a33d548bffe4bdf737ff26724f48e56f5e
7
+ data.tar.gz: 7d2e72f1c2873f6a70482377f3792711a4f4940c40a7859495f0665059c9f05939e60ea46eeebbd12a3c62701dea43d10db58dfc63efa38fee8c61829ec17151
data/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ For more information about changelogs, check [Keep a Changelog](http://keepachan
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## 0.6.0 - 2026-09-14
11
+
12
+ * [Breaking change] `HouseAccount.one_time_code` answers the words in both voices
13
+
14
+ It gave back the text a code is sent in; it gives back a `HouseAccount::Copy` now, whose
15
+ `written` is that same text and whose `spoken` is the sentence alone with the digits one at
16
+ a time, for an app reading a code out over a call. Every caller gains `.written`.
17
+
10
18
  ## 0.5.0 - 2026-09-14
11
19
 
12
20
  * [Feature] The `map` controller draws a page's rows on a Google map
data/README.md CHANGED
@@ -20,10 +20,10 @@ gem install houseaccount
20
20
 
21
21
  ```ruby
22
22
  # Gemfile
23
- gem 'houseaccount', '~> 0.5.0'
23
+ gem 'houseaccount', '~> 0.6.0'
24
24
  ```
25
25
 
26
- `~> 0.5.0` stops short of `0.6`, since below 1.0 a minor release may break whatever it likes.
26
+ `~> 0.6.0` stops short of `0.7`, since below 1.0 a minor release may break whatever it likes.
27
27
  Rails 8.1 and Ruby 3.2 are the minimum.
28
28
 
29
29
  A page takes the gem's layout, and wears the same head:
@@ -60,7 +60,7 @@ which Pages redirects away from.
60
60
 
61
61
  With the gem in the bundle an app serves `/css/houseaccount.css`, `/js/houseaccount.js`,
62
62
  `/theme/*`, `/font/*`, `/logo/*` and `/favicon/*` itself — and its own version's copy under
63
- `/v0.5.0/`, which is what the head helper links, cached for a year — answers a 400, 404, 406, 422 or 500
63
+ `/v0.6.0/`, which is what the head helper links, cached for a year — answers a 400, 404, 406, 422 or 500
64
64
  with the house's own page, and has these helpers in every view:
65
65
 
66
66
  ```erb
@@ -175,14 +175,18 @@ HouseAccount::Message.new side: :left, text: answer.note, sender: 'Claude', at:
175
175
  cost: Chat.spent_on(answer.input_usage, answer.output_usage)
176
176
  ```
177
177
 
178
- A code texted to a phone is the same words from every app, `HouseAccount.one_time_code`:
179
- the sentence a person reads, and under it the `@host #code` line that offers the code above
180
- the keyboard on the phone it arrived on. The host is the application's default one unless
181
- `host:` says otherwise, and the copy is the gem's `config/locales` entry.
178
+ A code sent to a phone is the same words from every app, `HouseAccount.one_time_code`, in
179
+ each voice they are said in. `written` is the sentence a person reads and, under it, the
180
+ `@host #code` line that offers the code above the keyboard on the phone it arrived on;
181
+ `spoken` is the sentence alone, its digits one at a time so a listener can write them down.
182
+ The host is the application's default one unless `host:` says otherwise, and the words are
183
+ the gem's `config/locales` entry.
182
184
 
183
185
  ```ruby
184
- HouseAccount.one_time_code contact.pin
186
+ HouseAccount.one_time_code(contact.pin).written
185
187
  # => "Enter this 6-digit code to proceed: 482913\n\n@houseaccount.com #482913"
188
+ HouseAccount.one_time_code(contact.pin).spoken
189
+ # => "Enter this 6-digit code to proceed: 4, 8, 2, 9, 1, 3"
186
190
  ```
187
191
 
188
192
  A page not on the gem links the two files from the site, and nothing else:
@@ -196,8 +200,8 @@ Those follow the latest release. Every release is also kept whole under its own
196
200
  forever and cached for a year, for a page that would rather move on its own terms:
197
201
 
198
202
  ```html
199
- <link rel='stylesheet' href='https://design.houseaccount.com/v0.5.0/css/houseaccount.css'>
200
- <script type='module' src='https://design.houseaccount.com/v0.5.0/js/houseaccount.js'></script>
203
+ <link rel='stylesheet' href='https://design.houseaccount.com/v0.6.0/css/houseaccount.css'>
204
+ <script type='module' src='https://design.houseaccount.com/v0.6.0/js/houseaccount.js'></script>
201
205
  ```
202
206
 
203
207
  A host with a Content Security Policy allows that origin for `style-src`, `script-src` and
@@ -9,4 +9,5 @@ en:
9
9
 
10
10
  @%{host} #%{pin}
11
11
  send: Send
12
+ spoken_one_time_code: 'Enter this 6-digit code to proceed: %{pin}'
12
13
  typing: Typing
@@ -0,0 +1,5 @@
1
+ module HouseAccount
2
+ # Words the house says the same way in every app, in each of the voices they are said in:
3
+ # `written` for a screen or a text, `spoken` for a voice reading them out.
4
+ Copy = Data.define :written, :spoken
5
+ end
@@ -1,4 +1,4 @@
1
1
  module HouseAccount
2
2
  # Version of the gem, read by the gemspec and by hosts checking compatibility.
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'
4
4
  end
data/lib/houseaccount.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require_relative 'houseaccount/version'
2
2
  require_relative 'houseaccount/marks'
3
+ require_relative 'houseaccount/copy'
3
4
  require_relative 'houseaccount/message'
4
5
  require_relative 'houseaccount/down'
5
6
  require_relative 'houseaccount/helpers'
@@ -28,11 +29,14 @@ module HouseAccount
28
29
  MARKS.key?(name) ? name : :houseaccount
29
30
  end
30
31
 
31
- # The text that carries a 6-digit code to a phone: the sentence a person reads, and under
32
- # it the line Safari matches against the page about to be filled, `@host #code`, which is
33
- # what offers the code above the keyboard so nobody leaves for Messages to copy it. Every
34
- # app of the house that texts a code sends this one, from `config/locales`.
32
+ # The words that carry a 6-digit code to a phone, in both voices. `written` is the sentence
33
+ # a person reads and, under it, the line Safari matches against the page about to be filled,
34
+ # `@host #code`, which offers the code above the keyboard so nobody leaves for Messages to
35
+ # copy it. `spoken` is the sentence alone, its digits one at a time so a listener can write
36
+ # them down, and without a line meant for a phone rather than a person. Every app of the
37
+ # house that sends a code sends these, from `config/locales`.
35
38
  def self.one_time_code(pin, host: Rails.application.default_url_options[:host])
36
- I18n.t 'houseaccount.one_time_code', pin:, host:
39
+ Copy.new written: I18n.t('houseaccount.one_time_code', pin:, host:),
40
+ spoken: I18n.t('houseaccount.spoken_one_time_code', pin: pin.chars.join(', '))
37
41
  end
38
42
  end
data/public/index.html CHANGED
@@ -66,8 +66,8 @@
66
66
  </div>
67
67
  <div class='col-12'>
68
68
  <div class='card p-3'>
69
- <strong>Pinned to a version — the latest is 0.5.0</strong>
70
- <span class='design-url'>https://design.houseaccount.com/v0.5.0/css/houseaccount.css · /v0.5.0/js/houseaccount.js · /v0.5.0/theme/nord.css</span>
69
+ <strong>Pinned to a version — the latest is 0.6.0</strong>
70
+ <span class='design-url'>https://design.houseaccount.com/v0.6.0/css/houseaccount.css · /v0.6.0/js/houseaccount.js · /v0.6.0/theme/nord.css</span>
71
71
  <span class='small fg-2 mt-1'>Every release stays at its own prefix forever, whole and cached for a year, for a page that moves on its own terms. The unversioned paths follow the latest.</span>
72
72
  </div>
73
73
  </div>