increase 1.95.0 → 1.95.1

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: 3da30aa3bf7a17c414fc4c89e918e54c0a5e225d8c42902c35e11b3b675176dd
4
- data.tar.gz: 158518602cfe419844ab25a2ee189c04f34b33e85dc7cbf8d69b5f753ae47e23
3
+ metadata.gz: f2f9d327dbc2d663a8524b5c14294e2c9ee64b554b142d263e8e5ea6ed747413
4
+ data.tar.gz: 910e8e227f048d92882bd408248388c079d174090203403c6f03f3bffeb31605
5
5
  SHA512:
6
- metadata.gz: bfd164104eae844bbd658f3bb310aad070c9b58c12477bed8bc422a834f9527832bbeef6c016f0a73dc26f523918610011ee8f0bf50c35edab5180eefa5b2ec5
7
- data.tar.gz: 5933e86d0c11450953aa7c4b68ad776e85a8ba6bd173e9576713ceba7e42d104f2dd25431857dfd1e91b4cd9b849c8c8a4b1b47344a03963e35a00f4b45bb950
6
+ metadata.gz: f69a80ff672f63645ed8ec94a154cbef4184ad4d0d6ba61e79e9dee467600fa26c443aa04b4d82f16786d9810682a252a0c57bb004ed46f46b90f976db45549f
7
+ data.tar.gz: fa18ad3a3edd0d32f4470851d06a1a8c545e6d78a435ad3a3a0d7c33b26f731070d077bd1ad6fe7c18fff79921d91c4b2242ab7344a1c62bebc9148c7dbd026c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.95.1 (2025-09-29)
4
+
5
+ Full Changelog: [v1.95.0...v1.95.1](https://github.com/Increase/increase-ruby/compare/v1.95.0...v1.95.1)
6
+
7
+ ### Bug Fixes
8
+
9
+ * always send `filename=...` for multipart requests where a file is expected ([990c13f](https://github.com/Increase/increase-ruby/commit/990c13f7c641c20586059d7991e197cb47f67e72))
10
+
3
11
  ## 1.95.0 (2025-09-26)
4
12
 
5
13
  Full Changelog: [v1.94.0...v1.95.0](https://github.com/Increase/increase-ruby/compare/v1.94.0...v1.95.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "increase", "~> 1.95.0"
18
+ gem "increase", "~> 1.95.1"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -38,18 +38,21 @@ module Increase
38
38
  def to_yaml(*a) = read.to_yaml(*a)
39
39
 
40
40
  # @param content [Pathname, StringIO, IO, String]
41
- # @param filename [String, nil]
41
+ # @param filename [Pathname, String, nil]
42
42
  # @param content_type [String, nil]
43
43
  def initialize(content, filename: nil, content_type: nil)
44
- @content = content
44
+ @content_type = content_type
45
45
  @filename =
46
- case content
47
- in Pathname
48
- filename.nil? ? content.basename.to_path : ::File.basename(filename)
46
+ case [filename, (@content = content)]
47
+ in [String | Pathname, _]
48
+ ::File.basename(filename)
49
+ in [nil, Pathname]
50
+ content.basename.to_path
51
+ in [nil, IO]
52
+ content.to_path
49
53
  else
50
- filename.nil? ? nil : ::File.basename(filename)
54
+ filename
51
55
  end
52
- @content_type = content_type
53
56
  end
54
57
  end
55
58
  end
@@ -82,17 +82,20 @@ module Increase
82
82
  #
83
83
  # @return [Pathname, StringIO, IO, String, Object]
84
84
  def dump(value, state:)
85
- # rubocop:disable Lint/DuplicateBranch
86
85
  case value
86
+ in StringIO | String
87
+ # https://datatracker.ietf.org/doc/html/rfc7578#section-4.2
88
+ # while not required, a filename is recommended, and in practice many servers do expect this
89
+ Increase::FilePart.new(value, filename: "upload")
87
90
  in IO
88
91
  state[:can_retry] = false
92
+ value.to_path.nil? ? Increase::FilePart.new(value, filename: "upload") : value
89
93
  in Increase::FilePart if value.content.is_a?(IO)
90
94
  state[:can_retry] = false
95
+ value
91
96
  else
97
+ value
92
98
  end
93
- # rubocop:enable Lint/DuplicateBranch
94
-
95
- value
96
99
  end
97
100
 
98
101
  # @api private
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Increase
4
- VERSION = "1.95.0"
4
+ VERSION = "1.95.1"
5
5
  end
@@ -27,7 +27,7 @@ module Increase
27
27
  sig do
28
28
  params(
29
29
  content: T.any(Pathname, StringIO, IO, String),
30
- filename: T.nilable(String),
30
+ filename: T.nilable(T.any(Pathname, String)),
31
31
  content_type: T.nilable(String)
32
32
  ).returns(T.attached_class)
33
33
  end
@@ -14,7 +14,7 @@ module Increase
14
14
 
15
15
  def initialize: (
16
16
  Pathname | StringIO | IO | String content,
17
- ?filename: String?,
17
+ ?filename: (Pathname | String)?,
18
18
  ?content_type: String?
19
19
  ) -> void
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: increase
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.95.0
4
+ version: 1.95.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Increase
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-09-26 00:00:00.000000000 Z
11
+ date: 2025-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool