better_auth-hanami 0.1.0 → 0.5.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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/better_auth/hanami/generators/install_generator.rb +4 -4
- data/lib/better_auth/hanami/migration.rb +2 -1
- data/lib/better_auth/hanami/mounted_app.rb +2 -4
- data/lib/better_auth/hanami/sequel_adapter.rb +4 -1
- data/lib/better_auth/hanami/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c1c6552c515f275dd9c70eefc5177892d0717aae7bf133ef8042eca0b5033f19
|
|
4
|
+
data.tar.gz: e70020d52e489d99047e09f254872e84c118c3faaf1d957f107649545eaef92e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 72cf74b3d30eb60e13b85d8340e24c062fe46bc49f65e8816599b065f85f89265de7a60064e27b3d163d041855f5e68f208750a9693b1e8691e8bfca25204aac
|
|
7
|
+
data.tar.gz: 2d19ac81d33d23098ff8bb367ea658517c2a76a2f67d2d557b78ddd1410766411d506052626d189d8d80afdc235a7e25bada1587e732e6cb5146d24f5d653e58
|
data/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.1.1] - 2026-04-29
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Fixed Hanami route installation to require the public adapter entrypoint and avoid duplicating route configuration.
|
|
15
|
+
- Fixed mounted app path handling, migration type mapping for JSON, arrays, and big integers, and Sequel adapter lookup of falsey values.
|
|
16
|
+
|
|
17
|
+
## [0.1.0] - 2026-04-28
|
|
18
|
+
|
|
10
19
|
### Added
|
|
11
20
|
|
|
12
21
|
- Initial Hanami 2.3+ adapter with Rack route mounting, Sequel persistence, ROM::SQL migration rendering, action helpers, and Rake/generator commands.
|
data/README.md
CHANGED
|
@@ -46,10 +46,10 @@ module BetterAuth
|
|
|
46
46
|
return unless File.exist?(path)
|
|
47
47
|
|
|
48
48
|
content = File.read(path)
|
|
49
|
-
content = %(require "better_auth/hanami/routing"
|
|
50
|
-
unless content.include?("
|
|
51
|
-
|
|
52
|
-
|
|
49
|
+
content = content.gsub(%(require "better_auth/hanami/routing"), %(require "better_auth/hanami"))
|
|
50
|
+
content = %(require "better_auth/hanami"\n) + content unless content.include?(%("better_auth/hanami"))
|
|
51
|
+
content = content.sub("class Routes < Hanami::Routes\n", "class Routes < Hanami::Routes\n include BetterAuth::Hanami::Routing\n") unless content.include?("include BetterAuth::Hanami::Routing")
|
|
52
|
+
content = content.sub(/(include BetterAuth::Hanami::Routing\n)(?!\s*better_auth)/, "\\1 better_auth\n") unless content.match?(/^\s*better_auth\b/)
|
|
53
53
|
File.write(path, content)
|
|
54
54
|
end
|
|
55
55
|
|
|
@@ -66,7 +66,8 @@ module BetterAuth
|
|
|
66
66
|
case attributes[:type]
|
|
67
67
|
when "boolean" then "TrueClass"
|
|
68
68
|
when "date" then "DateTime"
|
|
69
|
-
when "number" then "Integer"
|
|
69
|
+
when "number" then attributes[:bigint] ? ":Bignum" : "Integer"
|
|
70
|
+
when "json", "string[]", "number[]" then "JSON"
|
|
70
71
|
else "String"
|
|
71
72
|
end
|
|
72
73
|
end
|
|
@@ -16,12 +16,10 @@ module BetterAuth
|
|
|
16
16
|
|
|
17
17
|
def mounted_path_info(env)
|
|
18
18
|
path_info = normalize_path(env["PATH_INFO"])
|
|
19
|
-
script_name = normalize_path(env["SCRIPT_NAME"])
|
|
20
|
-
prefix = (script_name == "/") ? @mount_path : script_name
|
|
21
19
|
|
|
22
|
-
return path_info if path_info ==
|
|
20
|
+
return path_info if path_info == @mount_path || path_info.start_with?("#{@mount_path}/")
|
|
23
21
|
|
|
24
|
-
normalize_path("#{
|
|
22
|
+
normalize_path("#{@mount_path}/#{path_info.delete_prefix("/")}")
|
|
25
23
|
end
|
|
26
24
|
|
|
27
25
|
def normalize_path(path)
|
|
@@ -269,7 +269,10 @@ module BetterAuth
|
|
|
269
269
|
end
|
|
270
270
|
|
|
271
271
|
def fetch_key(hash, key)
|
|
272
|
-
|
|
272
|
+
[key, key.to_s, storage_key(key), storage_key(key).to_sym].each do |candidate|
|
|
273
|
+
return hash[candidate] if hash.key?(candidate)
|
|
274
|
+
end
|
|
275
|
+
nil
|
|
273
276
|
end
|
|
274
277
|
|
|
275
278
|
def storage_key(value)
|