waveinfo 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 019a1fe05e310596c1bd2f79a635229f3eb37fb0
4
- data.tar.gz: 468bb5008ef0bfe68f3e6143f186d60f50b24923
3
+ metadata.gz: 74a2aa7c0afcd31cf13309b02c971a3ec1facff6
4
+ data.tar.gz: 93a26151a2c6c9c1d0cf9fccc28ea02ab9ffe0b3
5
5
  SHA512:
6
- metadata.gz: a94283ffa068adc219f2258a243d98fe5460dbf0fae0e2524a09006cb8ae107d7264b7cae9e30cecb92fae4aaabade5055e63d0f067679a6081bf208b212978f
7
- data.tar.gz: 0dfc1cf21d32d9201f1ae72e915593f1518267cb80dcc9e531890773b05d601b31e0cc3d7ab753ac625bfae725f16357f65e5a32dd1ede78f5a8598807024a26
6
+ metadata.gz: 386634ff49009b618160c000d993a09307ef92f5c23b9402e0039fc6c28951c5fcae968cc5a3828d8093ab3369fa99dd0c98d8930afc057f33a9b3e76b326ec5
7
+ data.tar.gz: af7208c56fe6a80876ac86fa8a605747ae8e393750fbce281f405be4122cd34e8149b5b8831f0e3218a98f66cdec89fe642132448db0c8e8d4a4f91f5aa52919
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/njh/ruby-waveinfo.svg)](https://travis-ci.org/njh/ruby-waveinfo)
2
+
1
3
  waveinfo
2
4
  ========
3
5
 
@@ -2,6 +2,12 @@
2
2
 
3
3
  class WaveInfo
4
4
 
5
+ # Set WaveInfo.debug = false to suppress warning messages.
6
+ class << self
7
+ attr_accessor :debug
8
+ end
9
+ self.debug = true
10
+
5
11
  # Create a new WaveInfo object to get information and metadata about a
6
12
  # Wave file (.wav). 'file' can either be a filename or an IO object.
7
13
  def initialize(file)
@@ -139,7 +145,7 @@ class WaveInfo
139
145
  @io.seek(subchunk_size,IO::SEEK_CUR)
140
146
  else
141
147
  pos = sprintf("0x%x", position)
142
- $stderr.puts "Warning: unsupported sub-chunk at #{pos}: #{subchunk_id}"
148
+ $stderr.puts "Warning: unsupported sub-chunk at #{pos}: #{subchunk_id}" if WaveInfo.debug
143
149
  @io.seek(subchunk_size,IO::SEEK_CUR)
144
150
  end
145
151
  position += subchunk_size + 8
@@ -1,3 +1,3 @@
1
1
  class WaveInfo
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -486,4 +486,26 @@ describe WaveInfo do
486
486
  expect(WaveInfo.new( data ).audio_format).to eq('Unknown (0xff)')
487
487
  end
488
488
  end
489
+
490
+ describe "outputs stderr when debug is true" do
491
+ it "should default to true" do
492
+ expect($stderr).to receive(:puts).with("Warning: unsupported sub-chunk at 0xc: ds64")
493
+ @filepath = sample_path('empty_96k_stereo_24bit_rf64')
494
+ @wav = WaveInfo.new( @filepath )
495
+ end
496
+
497
+ it "should output to stderr when true" do
498
+ WaveInfo.debug = true
499
+ expect($stderr).to receive(:puts).with("Warning: unsupported sub-chunk at 0xc: ds64")
500
+ @filepath = sample_path('empty_96k_stereo_24bit_rf64')
501
+ @wav = WaveInfo.new( @filepath )
502
+ end
503
+
504
+ it "should not output to stderr when false" do
505
+ WaveInfo.debug = false
506
+ expect($stderr).to_not receive(:puts).with("Warning: unsupported sub-chunk at 0xc: ds64")
507
+ @filepath = sample_path('empty_96k_stereo_24bit_rf64')
508
+ @wav = WaveInfo.new( @filepath )
509
+ end
510
+ end
489
511
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: waveinfo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas J Humfrey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-01 00:00:00.000000000 Z
11
+ date: 2015-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,56 +16,70 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 1.0.14
19
+ version: 1.5.0
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: 1.0.14
26
+ version: 1.5.0
27
27
  - !ruby/object:Gem::Dependency
28
- name: yard
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: 0.7.2
33
+ version: 0.10.0
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: 0.7.2
40
+ version: 0.10.0
41
41
  - !ruby/object:Gem::Dependency
42
- name: rake
42
+ name: yard
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.8.7
47
+ version: 0.8.0
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.8.7
54
+ version: 0.8.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.2.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.2.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: simplecov
57
71
  requirement: !ruby/object:Gem::Requirement
58
72
  requirements:
59
73
  - - ">="
60
74
  - !ruby/object:Gem::Version
61
- version: 2.6.0
75
+ version: '0'
62
76
  type: :development
63
77
  prerelease: false
64
78
  version_requirements: !ruby/object:Gem::Requirement
65
79
  requirements:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
- version: 2.6.0
82
+ version: '0'
69
83
  description: waveinfo is a pure-ruby gem to get the information from the headers of
70
84
  Wave (.wav) files.
71
85
  email: njh@aelius.com