diff --git a/ext/mkrf_conf.rb b/ext/mkrf_conf.rb new file mode 100644 index 0000000..e4f82cb --- /dev/null +++ b/ext/mkrf_conf.rb @@ -0,0 +1 @@ +#TODO: build platform-specific gem dependency logic \ No newline at end of file diff --git a/lib/sound.rb b/lib/sound.rb index 276a752..9396dd8 100644 --- a/lib/sound.rb +++ b/lib/sound.rb @@ -1,9 +1,9 @@ require_relative 'os/os' if OS.windows? - require_relative '../../win32-sound/lib/win32/sound' + require 'win32/sound' else - warn("Sound output not yet implemented for this platform: #{OS.os}" + warn("Sound output not yet implemented for this platform: #{OS.os}") end require_relative 'sound/sound' diff --git a/lib/sound/out.rb b/lib/sound/out.rb index 7f6c9f3..9ac9b66 100644 --- a/lib/sound/out.rb +++ b/lib/sound/out.rb @@ -3,9 +3,9 @@ module Sound module Out - def self.play_freq(frequency = 440, duration = 1000, volume = 1, pause_execution = false) + def self.play_freq(frequency = 440, duration = 1000, volume = 1, immediate_playback = true) if Platform.eql? "i386-mingw32" - Win32::Sound.play_freq(frequency, duration, volume, pause_execution) + Win32::Sound.play_freq(frequency, duration, volume, immediate_playback) else warn("play_freq not implemented for this platform: #{RUBY_PLATFORM}") end diff --git a/lib/sound/sound.rb b/lib/sound/sound.rb index 2c2e526..b4535ee 100644 --- a/lib/sound/sound.rb +++ b/lib/sound/sound.rb @@ -1,4 +1,4 @@ module Sound - Platform = RUBY_PLATFORM + end diff --git a/sound.gemspec b/sound.gemspec index c0caddb..bb9bc0d 100644 --- a/sound.gemspec +++ b/sound.gemspec @@ -2,17 +2,22 @@ Gem::Specification.new do |spec| spec.name = 'sound' - spec.version = '0.0.1' - spec.date = '2014-08-02' + spec.version = '0.0.2' + spec.date = '2014-08-03' spec.summary = 'cross-platform sound library wrapper' spec.description = 'Allows for effiecent cross-platform sound libraries in pure Ruby by tapping into native libraries.' spec.authors = ["Dominic Muller"] spec.email = 'nicklink483@gmail.com' spec.files = [ "lib/sound.rb", - "lib/sound/sound.rb" + "lib/sound/out.rb", + "lib/sound/sound.rb", + "lib/os/os.rb" ] + #spec.add_runtime_dependency 'win32-sound', ['>= 0.6.0'] + spec.requirements << "win32-sound, '>= 0.6.0' on Windows" spec.homepage = 'https://github.com/RSMP/sound' spec.license = 'MIT' + spec.extensions << 'ext/mkrf_conf.rb' end