ruby-alsa 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,9 @@
1
+ source :gemcutter
2
+
3
+ gem "hoe"
4
+ gem "newgem"
5
+ gem "ffi"
6
+
7
+ group :test do
8
+ gem 'rspec'
9
+ end
data/History.txt ADDED
@@ -0,0 +1,4 @@
1
+ === 0.0.1 2010-04-24
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
data/Manifest.txt ADDED
@@ -0,0 +1,13 @@
1
+ Gemfile
2
+ History.txt
3
+ Manifest.txt
4
+ README.rdoc
5
+ Rakefile
6
+ lib/alsa.rb
7
+ script/console
8
+ script/destroy
9
+ script/generate
10
+ spec/alsa/pcm_spec.rb
11
+ spec/spec.opts
12
+ spec/spec_helper.rb
13
+ tasks/rspec.rake
data/README.rdoc ADDED
@@ -0,0 +1,48 @@
1
+ = ruby-alsa
2
+
3
+ * http://github.com/#{github_username}/#{project_name}
4
+
5
+ == DESCRIPTION:
6
+
7
+ FIX (describe your package)
8
+
9
+ == FEATURES/PROBLEMS:
10
+
11
+ * FIX (list of features or problems)
12
+
13
+ == SYNOPSIS:
14
+
15
+ FIX (code sample of usage)
16
+
17
+ == REQUIREMENTS:
18
+
19
+ * FIX (list of requirements)
20
+
21
+ == INSTALL:
22
+
23
+ * FIX (sudo gem install, anything else)
24
+
25
+ == LICENSE:
26
+
27
+ (The MIT License)
28
+
29
+ Copyright (c) 2010 Alban Peignier
30
+
31
+ Permission is hereby granted, free of charge, to any person obtaining
32
+ a copy of this software and associated documentation files (the
33
+ 'Software'), to deal in the Software without restriction, including
34
+ without limitation the rights to use, copy, modify, merge, publish,
35
+ distribute, sublicense, and/or sell copies of the Software, and to
36
+ permit persons to whom the Software is furnished to do so, subject to
37
+ the following conditions:
38
+
39
+ The above copyright notice and this permission notice shall be
40
+ included in all copies or substantial portions of the Software.
41
+
42
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
43
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
44
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
45
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
46
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
47
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
48
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/Rakefile ADDED
@@ -0,0 +1,25 @@
1
+ require 'rubygems'
2
+ gem 'hoe', '>= 2.1.0'
3
+ require 'hoe'
4
+ require 'fileutils'
5
+ require 'lib/alsa.rb'
6
+
7
+ Hoe.plugin :newgem
8
+ # Hoe.plugin :website
9
+ # Hoe.plugin :cucumberfeatures
10
+
11
+ # Generate all the Rake tasks
12
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
13
+ $hoe = Hoe.spec 'ruby-alsa' do
14
+ self.developer 'Alban Peignier', 'alban@tryphon.eu'
15
+ self.rubyforge_name = self.name # TODO this is default value
16
+ self.extra_deps = [['ffi','>= 0.6.3']]
17
+ self.url = 'http://projects.tryphon.eu/ruby-backup'
18
+ end
19
+
20
+ require 'newgem/tasks'
21
+ Dir['tasks/**/*.rake'].each { |t| load t }
22
+
23
+ # TODO - want other tests/tasks run by default? Add them to the list
24
+ # remove_task :default
25
+ # task :default => [:spec, :features]
data/lib/alsa.rb ADDED
@@ -0,0 +1,31 @@
1
+ $:.unshift(File.dirname(__FILE__)) unless
2
+ $:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__)))
3
+
4
+ require 'ffi'
5
+ require 'ffi_ext'
6
+
7
+ module ALSA
8
+
9
+ VERSION = "0.0.2"
10
+
11
+ end
12
+
13
+ require 'logger'
14
+ require 'alsa/logger'
15
+ require 'alsa/native'
16
+ require 'alsa/pcm/native'
17
+ require 'alsa/pcm/hw_parameters'
18
+ require 'alsa/pcm/capture'
19
+
20
+ module ALSA
21
+
22
+ def self.try_to(message, &block)
23
+ logger.debug { message }
24
+ if ALSA::Native::error_code?(response = yield)
25
+ raise "cannot #{message} (#{ALSA::Native::strerror(response)})"
26
+ else
27
+ response
28
+ end
29
+ end
30
+
31
+ end
data/script/console ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # File: script/console
3
+ irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
4
+
5
+ libs = " -r irb/completion"
6
+ # Perhaps use a console_lib to store any extra methods I may want available in the cosole
7
+ # libs << " -r #{File.dirname(__FILE__) + '/../lib/console_lib/console_logger.rb'}"
8
+ libs << " -r #{File.dirname(__FILE__) + '/../lib/ruby-alsa.rb'}"
9
+ puts "Loading ruby-alsa gem"
10
+ exec "#{irb} #{libs} --simple-prompt"
data/script/destroy ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/destroy'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Destroy.new.run(ARGV)
data/script/generate ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+ APP_ROOT = File.expand_path(File.join(File.dirname(__FILE__), '..'))
3
+
4
+ begin
5
+ require 'rubigen'
6
+ rescue LoadError
7
+ require 'rubygems'
8
+ require 'rubigen'
9
+ end
10
+ require 'rubigen/scripts/generate'
11
+
12
+ ARGV.shift if ['--help', '-h'].include?(ARGV[0])
13
+ RubiGen::Base.use_component_sources! [:rubygems, :newgem, :newgem_theme, :test_unit]
14
+ RubiGen::Scripts::Generate.new.run(ARGV)
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ describe ALSA::PCM do
4
+
5
+
6
+ end
data/spec/spec.opts ADDED
@@ -0,0 +1 @@
1
+ --colour
@@ -0,0 +1,12 @@
1
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
2
+
3
+ begin
4
+ require 'spec'
5
+ rescue LoadError
6
+ require 'rubygems' unless ENV['NO_RUBYGEMS']
7
+ gem 'rspec'
8
+ require 'spec'
9
+ end
10
+
11
+ $:.unshift(File.dirname(__FILE__) + '/../lib')
12
+ require 'alsa'
data/tasks/rspec.rake ADDED
@@ -0,0 +1,29 @@
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
+ namespace :spec do
18
+ desc "Generate spec HTML report"
19
+ Spec::Rake::SpecTask.new('html') do |t|
20
+ t.spec_opts = ["--format", "html:spec.html", "--diff"]
21
+ t.fail_on_error = false
22
+ end
23
+
24
+ desc "Generate rcov report"
25
+ Spec::Rake::SpecTask.new('rcov') do |t|
26
+ t.rcov = true
27
+ t.rcov_opts = %w{--exclude / --include-file ^lib}
28
+ end
29
+ end
metadata ADDED
@@ -0,0 +1,118 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby-alsa
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 0
8
+ - 2
9
+ version: 0.0.2
10
+ platform: ruby
11
+ authors:
12
+ - Alban Peignier
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-04-24 00:00:00 +02:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: ffi
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - ">="
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 6
30
+ - 3
31
+ version: 0.6.3
32
+ type: :runtime
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: rubyforge
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - ">="
40
+ - !ruby/object:Gem::Version
41
+ segments:
42
+ - 2
43
+ - 0
44
+ - 4
45
+ version: 2.0.4
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: hoe
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ segments:
56
+ - 2
57
+ - 6
58
+ - 0
59
+ version: 2.6.0
60
+ type: :development
61
+ version_requirements: *id003
62
+ description: FIX (describe your package)
63
+ email:
64
+ - alban@tryphon.eu
65
+ executables: []
66
+
67
+ extensions: []
68
+
69
+ extra_rdoc_files:
70
+ - History.txt
71
+ - Manifest.txt
72
+ files:
73
+ - Gemfile
74
+ - History.txt
75
+ - Manifest.txt
76
+ - README.rdoc
77
+ - Rakefile
78
+ - lib/alsa.rb
79
+ - script/console
80
+ - script/destroy
81
+ - script/generate
82
+ - spec/alsa/pcm_spec.rb
83
+ - spec/spec.opts
84
+ - spec/spec_helper.rb
85
+ - tasks/rspec.rake
86
+ has_rdoc: true
87
+ homepage: http://projects.tryphon.eu/ruby-backup
88
+ licenses: []
89
+
90
+ post_install_message:
91
+ rdoc_options:
92
+ - --main
93
+ - README.rdoc
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ segments:
101
+ - 0
102
+ version: "0"
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ segments:
108
+ - 0
109
+ version: "0"
110
+ requirements: []
111
+
112
+ rubyforge_project: ruby-alsa
113
+ rubygems_version: 1.3.6
114
+ signing_key:
115
+ specification_version: 3
116
+ summary: FIX (describe your package)
117
+ test_files: []
118
+