x 0.15.1 → 0.15.2
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 +3 -1
- data/lib/x/media_uploader.rb +2 -2
- data/lib/x/version.rb +1 -1
- metadata +7 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cfab6bc6d2c061c2cbe6f9da48e613c369fd15b32e54a342524427c3c82fbb5
|
4
|
+
data.tar.gz: 06bd2eb46de55e43248988e8ccd4bccb2fd1c96e3728184f1ad91447bfe8e06c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '018190e33912b68cd56cf9fba8faffca851ec75b1e8201f6c20371388329c183be7d6a05ee189869d71e66d48b1eefc70ff3860eb8067914b6abe39f285d9b86'
|
7
|
+
data.tar.gz: c80967cefb5eadee6894614ee70de27412cfda613db79d5f30d836f40df6cf02234d97d1db45b11ef38ee71faebc239908acb139e3d32fc927fbbb38de61e625
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
+
## [0.15.2] - 2025-03-28
|
2
|
+
* Use media_id instead of media_key to upload media (f1dd577)
|
1
3
|
|
2
|
-
## [0.15.
|
4
|
+
## [0.15.1] - 2025-03-24
|
3
5
|
* Fix bug in MediaUploader#await_processing (136dff8)
|
4
6
|
* Refactor RedirectHandler#build_request (fd379c3)
|
5
7
|
* Escape space in query string as %20, not + (2d2df75)
|
data/lib/x/media_uploader.rb
CHANGED
@@ -30,7 +30,7 @@ module X
|
|
30
30
|
media = init(client:, file_path:, media_type:, media_category:)
|
31
31
|
chunk_size = chunk_size_mb * BYTES_PER_MB
|
32
32
|
append(client:, file_paths: split(file_path, chunk_size), media:, media_type:, boundary:)
|
33
|
-
client.post("media/upload?command=FINALIZE&
|
33
|
+
client.post("media/upload?command=FINALIZE&media_id=#{media["id"]}")&.fetch("data")
|
34
34
|
end
|
35
35
|
|
36
36
|
def await_processing(client:, media:)
|
@@ -85,7 +85,7 @@ module X
|
|
85
85
|
threads = file_paths.map.with_index do |file_path, index|
|
86
86
|
Thread.new do
|
87
87
|
upload_body = construct_upload_body(file_path:, media_type:, boundary:)
|
88
|
-
query = "command=APPEND&
|
88
|
+
query = "command=APPEND&media_id=#{media["id"]}&segment_index=#{index}"
|
89
89
|
headers = {"Content-Type" => "multipart/form-data, boundary=#{boundary}"}
|
90
90
|
upload_chunk(client:, query:, upload_body:, file_path:, headers:)
|
91
91
|
end
|
data/lib/x/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: x
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Berlin
|
8
|
+
autorequire:
|
8
9
|
bindir: exe
|
9
10
|
cert_chain: []
|
10
|
-
date: 2025-03-
|
11
|
+
date: 2025-03-27 00:00:00.000000000 Z
|
11
12
|
dependencies: []
|
13
|
+
description:
|
12
14
|
email:
|
13
15
|
- sferik@gmail.com
|
14
16
|
executables: []
|
@@ -64,6 +66,7 @@ metadata:
|
|
64
66
|
changelog_uri: https://github.com/sferik/x-ruby/blob/master/CHANGELOG.md
|
65
67
|
bug_tracker_uri: https://github.com/sferik/x-ruby/issues
|
66
68
|
documentation_uri: https://rubydoc.info/gems/x/
|
69
|
+
post_install_message:
|
67
70
|
rdoc_options: []
|
68
71
|
require_paths:
|
69
72
|
- lib
|
@@ -78,7 +81,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
81
|
- !ruby/object:Gem::Version
|
79
82
|
version: '0'
|
80
83
|
requirements: []
|
81
|
-
rubygems_version: 3.
|
84
|
+
rubygems_version: 3.4.19
|
85
|
+
signing_key:
|
82
86
|
specification_version: 4
|
83
87
|
summary: A Ruby interface to the X API.
|
84
88
|
test_files: []
|