activerecord-beagle-turso 0.1.4 → 0.1.5

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: 954e05b945781cc01a630306c4cb5d9368ef5dcc54876269229afed57f3a56d1
4
- data.tar.gz: e512726ed37adeeee5ce7fe6268d3ecda615c079a4b041cca7a1677cce9d55fd
3
+ metadata.gz: 96e5e44a6be08be7733d3f7ea9590e6577826c43d8ecffe178f6bb6314d3396c
4
+ data.tar.gz: 66627c1ff6245cb9f44180c6152020248d49f58722359c7070ce883a9cbe4ed2
5
5
  SHA512:
6
- metadata.gz: e48728f8d4c61291db44090aab87067f31b76ef0503db34cdfcab18cb66e4d204a35b2ab7cdc3d6114ce555a49b347fdf88cc6406f5a08acb6cbc43e97d748e8
7
- data.tar.gz: 70b9fb0e606a6e8e844a737d250016b800fdf21eb47e29ab3ead567821a5250ba95ff90a2e3dbaeb9283e1673624b3a8d31ed506bb0ce9e4217e5d5751e24965
6
+ metadata.gz: cc94306cead989dba2cf18789880c63cc4eb27b973812bec9f807fbbdf40b81baef90edcc512d099a90c2955427ed56582c51c0dd1d7fb6fc1439e973dfbbd5f
7
+ data.tar.gz: d15c112f354343e61bda83c8f146603ae0aa1c6da19381e158eb01ce84ee487f82e67e775d416328196d5c2cf7a4f25872954219a63f75181535318681d806a3
data/README.md CHANGED
@@ -94,7 +94,7 @@ All three default their `connection` argument to `ActiveRecord::Base.connection`
94
94
  so `Beagle::Turso::SyncManager.sync!` alone is the usual call. Calling any of
95
95
  them against a **local-only** connection (no `remote_url:`/`auth_token:` in
96
96
  `database.yml`) raises `Beagle::Turso::SyncManager::NotSyncedError` — a
97
- distinct, rescuable type — rather than the driver's bare `RuntimeError`.
97
+ distinct, rescuable type — rather than the driver's own `Beagle::Turso::NotSyncedError`.
98
98
 
99
99
  To sync on a timer, wire
100
100
  `ActiveRecord::ConnectionAdapters::BeagleTurso::SyncJob` (a thin delegator to
@@ -46,23 +46,14 @@ module Beagle
46
46
  module SyncManager
47
47
  # Raised by +push!+/+pull!+/+sync!+ when the given connection is
48
48
  # local-only (its database.yml entry has no +remote_url+/+auth_token+,
49
- # so BeagleTursoAdapter opened it via +Database.open_local+). The
50
- # underlying Client#push/#pull already raise a bare RuntimeError for
51
- # this (see Beagle::Turso::Database#push/#pull); SyncManager re-raises
52
- # it as this distinct, documented type so callers can rescue it
53
- # specifically instead of matching on the driver's message text. A
49
+ # so BeagleTursoAdapter opened it via +Database.open_local+). The driver
50
+ # raises Beagle::Turso::NotSyncedError for this; SyncManager re-raises it
51
+ # as this type (kept for compatibility) with a database.yml hint. A
54
52
  # genuine sync failure against a real remote (network error, auth
55
- # failure, etc.) is NOT reclassified -- it propagates as whatever error
56
- # the driver raised, unchanged.
53
+ # failure, etc.) is NOT reclassified -- it propagates as
54
+ # Beagle::Turso::SyncError (or another Beagle::Turso::Error), unchanged.
57
55
  class NotSyncedError < StandardError; end
58
56
 
59
- # Matches only the driver's local-only wording (see
60
- # beagle_turso_core's `Error::Sync` in `Database::push`/`Database::pull`)
61
- # so a real sync failure -- which also surfaces as a RuntimeError, just
62
- # with different text -- is never misreported as "not synced".
63
- LOCAL_ONLY_MESSAGE_REGEX = /on a local-only database/i
64
- private_constant :LOCAL_ONLY_MESSAGE_REGEX
65
-
66
57
  module_function
67
58
 
68
59
  # Push this connection's local writes to its remote Turso database.
@@ -88,9 +79,7 @@ module Beagle
88
79
 
89
80
  def reraise_local_only
90
81
  yield
91
- rescue RuntimeError => e
92
- raise e unless LOCAL_ONLY_MESSAGE_REGEX.match?(e.message)
93
-
82
+ rescue Beagle::Turso::NotSyncedError => e
94
83
  raise NotSyncedError,
95
84
  "#{e.message} -- this connection is local-only; configure remote_url: " \
96
85
  "and auth_token: in database.yml to enable sync"
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module BeagleTurso
5
- VERSION = "0.1.4"
5
+ VERSION = "0.1.5"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-beagle-turso
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - BeagleSoftwareUK
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-09 00:00:00.000000000 Z
11
+ date: 2026-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0.1'
33
+ version: '0.2'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0.1'
40
+ version: '0.2'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sqlite3
43
43
  requirement: !ruby/object:Gem::Requirement