ebur128_stream 0.1.0 → 0.1.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: 5e663b52995c5192e4b47a4145aee4e3dfda21b672535936ec2d656222fd53a5
4
- data.tar.gz: f4e93dc095c81083b82d5addcbced0ce3639978a729f3f0850ab611ae5b65ffd
3
+ metadata.gz: b55b7c45c635a852a0918c7924683b6786692ce765e42e64818568d95b69afd2
4
+ data.tar.gz: 9d7d12b7b2c8a39e29e784c8c8ee4ac3634c330b7b8e74e0265465404a6acced
5
5
  SHA512:
6
- metadata.gz: 0e9cef3cd6887b4ce0ac16cbf7f7dea6be2ad9a8e0e48680cb8479b511b042227a96f07b7a309e8678469a69c274a8b74a7a4e776f64d0ba63fbb6d8e06b9bea
7
- data.tar.gz: f6437a5df89c7877cfc24c59c4a30d384c6c41cb2dedf72a5e06735f994897da10c4602d8cd3f32fdc37ec37f1276775561dce2212cace8bf5bfec49de748902
6
+ metadata.gz: 6df035ae78a53961e648ac2dc4ece1d2e204fdf39896c2a56e16f7682434191311983bb459775752353a120cac8f49b0c63cf4bbe95b0e829023dfad23766376
7
+ data.tar.gz: b0b5b0e635c405d5abf2e1e60d2f4ddf9259b2c4fda8b602a28cad7d2860bc6ad1a417c660f7ffc9656d275908d343fb4507e24a1bd7038139f970d6718a5ce7
data/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
- ## [Unreleased]
1
+ ## [0.1.1] - 2026-09-15
2
2
 
3
- ## [0.1.0] - 2026-08-11
3
+ - Accept nil as arguments
4
+
5
+ ## [0.1.0] - 2026-09-04
4
6
 
5
7
  - Initial release
@@ -11,12 +11,12 @@ Gem::Specification.new do |spec|
11
11
 
12
12
  spec.summary = "Streaming, zero-allocation EBU R128 loudness measurement."
13
13
  spec.description = "Ruby binding for Streaming, zero-allocation EBU R128 loudness measurement in pure Rust."
14
- spec.homepage = "https://github.com/KitaitiMakoto/ebur128-stream/tree/main/bindings/ruby"
14
+ spec.homepage = "https://github.com/KitaitiMakoto/ebur128-stream/tree/ruby/bindings/ruby"
15
15
  spec.required_ruby_version = ">= 3.2.0"
16
16
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
- spec.metadata["source_code_uri"] = "https://github.com/KitaitiMakoto/ebur128-stream/tree/main/bindings/ruby"
19
- spec.metadata["changelog_uri"] = "https://github.com/KitaitiMakoto/ebur128-stream/tree/main/bindings/ruby/CHANGELOG.md"
18
+ spec.metadata["source_code_uri"] = "https://github.com/KitaitiMakoto/ebur128-stream/tree/ruby/bindings/ruby"
19
+ spec.metadata["changelog_uri"] = "https://github.com/KitaitiMakoto/ebur128-stream/tree/ruby/bindings/ruby/CHANGELOG.md"
20
20
 
21
21
  # Uncomment the line below to require MFA for gem pushes.
22
22
  # This helps protect your gem from supply chain attacks by ensuring
@@ -26,7 +26,6 @@ Gem::Specification.new do |spec|
26
26
 
27
27
  # Specify which files should be added to the gem when it is released.
28
28
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
29
- gemspec = File.basename(__FILE__)
30
29
  spec.files = IO.popen(%w[git ls-files -z], chdir: __dir__, err: IO::NULL) do |ls|
31
30
  ls.readlines("\x0", chomp: true)
32
31
  end + ["LICENSE-APACHE", "LICENSE-MIT"]
@@ -19,7 +19,7 @@ impl Analyzer {
19
19
  fn new(args: &[Value]) -> Result<Self, Error> {
20
20
  let args = scan_args::<(), (), (), (), _, ()>(args)?;
21
21
  let kws =
22
- get_kwargs::<_, (Channels,), (Option<Integer>, Option<RArray>, Option<Integer>), ()>(
22
+ get_kwargs::<_, (Channels,), (Option<Option<Integer>>, Option<Option<RArray>>, Option<Option<Integer>>), ()>(
23
23
  args.keywords,
24
24
  &["channels"],
25
25
  &["sample_rate", "modes", "expected_duration"],
@@ -29,11 +29,11 @@ impl Analyzer {
29
29
 
30
30
  let mut builder = engine::AnalyzerBuilder::new().channels(&channels);
31
31
 
32
- if let Some(sample_rate) = sample_rate {
32
+ if let Some(sample_rate) = sample_rate.flatten() {
33
33
  builder = builder.sample_rate(sample_rate.to_u32()?);
34
34
  }
35
35
 
36
- if let Some(values) = modes {
36
+ if let Some(values) = modes.flatten() {
37
37
  use engine::Mode;
38
38
 
39
39
  let mut modes = Mode::empty();
@@ -53,7 +53,7 @@ impl Analyzer {
53
53
  }
54
54
  builder = builder.modes(modes);
55
55
  }
56
- if let Some(expected_duration) = expected_duration {
56
+ if let Some(expected_duration) = expected_duration.flatten() {
57
57
  builder = builder.expected_duration(Duration::from_secs(expected_duration.to_u64()?));
58
58
  }
59
59
 
@@ -18,7 +18,7 @@ struct Normalizer {
18
18
  impl Normalizer {
19
19
  fn new(args: &[Value]) -> Result<Self, Error> {
20
20
  let args = scan_args::<(), (), (), (), _, ()>(args)?;
21
- let kws = get_kwargs::<_, (u32, Channels), (Option<f64>, Option<f64>), ()>(
21
+ let kws = get_kwargs::<_, (u32, Channels), (Option<Option<f64>>, Option<Option<f64>>), ()>(
22
22
  args.keywords,
23
23
  &["sample_rate", "channels"],
24
24
  &["target_lufs", "true_peak_ceiling_dbtp"],
@@ -29,8 +29,8 @@ impl Normalizer {
29
29
  Ok(Self {
30
30
  sample_rate,
31
31
  channels: channels.into_boxed_slice(),
32
- target_lufs,
33
- true_peak_ceiling_dbtp,
32
+ target_lufs: target_lufs.flatten(),
33
+ true_peak_ceiling_dbtp: true_peak_ceiling_dbtp.flatten(),
34
34
  })
35
35
  }
36
36
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EBUR128Stream
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.1"
5
5
  end
@@ -22,6 +22,21 @@ module EBUR128Stream
22
22
  }
23
23
  end
24
24
 
25
+ def pretty_print(q)
26
+ attrs = self.class::ATTRS
27
+ a_width = attrs.max_by(&:length).length
28
+
29
+ q.object_group self do
30
+ q.breakable
31
+ attrs.each_with_index do |attr, index|
32
+ q.comma_breakable unless index == 0
33
+ q.text attr.to_s.rjust(a_width)
34
+ q.text " = "
35
+ q.pp send(attr)
36
+ end
37
+ end
38
+ end
39
+
25
40
  def ==(other)
26
41
  deconstruct_keys(nil) == other.deconstruct_keys(nil)
27
42
  end
@@ -21,6 +21,11 @@ class TestAnalyzer < Test::Unit::TestCase
21
21
  end
22
22
  end
23
23
 
24
+ test "new with nil" do
25
+ analyzer = Analyzer.new(channels: [:left, :right], sample_rate: nil)
26
+ assert_equal 48_000, analyzer.sample_rate
27
+ end
28
+
24
29
  test "push_interleaved" do
25
30
  analyzer = Analyzer.new(channels: [:left, :right], modes: [:all])
26
31
  assert_nothing_raised do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ebur128_stream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kitaiti Makoto
@@ -148,15 +148,15 @@ files:
148
148
  - test/test_normalizer.rb
149
149
  - test/test_report.rb
150
150
  - test/test_snapshot.rb
151
- homepage: https://github.com/KitaitiMakoto/ebur128-stream/tree/main/bindings/ruby
151
+ homepage: https://github.com/KitaitiMakoto/ebur128-stream/tree/ruby/bindings/ruby
152
152
  licenses:
153
153
  - Apache-2.0
154
154
  - MIT
155
155
  metadata:
156
156
  allowed_push_host: https://rubygems.org
157
- homepage_uri: https://github.com/KitaitiMakoto/ebur128-stream/tree/main/bindings/ruby
158
- source_code_uri: https://github.com/KitaitiMakoto/ebur128-stream/tree/main/bindings/ruby
159
- changelog_uri: https://github.com/KitaitiMakoto/ebur128-stream/tree/main/bindings/ruby/CHANGELOG.md
157
+ homepage_uri: https://github.com/KitaitiMakoto/ebur128-stream/tree/ruby/bindings/ruby
158
+ source_code_uri: https://github.com/KitaitiMakoto/ebur128-stream/tree/ruby/bindings/ruby
159
+ changelog_uri: https://github.com/KitaitiMakoto/ebur128-stream/tree/ruby/bindings/ruby/CHANGELOG.md
160
160
  rdoc_options: []
161
161
  require_paths:
162
162
  - lib