sound 0.0.1 → 0.0.3

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.
Files changed (5) hide show
  1. checksums.yaml +8 -8
  2. data/lib/os/os.rb +37 -0
  3. data/lib/sound.rb +10 -0
  4. data/lib/sound/out.rb +17 -0
  5. metadata +6 -3
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MWJhZjJlZDhlZDhmMjQ4Mzg5OTMyZjBhZDQ2YTI5YjY2YTA5ZjA0NQ==
4
+ OWEwMTljOGFkMDA0MjBiYjgwZmY0NzQzNzYwMWQwZTZmYzY4OTkwMg==
5
5
  data.tar.gz: !binary |-
6
- NGY0NzIwOGE4YmE4Njk5YWEzZTU0ZDdiYTY5MGM0OTM1MTNlOGNhNg==
6
+ YTAyN2NkMzg4ZGRmMGVlYThlMmY5YzgwOWM1NGQ0ZDgzODM1YTkwOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjEyMDA1NzUzMWY1NTgwOGUyOGVhZTg0MjIzNGU3MTQzZDc1YjZlMTY4YTM5
10
- MTEyMmQ3MzdlMjJlNjdiZjcyMzY2YTQzM2UwNDMyOTg0NzU3MjdlNTM4MDZh
11
- ZmExZjQ1ZjJlYmUwN2U0YmI4MTFkNzI5MjVmZDIwMjg1MGVlYTU=
9
+ YjY3ZTI4OWZjNjBkMmYyYzZlNmY5OGJlMDM5ZDA2NzczYWMwZDUyZmQxZWM0
10
+ NzYyNDExZDI2NDkzNDRlZjRiNTJiZWUzNTBkMDkwMjdjMDBhY2MwZDJmYzA4
11
+ MDY3NDA4ZjEwYmMwODdmMjg5OGE3MzAwMzgyNTQxODQ5Zjg2YTc=
12
12
  data.tar.gz: !binary |-
13
- YzQ4OTBjMzI1ZjhmNzBjMTI4N2M3YTBjMmNlNWQxOWQzZTg5YmM5OGVmYzIw
14
- NjE0ZDU4NDY5YTcyYzI4YzdiYTI2ZGEzMGIzZThlZjA3Y2RhZTMxZjI0OTNl
15
- ZWEyMjE1ZTIxNDE0YTg3NDJjZGJjYzUwNjNmNTkzOThjMDk3ZmY=
13
+ OTNlYWIxMTk5MDk4YjkxZWQ1NTVlMGUwYWE3NDQ3YjAwYTk5NjdmZmQxN2Q4
14
+ MTRiNjMzMDM2ZDhmZjEyNTNiN2QzNTYxOTI0OGZkODYzMThmODQzMjQzMTA3
15
+ ZDdiOWQwZDc3YTExNTBmMTkyMzRjOGM2MTY0ZDI3YzllZTJlZDI=
data/lib/os/os.rb ADDED
@@ -0,0 +1,37 @@
1
+ module OS
2
+
3
+ def OS.windows?
4
+ os == :windows
5
+ end
6
+
7
+ def OS.mac?
8
+ os == :mac
9
+ end
10
+
11
+ def OS.unix?
12
+ os == :unix
13
+ end
14
+
15
+ def OS.linux?
16
+ os == :linux
17
+ end
18
+
19
+ def OS.os
20
+ @os ||= (
21
+ host_os = RbConfig::CONFIG['host_os']
22
+ case host_os
23
+ when /mswin|msys|mingw|cygwin|bccwin|wince|emc|emx/
24
+ :windows
25
+ when /darwin|mac os/
26
+ :mac
27
+ when /linux/
28
+ :linux
29
+ when /solaris|bsd/
30
+ :unix
31
+ else
32
+ raise Error::WebDriverError, "unknown os: #{host_os.inspect}"
33
+ end
34
+ )
35
+ end
36
+
37
+ end
data/lib/sound.rb CHANGED
@@ -0,0 +1,10 @@
1
+ require_relative 'os/os'
2
+
3
+ if OS.windows?
4
+ require 'win32/sound'
5
+ else
6
+ warn("Sound output not yet implemented for this platform: #{OS.os}")
7
+ end
8
+
9
+ require_relative 'sound/sound'
10
+ require_relative 'sound/out'
data/lib/sound/out.rb ADDED
@@ -0,0 +1,17 @@
1
+
2
+ module Sound
3
+
4
+ module Out
5
+
6
+ def self.play_freq(frequency = 440, duration = 1000, volume = 1, immediate_playback = true)
7
+ if Platform.eql? "i386-mingw32"
8
+ Win32::Sound.play_freq(frequency, duration, volume, immediate_playback)
9
+ else
10
+ warn("play_freq not implemented for this platform: #{RUBY_PLATFORM}")
11
+ end
12
+
13
+ end
14
+
15
+ end
16
+
17
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sound
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominic Muller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-02 00:00:00.000000000 Z
11
+ date: 2014-08-03 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Allows for effiecent cross-platform sound libraries in pure Ruby by tapping
14
14
  into native libraries.
@@ -17,7 +17,9 @@ executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
+ - lib/os/os.rb
20
21
  - lib/sound.rb
22
+ - lib/sound/out.rb
21
23
  - lib/sound/sound.rb
22
24
  homepage: https://github.com/RSMP/sound
23
25
  licenses:
@@ -37,7 +39,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
37
39
  - - ! '>='
38
40
  - !ruby/object:Gem::Version
39
41
  version: '0'
40
- requirements: []
42
+ requirements:
43
+ - win32-sound, '>= 0.6.0' on Windows
41
44
  rubyforge_project:
42
45
  rubygems_version: 2.2.2
43
46
  signing_key: