tina4ruby 3.13.160 → 3.13.161

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: 04d0f0c9549b131ac6cc66c25af963c658b14a34c5f1690c17c46b2df16b0ab5
4
- data.tar.gz: 8ae3b7fb96142e89e7db778c790f45b53b763e1d2531870bbda84a5cf5422c83
3
+ metadata.gz: 819ee4d3aa8004a8ab9c4a36f0bf6ae4448da8025695a24d20609f96d2ef6cf4
4
+ data.tar.gz: a2d690efa933ac65508944f721dab4d9cf31268853276a782ec30329f47c8d0b
5
5
  SHA512:
6
- metadata.gz: 5f50bfc2ae1a344b6398760b720caf2fc50cf9b18858ce64c2cd2ea1be4422537952a74028c34aea84244bd84e42e05f387f3c1e7830be48b7eaca7c0d8d58f7
7
- data.tar.gz: 3a8666bf0297807ddaee244b20d64e187dd76af5d8004555f10b19c79e6015d5620e42f86fab423b16ba6ac85d7d0347028491659798967cc36626e756e80547
6
+ metadata.gz: d363d16ad9e5aecd10fd33d448ab57d8d7d16c96d0a0946a648de15ec7d29bcd6025042532d97fde774711e8453dbf943a96d63c3f8b3216230bcd1f4e19f22d
7
+ data.tar.gz: c3301274025ad604123048130bea9efe11b3c47261f3109bc81effcd9d29b14df2fd98462c33ed3e748c53bf3ace9dd84b54bbcdd95e543d906c5d8aadb8ae93
data/CHANGELOG.md CHANGED
@@ -6,6 +6,13 @@ number means the same thing everywhere.
6
6
  **The authoritative release notes for every shipped version live in the documentation:**
7
7
  https://tina4.com/ruby/36-releases
8
8
 
9
+ ## 3.13.161 - 2026-11-09
10
+
11
+ ### Fixed
12
+
13
+ - TestClient now loads `.env` the way the app does (first-wins, `.env.local` then `.env`), so a test that does not boot the app still sees `TINA4_SECRET` and other variables instead of failing with a misleading error that points at `.env` (#296).
14
+ - `TestResponse` response-header lookups are now case-insensitive, matching `get_all`, so an assertion like `headers["Location"]` finds a header emitted as `location` instead of returning nil; the stored shape (lower-case keys, last value, emission order) is unchanged (#300).
15
+
9
16
  ## 3.13.160 - 2026-11-07
10
17
 
11
18
  ### Fixed
@@ -23,6 +23,40 @@ require "stringio" # rack.input is a StringIO; require it here so a clean `requi
23
23
  require_relative "parse_json"
24
24
 
25
25
  module Tina4
26
+ # A Hash whose STRING key lookups are case-insensitive (#300).
27
+ #
28
+ # HTTP header names are case-insensitive (RFC 9110), and get_all already
29
+ # treats them that way. Keys are STORED down-cased, so iteration order, the
30
+ # key set, and the last-value-per-name view are all unchanged — every reader
31
+ # sees the same Hash. Only the LOOKUP down-cases the requested name, so
32
+ # headers["Location"] finds a header emitted as "location" instead of nil.
33
+ class CaseInsensitiveHeaders < Hash
34
+ def [](key)
35
+ super(normalise_key(key))
36
+ end
37
+
38
+ def fetch(key, *args, &block)
39
+ super(normalise_key(key), *args, &block)
40
+ end
41
+
42
+ def key?(key)
43
+ super(normalise_key(key))
44
+ end
45
+ alias has_key? key?
46
+ alias include? key?
47
+ alias member? key?
48
+
49
+ def dig(key, *rest)
50
+ super(normalise_key(key), *rest)
51
+ end
52
+
53
+ private
54
+
55
+ def normalise_key(key)
56
+ key.is_a?(String) ? key.downcase : key
57
+ end
58
+ end
59
+
26
60
  class TestResponse
27
61
  attr_reader :status, :body, :headers, :content_type
28
62
 
@@ -43,7 +77,7 @@ module Tina4
43
77
  # (never-repeated) header sees any change (TC-HEADER-COLLAPSE,
44
78
  # TC-DEC-02).
45
79
  @header_list = {}
46
- flat = {}
80
+ flat = CaseInsensitiveHeaders.new
47
81
  raw_headers.each do |name, value|
48
82
  key = name.to_s.downcase
49
83
  values = value.is_a?(Array) ? value.map(&:to_s) : value.to_s.split("\n")
@@ -97,6 +131,16 @@ module Tina4
97
131
  def initialize(app = nil, root_dir: nil)
98
132
  @app = app
99
133
  @root_dir = root_dir
134
+
135
+ # #296: load .env the way the server does, so a TestClient test that never
136
+ # booted the app still sees TINA4_SECRET etc. load_env is first-wins
137
+ # (ENV[key] ||= value, .env.local then .env), so a value the test set in
138
+ # the real environment is never clobbered — the test still wins.
139
+ begin
140
+ Tina4::Env.load_env(@root_dir || Tina4.root_dir || Dir.pwd)
141
+ rescue StandardError
142
+ # A missing or unreadable .env must never stop a test from running.
143
+ end
100
144
  end
101
145
 
102
146
  def app
data/lib/tina4/version.rb CHANGED
@@ -7,5 +7,5 @@
7
7
 
8
8
 
9
9
  module Tina4
10
- VERSION = "3.13.160"
10
+ VERSION = "3.13.161"
11
11
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tina4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.160
4
+ version: 3.13.161
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tina4 Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-11-07 00:00:00.000000000 Z
11
+ date: 2026-11-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sqlite3