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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1d70c9e2bfc595306586a4978e2de0b8cd160b1ce1a96c60f2aa49afbe35343
4
- data.tar.gz: d167171822dbb43b4369b6b8c8b9dfbacd45dce56275fb6a8232b5b198c426d7
3
+ metadata.gz: c1c6552c515f275dd9c70eefc5177892d0717aae7bf133ef8042eca0b5033f19
4
+ data.tar.gz: e70020d52e489d99047e09f254872e84c118c3faaf1d957f107649545eaef92e
5
5
  SHA512:
6
- metadata.gz: 01033aa8d2c01ac516572fa5fdc6b455869fcaa6484569fdfe7788127a98f0612cb6aa1a03c65bb10b906066deaa48dfa00b5beea1f3e4c44988d6b08958e834
7
- data.tar.gz: b64774ddd9392d6911fd6647aaf34506ee1b10035bb9067a0c1cc3b0d0c7a949215b37c349e7177a6d22ae5a54eeaef3ff2ff0b029e8a298e97180235e4b8f68
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
@@ -81,7 +81,7 @@ end
81
81
  The generated `config/routes.rb` includes:
82
82
 
83
83
  ```ruby
84
- require "better_auth/hanami/routing"
84
+ require "better_auth/hanami"
85
85
 
86
86
  module Bookshelf
87
87
  class Routes < Hanami::Routes
@@ -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"\n) + content unless content.include?(%("better_auth/hanami/routing"))
50
- unless content.include?("include BetterAuth::Hanami::Routing")
51
- content = content.sub("class Routes < Hanami::Routes\n", "class Routes < Hanami::Routes\n include BetterAuth::Hanami::Routing\n better_auth\n")
52
- end
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 == prefix || path_info.start_with?("#{prefix}/")
20
+ return path_info if path_info == @mount_path || path_info.start_with?("#{@mount_path}/")
23
21
 
24
- normalize_path("#{prefix}/#{path_info.delete_prefix("/")}")
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
- hash[key] || hash[key.to_s] || hash[storage_key(key)] || hash[storage_key(key).to_sym]
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)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module BetterAuth
4
4
  module Hanami
5
- VERSION = "0.1.0"
5
+ VERSION = "0.5.0"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: better_auth-hanami
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian Sala