feep 0.1.1 → 0.1.2
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.
- checksums.yaml +4 -4
- data/bin/feep +5 -1
- data/lib/feep/sound_player.rb +5 -5
- data/lib/feep/version.rb +2 -2
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4ddbae117f9ad17cc10c47a75a56381e6d5742b
|
4
|
+
data.tar.gz: 80cc11d69da0bf6cb57a9d595b73b921dd5462ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9521d96d2a556d7cd8c01181110c9f377b1aad9841c9b7d1a017c735833edd406286e15a97bde1ec15f661c18544638f485e2b0dea690cde9358aa4dc4ef26a
|
7
|
+
data.tar.gz: 37f076a5061a8a2140bd0094761b63228faaa529aa8882a0ac5abbc619af5dabac25fbcfced46e225f1ce670ec91696b6c997e53c6c36bc8d3c8d7b79ba8e65b
|
data/bin/feep
CHANGED
@@ -10,7 +10,7 @@ def parse_options
|
|
10
10
|
options = {:freq_or_note => '440.000', :scale => nil, :waveform => 'sine', :volume => 0.5, :duration => 100, :save => false, :loud => false, :usage => nil}
|
11
11
|
|
12
12
|
optparse = OptionParser.new do |opts|
|
13
|
-
opts.banner = 'usage: feep [-f, -n, --frequency, --note FREQUENCY|NOTE_NAME] [-s, --scale SCALE_ID] [-sd, --degrees NUMBER_OF_SCALE_DEGREES] [-w, --waveform WAVEFORM_ID] [-a, --amplitude MAX_AMPLITUDE] [-d, --duration DURATION] [--save] [--loud]'
|
13
|
+
opts.banner = 'usage: feep [-f, -n, --frequency, --note FREQUENCY|NOTE_NAME] [-s, --scale SCALE_ID] [-sd, --degrees NUMBER_OF_SCALE_DEGREES] [-w, --waveform WAVEFORM_ID] [-a, --amplitude MAX_AMPLITUDE] [-d, --duration DURATION] [--save] [--loud] [--notext]'
|
14
14
|
|
15
15
|
opts.on('-f', '--frequency FREQUENCY', 'One or more frequencies or to play at once, e.g. 440 or 220,440,880') do |frequency|
|
16
16
|
options[:freq_or_note] = frequency
|
@@ -47,6 +47,10 @@ def parse_options
|
|
47
47
|
opts.on('--loud', 'Displays information about note(s) being played') do
|
48
48
|
options[:loud] = true
|
49
49
|
end
|
50
|
+
|
51
|
+
opts.on('--notext', 'No "Feeep!" text on play') do
|
52
|
+
options[:notext] = true
|
53
|
+
end
|
50
54
|
|
51
55
|
opts.on('-v', '--version', 'Display version number and exit') do
|
52
56
|
puts "feep #{Feep::VERSION}"
|
data/lib/feep/sound_player.rb
CHANGED
@@ -14,15 +14,15 @@ module Feep
|
|
14
14
|
puts " duration: #{options[:duration]}"
|
15
15
|
end
|
16
16
|
SoundFile.new.create_sound(frequency, samples_to_write, output_filename, options)
|
17
|
-
play_wav_file(output_filename, options[:duration])
|
17
|
+
play_wav_file(output_filename, options[:duration], options[:notext])
|
18
18
|
remove_sound(output_filename, options)
|
19
19
|
end
|
20
20
|
|
21
21
|
# use command line app to play wav file
|
22
|
-
def play_wav_file(file, duration)
|
22
|
+
def play_wav_file(file, duration, notext)
|
23
23
|
if OS.windows?
|
24
24
|
if command_exists?(SNDPLAYER_WIN)
|
25
|
-
display_text_beep(duration)
|
25
|
+
display_text_beep(duration) unless notext
|
26
26
|
system("#{SNDPLAYER_WIN} #{file}")
|
27
27
|
else
|
28
28
|
puts "couldn't find #{SNDPLAYER_WIN}"
|
@@ -31,7 +31,7 @@ module Feep
|
|
31
31
|
|
32
32
|
if OS.mac? || OS.linux?
|
33
33
|
if command_exists?(SNDPLAYER_UNIX)
|
34
|
-
display_text_beep(duration)
|
34
|
+
display_text_beep(duration) unless notext
|
35
35
|
system("#{SNDPLAYER_UNIX} #{file}")
|
36
36
|
else
|
37
37
|
puts "couldn't find #{SNDPLAYER_UNIX}"
|
@@ -87,4 +87,4 @@ module Feep
|
|
87
87
|
end
|
88
88
|
|
89
89
|
end
|
90
|
-
end
|
90
|
+
end
|
data/lib/feep/version.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
module Feep
|
2
|
-
VERSION = '0.1.
|
3
|
-
end
|
2
|
+
VERSION = '0.1.2'
|
3
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: feep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Chadwick
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-06-
|
11
|
+
date: 2015-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: wavefile
|
@@ -159,8 +159,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
159
159
|
version: '0'
|
160
160
|
requirements: []
|
161
161
|
rubyforge_project:
|
162
|
-
rubygems_version: 2.4.
|
162
|
+
rubygems_version: 2.4.8
|
163
163
|
signing_key:
|
164
164
|
specification_version: 4
|
165
165
|
summary: Make your computer feep with Ruby
|
166
|
-
test_files:
|
166
|
+
test_files:
|
167
|
+
- spec/feep_spec.rb
|
168
|
+
- spec/spec_helper.rb
|