typecast-ruby 0.1.3 → 0.1.5

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: e7decb1a088b596c9055b4251ed588af80d3187d997ff0ba337859f479835c64
4
- data.tar.gz: 22265da24aa5c1d9a85df19615cfe0e771cb60ebbcadf15f2157cc2ae2da0b9d
3
+ metadata.gz: 5de7b5e77a18c1e4e6834db6fedd467b922eb4a6124b01ad67b3521a7b5cebf7
4
+ data.tar.gz: 95ddc9f242aebcb75372c93bcebde790e36aa4a84a096c981b5a039055dfcd2b
5
5
  SHA512:
6
- metadata.gz: 1a2024c96530643b47e3760d10a9b07afaf88cb50b7773420970c25e6678f5ac548be1ac15c6776430ab778a2b20370c9c2b03ad3df8938984d35269fe797dd9
7
- data.tar.gz: dc4cdeda76890dfd668d519dac0f3c415907f6890c696b7b3fa24e3c255f546800e40246b743c822f56c8598e46fd0e6085987009b8540a26cef197971becbc1
6
+ metadata.gz: 6ade9e4df77283c37b69efc1fc8d417233d31b63b7f256c4badeccdd106f524014f01c526f199b3e187ceb6b8338cd2b0068814a67618930d8ebf37d4ce4ce6e
7
+ data.tar.gz: f8f83592269f2d30ee810e257a8713dd34ffadc034933b51b089aa9bc0b1fbff7de9a8b0b9fda8947f914570e76b3f2948eaca65d38d53f49a1db8877ec7aa65
@@ -1,5 +1,6 @@
1
1
  require "json"
2
2
  require "net/http"
3
+ require "rbconfig"
3
4
  require "securerandom"
4
5
  require "uri"
5
6
 
@@ -7,6 +8,7 @@ require "typecast/errors"
7
8
  require "typecast/composer"
8
9
  require "typecast/models"
9
10
  require "typecast/timestamps"
11
+ require "typecast/version"
10
12
 
11
13
  module Typecast
12
14
  class Client
@@ -157,7 +159,34 @@ module Typecast
157
159
  end
158
160
 
159
161
  def auth_headers
160
- api_key.empty? ? {} : { "X-API-KEY" => api_key }
162
+ headers = { "User-Agent" => user_agent }
163
+ headers["X-API-KEY"] = api_key unless api_key.empty?
164
+ headers
165
+ end
166
+
167
+ def user_agent
168
+ base = default_base_url? ? "default" : "custom"
169
+ timeout = @read_timeout == 30 ? "default" : "#{@read_timeout}s"
170
+ "typecast-ruby/#{VERSION} Ruby/#{RUBY_VERSION} net-http " \
171
+ "(base=#{base}; timeout=#{timeout}; os=#{os_name}; arch=#{arch_name}; sdk_env=ruby; platform=server)"
172
+ end
173
+
174
+ def os_name
175
+ host_os = RbConfig::CONFIG["host_os"].to_s.downcase
176
+ return "macos" if host_os.include?("darwin")
177
+ return "windows" if host_os.match?(/mswin|mingw|cygwin/)
178
+ return "linux" if host_os.include?("linux")
179
+
180
+ "unknown"
181
+ end
182
+
183
+ def arch_name
184
+ host_cpu = RbConfig::CONFIG["host_cpu"].to_s.downcase
185
+ return "arm64" if host_cpu.match?(/arm64|aarch64/)
186
+ return "x64" if host_cpu.match?(/x86_64|amd64/)
187
+ return "x86" if host_cpu.match?(/i386|i686|x86/)
188
+
189
+ "unknown"
161
190
  end
162
191
 
163
192
  def validate_api_key!
@@ -35,16 +35,22 @@ module Typecast
35
35
  end
36
36
 
37
37
  class OutputStream
38
- attr_reader :audio_pitch, :audio_tempo, :audio_format
38
+ attr_reader :audio_pitch, :audio_tempo, :audio_format, :target_lufs
39
39
 
40
- def initialize(audio_pitch: nil, audio_tempo: nil, audio_format: nil)
40
+ def initialize(audio_pitch: nil, audio_tempo: nil, audio_format: nil, target_lufs: nil)
41
41
  @audio_pitch = audio_pitch
42
42
  @audio_tempo = audio_tempo
43
43
  @audio_format = audio_format
44
+ @target_lufs = target_lufs
44
45
  end
45
46
 
46
47
  def to_h
47
- Models.compact(audio_pitch: audio_pitch, audio_tempo: audio_tempo, audio_format: audio_format)
48
+ Models.compact(
49
+ audio_pitch: audio_pitch,
50
+ audio_tempo: audio_tempo,
51
+ audio_format: audio_format,
52
+ target_lufs: target_lufs
53
+ )
48
54
  end
49
55
  end
50
56
 
@@ -1,3 +1,3 @@
1
1
  module Typecast
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: typecast-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neosapience
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-06-18 00:00:00.000000000 Z
11
+ date: 2026-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest