feep 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 89ce3097472490d2980637363ad9473134efdc92
4
- data.tar.gz: be53e5714ea5f0fc1b58b44858374733a9ce6694
3
+ metadata.gz: a4ddbae117f9ad17cc10c47a75a56381e6d5742b
4
+ data.tar.gz: 80cc11d69da0bf6cb57a9d595b73b921dd5462ef
5
5
  SHA512:
6
- metadata.gz: 0f949291db5d01fb823359d98991ad5b23a09a04e26e4ad9f62acec7be5789994eb208087db7bf1e43319f1264ee8b167d5dc89087543eae8499a3b99a4c7c40
7
- data.tar.gz: 8121f241ce3085927311d2f911f3dc0c4b4007c9003b53f446bffc243271d995b48d9bbffe73db9aba8d7beb236bcd4966113a17871415e119460c280b42274e
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}"
@@ -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.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.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-18 00:00:00.000000000 Z
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.6
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