stigg 0.1.0.pre.alpha.23 → 0.1.0.pre.alpha.24

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: 7d6277bdfb9baf1ac61aa48bf5989c2568fef16cd8f8cd499c813f8fe382c196
4
- data.tar.gz: f40121fff2e31196cf1655f226990fab4b76bc896b1a406535986bbe4d1a6209
3
+ metadata.gz: d15720341ab0ab2ccd22c2b23c8aae18c954bb9ec996f81b5cd51340e892553b
4
+ data.tar.gz: 32dcbf25f1caf807aa08164ba7fbeec1139d2b32d576528a77e42c0c9099b949
5
5
  SHA512:
6
- metadata.gz: 850b744a298223463ce1b21a903d856ee4adc05bf74d227c14347924fee312355fd76709ea18967b3ab206685b63a7586d477fd5ac121f9c612925f8b69800c1
7
- data.tar.gz: d2b8544efd0ee6b519924f64526ea0f673c8b07d095178791ec8844b2f49e52dfe5923d145514a021dcc9de023ca5f9f38b292fdc8683a9248c56403c841785c
6
+ metadata.gz: a15af27fb6e867e1f183d90cac76dc18553fc4df6f5176b36fc785079e37b2103234cda71b5aa3649fd3388d420aa0c01966bdad2fc50a8d767699de841a9679
7
+ data.tar.gz: a8e416967d0f08a9e9cdbe802d9c566dbc6c3d125dd64b543383947ed8371c518fee45c69ae33dab01fa48646d3dcc2c705a2c32fdbf1e0e6dc447a64cd8ccc0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.24 (2026-04-01)
4
+
5
+ Full Changelog: [v0.1.0-alpha.23...v0.1.0-alpha.24](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-alpha.23...v0.1.0-alpha.24)
6
+
7
+ ### Bug Fixes
8
+
9
+ * align path encoding with RFC 3986 section 3.3 ([c7a2627](https://github.com/stiggio/stigg-ruby/commit/c7a26278759ffabe6190390178e3f65754683920))
10
+ * variable name typo ([f7b01b9](https://github.com/stiggio/stigg-ruby/commit/f7b01b9338a55b0dac62f8627184b8bd34f86661))
11
+
3
12
  ## 0.1.0-alpha.23 (2026-03-28)
4
13
 
5
14
  Full Changelog: [v0.1.0-alpha.22...v0.1.0-alpha.23](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-alpha.22...v0.1.0-alpha.23)
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "stigg", "~> 0.1.0.pre.alpha.23"
27
+ gem "stigg", "~> 0.1.0.pre.alpha.24"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -157,7 +157,7 @@ module Stigg
157
157
  in Hash | nil => coerced
158
158
  coerced
159
159
  else
160
- message = "Expected a #{Hash} or #{Stigg::Internal::Type::BaseModel}, got #{data.inspect}"
160
+ message = "Expected a #{Hash} or #{Stigg::Internal::Type::BaseModel}, got #{input.inspect}"
161
161
  raise ArgumentError.new(message)
162
162
  end
163
163
  end
@@ -237,6 +237,11 @@ module Stigg
237
237
  end
238
238
  end
239
239
 
240
+ # @type [Regexp]
241
+ #
242
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
243
+ RFC_3986_NOT_PCHARS = /[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/
244
+
240
245
  class << self
241
246
  # @api private
242
247
  #
@@ -247,6 +252,15 @@ module Stigg
247
252
  "#{uri.scheme}://#{uri.host}#{":#{uri.port}" unless uri.port == uri.default_port}"
248
253
  end
249
254
 
255
+ # @api private
256
+ #
257
+ # @param path [String, Integer]
258
+ #
259
+ # @return [String]
260
+ def encode_path(path)
261
+ path.to_s.gsub(Stigg::Internal::Util::RFC_3986_NOT_PCHARS) { ERB::Util.url_encode(_1) }
262
+ end
263
+
250
264
  # @api private
251
265
  #
252
266
  # @param path [String, Array<String>]
@@ -259,7 +273,7 @@ module Stigg
259
273
  in []
260
274
  ""
261
275
  in [String => p, *interpolations]
262
- encoded = interpolations.map { ERB::Util.url_encode(_1) }
276
+ encoded = interpolations.map { encode_path(_1) }
263
277
  format(p, *encoded)
264
278
  end
265
279
  end
@@ -576,10 +590,10 @@ module Stigg
576
590
 
577
591
  case val
578
592
  in Stigg::FilePart unless val.filename.nil?
579
- filename = ERB::Util.url_encode(val.filename)
593
+ filename = encode_path(val.filename)
580
594
  y << "; filename=\"#{filename}\""
581
595
  in Pathname | IO
582
- filename = ERB::Util.url_encode(::File.basename(val.to_path))
596
+ filename = encode_path(::File.basename(val.to_path))
583
597
  y << "; filename=\"#{filename}\""
584
598
  else
585
599
  end
data/lib/stigg/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stigg
4
- VERSION = "0.1.0.pre.alpha.23"
4
+ VERSION = "0.1.0.pre.alpha.24"
5
5
  end
@@ -144,12 +144,20 @@ module Stigg
144
144
  end
145
145
  end
146
146
 
147
+ # https://www.rfc-editor.org/rfc/rfc3986.html#section-3.3
148
+ RFC_3986_NOT_PCHARS = T.let(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/, Regexp)
149
+
147
150
  class << self
148
151
  # @api private
149
152
  sig { params(uri: URI::Generic).returns(String) }
150
153
  def uri_origin(uri)
151
154
  end
152
155
 
156
+ # @api private
157
+ sig { params(path: T.any(String, Integer)).returns(String) }
158
+ def encode_path(path)
159
+ end
160
+
153
161
  # @api private
154
162
  sig { params(path: T.any(String, T::Array[String])).returns(String) }
155
163
  def interpolate_path(path)
@@ -45,8 +45,12 @@ module Stigg
45
45
  -> top?
46
46
  } -> top?
47
47
 
48
+ RFC_3986_NOT_PCHARS: Regexp
49
+
48
50
  def self?.uri_origin: (URI::Generic uri) -> String
49
51
 
52
+ def self?.encode_path: (String | Integer path) -> String
53
+
50
54
  def self?.interpolate_path: (String | ::Array[String] path) -> String
51
55
 
52
56
  def self?.decode_query: (String? query) -> ::Hash[String, ::Array[String]]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stigg
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.pre.alpha.23
4
+ version: 0.1.0.pre.alpha.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stigg
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-03-29 00:00:00.000000000 Z
11
+ date: 2026-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cgi