alsa-backup 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +4 -0
- data/History.txt +32 -0
- data/Manifest.txt +32 -0
- data/PostInstall.txt +7 -0
- data/README.rdoc +106 -0
- data/Rakefile +65 -0
- data/TODO +3 -0
- data/alsa-backup.gemspec +47 -0
- data/bin/alsa-backup +9 -0
- data/config.sample +91 -0
- data/lib/alsa.rb +299 -0
- data/lib/alsa_backup.rb +37 -0
- data/lib/alsa_backup/cli.rb +56 -0
- data/lib/alsa_backup/core_ext.rb +34 -0
- data/lib/alsa_backup/length_controller.rb +21 -0
- data/lib/alsa_backup/recorder.rb +91 -0
- data/lib/alsa_backup/writer.rb +124 -0
- data/lib/sndfile.rb +138 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/alsa/pcm_spec.rb +7 -0
- data/spec/alsa_backup/cli_spec.rb +78 -0
- data/spec/alsa_backup/core_ext_spec.rb +42 -0
- data/spec/alsa_backup/recorder_spec.rb +145 -0
- data/spec/alsa_backup/writer_spec.rb +130 -0
- data/spec/alsa_backup_spec.rb +11 -0
- data/spec/fixtures/config_test.rb +3 -0
- data/spec/sndfile/info_spec.rb +38 -0
- data/spec/spec.opts +1 -0
- data/spec/spec_helper.rb +30 -0
- data/tasks/rspec.rake +35 -0
- metadata +139 -0
@@ -0,0 +1,38 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../spec_helper.rb'
|
2
|
+
|
3
|
+
require 'sndfile'
|
4
|
+
|
5
|
+
describe Sndfile::Info do
|
6
|
+
|
7
|
+
before(:each) do
|
8
|
+
@info = Sndfile::Info.new
|
9
|
+
end
|
10
|
+
|
11
|
+
describe "normalized_format" do
|
12
|
+
|
13
|
+
it "should transform 'wav pcm_16' into [wav, pcm_16]" do
|
14
|
+
Sndfile::Info.normalized_format('wav pcm_16').should == %w{wav pcm_16}
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
describe "format" do
|
20
|
+
|
21
|
+
it "should be normalized when set" do
|
22
|
+
@info.format = 'wav pcm_16'
|
23
|
+
@info.format.should == %w{wav pcm_16}
|
24
|
+
end
|
25
|
+
|
26
|
+
end
|
27
|
+
|
28
|
+
describe "native_format" do
|
29
|
+
|
30
|
+
it "should return (Format::WAV|Format::PCM_16) for 'wav pcm_16'" do
|
31
|
+
@info.format = 'wav pcm_16'
|
32
|
+
@info.native_format.should == Sndfile::Native::Format::WAV | Sndfile::Native::Format::PCM_16
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
|
38
|
+
end
|
data/spec/spec.opts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--colour
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems' unless ENV['NO_RUBYGEMS']
|
5
|
+
gem 'rspec'
|
6
|
+
require 'spec'
|
7
|
+
end
|
8
|
+
|
9
|
+
$:.unshift(File.dirname(__FILE__) + '/../lib')
|
10
|
+
require 'alsa_backup'
|
11
|
+
|
12
|
+
def test_directory
|
13
|
+
directory = File.dirname(__FILE__) + '/../tmp'
|
14
|
+
Dir.mkdir(directory) unless File.exists?(directory)
|
15
|
+
directory
|
16
|
+
end
|
17
|
+
|
18
|
+
def test_file(name = 'test.wav')
|
19
|
+
File.join(test_directory, name)
|
20
|
+
end
|
21
|
+
|
22
|
+
def fixture_file(name)
|
23
|
+
File.dirname(__FILE__) + '/fixtures/' + name
|
24
|
+
end
|
25
|
+
|
26
|
+
log_dir = File.dirname(__FILE__) + '/../log/'
|
27
|
+
Dir.mkdir(log_dir) unless File.exists?(log_dir)
|
28
|
+
|
29
|
+
ALSA::logger = AlsaBackup.logger =
|
30
|
+
Logger.new(File.join(log_dir,'test.log'))
|
data/tasks/rspec.rake
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
begin
|
2
|
+
require 'spec'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rubygems' unless ENV['NO_RUBYGEMS']
|
5
|
+
require 'spec'
|
6
|
+
end
|
7
|
+
begin
|
8
|
+
require 'spec/rake/spectask'
|
9
|
+
rescue LoadError
|
10
|
+
puts <<-EOS
|
11
|
+
To use rspec for testing you must install rspec gem:
|
12
|
+
gem install rspec
|
13
|
+
EOS
|
14
|
+
exit(0)
|
15
|
+
end
|
16
|
+
|
17
|
+
desc "Run the specs under spec/models"
|
18
|
+
Spec::Rake::SpecTask.new do |t|
|
19
|
+
t.spec_opts = ['--options', "spec/spec.opts"]
|
20
|
+
t.spec_files = FileList['spec/**/*_spec.rb']
|
21
|
+
end
|
22
|
+
|
23
|
+
namespace :spec do
|
24
|
+
desc "Generate spec HTML report"
|
25
|
+
Spec::Rake::SpecTask.new('html') do |t|
|
26
|
+
t.spec_opts = ["--format", "html:spec.html", "--diff"]
|
27
|
+
t.fail_on_error = false
|
28
|
+
end
|
29
|
+
|
30
|
+
desc "Generate rcov report"
|
31
|
+
Spec::Rake::SpecTask.new('rcov') do |t|
|
32
|
+
t.rcov = true
|
33
|
+
t.rcov_opts = %w{--exclude / --include-file ^lib}
|
34
|
+
end
|
35
|
+
end
|
metadata
ADDED
@@ -0,0 +1,139 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: alsa-backup
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.8
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Alban Peignier
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2010-01-23 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: ffi
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 0.3.5
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: newgem
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.5.2
|
34
|
+
version:
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: daemons
|
37
|
+
type: :runtime
|
38
|
+
version_requirement:
|
39
|
+
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.0.10
|
44
|
+
version:
|
45
|
+
- !ruby/object:Gem::Dependency
|
46
|
+
name: newgem
|
47
|
+
type: :development
|
48
|
+
version_requirement:
|
49
|
+
version_requirements: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.5.2
|
54
|
+
version:
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: hoe
|
57
|
+
type: :development
|
58
|
+
version_requirement:
|
59
|
+
version_requirements: !ruby/object:Gem::Requirement
|
60
|
+
requirements:
|
61
|
+
- - ">="
|
62
|
+
- !ruby/object:Gem::Version
|
63
|
+
version: 2.5.0
|
64
|
+
version:
|
65
|
+
description: ALSA client to perform continuous recording
|
66
|
+
email:
|
67
|
+
- alban@tryphon.eu
|
68
|
+
executables:
|
69
|
+
- alsa-backup
|
70
|
+
extensions: []
|
71
|
+
|
72
|
+
extra_rdoc_files:
|
73
|
+
- History.txt
|
74
|
+
- Manifest.txt
|
75
|
+
- PostInstall.txt
|
76
|
+
files:
|
77
|
+
- .autotest
|
78
|
+
- History.txt
|
79
|
+
- Manifest.txt
|
80
|
+
- PostInstall.txt
|
81
|
+
- README.rdoc
|
82
|
+
- Rakefile
|
83
|
+
- TODO
|
84
|
+
- alsa-backup.gemspec
|
85
|
+
- bin/alsa-backup
|
86
|
+
- config.sample
|
87
|
+
- lib/alsa.rb
|
88
|
+
- lib/alsa_backup.rb
|
89
|
+
- lib/alsa_backup/cli.rb
|
90
|
+
- lib/alsa_backup/core_ext.rb
|
91
|
+
- lib/alsa_backup/length_controller.rb
|
92
|
+
- lib/alsa_backup/recorder.rb
|
93
|
+
- lib/alsa_backup/writer.rb
|
94
|
+
- lib/sndfile.rb
|
95
|
+
- script/console
|
96
|
+
- script/destroy
|
97
|
+
- script/generate
|
98
|
+
- spec/alsa/pcm_spec.rb
|
99
|
+
- spec/alsa_backup/cli_spec.rb
|
100
|
+
- spec/alsa_backup/core_ext_spec.rb
|
101
|
+
- spec/alsa_backup/recorder_spec.rb
|
102
|
+
- spec/alsa_backup/writer_spec.rb
|
103
|
+
- spec/alsa_backup_spec.rb
|
104
|
+
- spec/fixtures/config_test.rb
|
105
|
+
- spec/sndfile/info_spec.rb
|
106
|
+
- spec/spec.opts
|
107
|
+
- spec/spec_helper.rb
|
108
|
+
- tasks/rspec.rake
|
109
|
+
has_rdoc: true
|
110
|
+
homepage: http://projects.tryphon.eu/alsa-backup
|
111
|
+
licenses: []
|
112
|
+
|
113
|
+
post_install_message:
|
114
|
+
rdoc_options:
|
115
|
+
- --main
|
116
|
+
- README.rdoc
|
117
|
+
require_paths:
|
118
|
+
- lib
|
119
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
120
|
+
requirements:
|
121
|
+
- - ">="
|
122
|
+
- !ruby/object:Gem::Version
|
123
|
+
version: "0"
|
124
|
+
version:
|
125
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
126
|
+
requirements:
|
127
|
+
- - ">="
|
128
|
+
- !ruby/object:Gem::Version
|
129
|
+
version: "0"
|
130
|
+
version:
|
131
|
+
requirements: []
|
132
|
+
|
133
|
+
rubyforge_project: alsa-backup
|
134
|
+
rubygems_version: 1.3.5
|
135
|
+
signing_key:
|
136
|
+
specification_version: 3
|
137
|
+
summary: ALSA client to perform continuous recording
|
138
|
+
test_files: []
|
139
|
+
|