clapper 0.1.0 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 59822b9ce9679a12f056b5140eb38df067ac6c81
4
- data.tar.gz: 23fb1219a70fe64b50f12bb3b961112999bb80d4
3
+ metadata.gz: b1c4c88ee82c430c24ba02e7f17f48dfe8ae12e8
4
+ data.tar.gz: b28b0db8118bf3c1da174b45804431cf2d75c3c2
5
5
  SHA512:
6
- metadata.gz: f6197e70d992f68c74065b024687ab83b4b674443df453fa38f4c1760107f20100402955a2a7519e823544eaccbb172be503317680624994be3838a5b1c53b6c
7
- data.tar.gz: b5bbf9aa4e9fe4645e1081fe62672c4dd4a900624dbf30d5a74daf31811194a1189f422865208be5b108c99cf01f748d66bc4d1947ea1bcdb1bc5c2df10aaa0b
6
+ metadata.gz: 8c650aaeff98946e0c67979051eb080c23d726e695749cc05161290c1fd308d1819535b42144ebf0316b98f27ab56e45f265f69e010640436c8db65aaa36074c
7
+ data.tar.gz: bfa57480fdf13735b6ed11d872805ed87ec86855c6f92aaec39364c1cea31798d4e2fe5be4fbc21a55ccd049ef921e030774938c67afeb5020b6fe9b2b0ea953
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Clapper
2
2
 
3
3
  A gem to encourage TDD. Applauds when you pass new tests.
4
+ [rubygems page](https://rubygems.org/gems/clapper)
4
5
 
5
6
  ## Installation
6
7
 
@@ -28,11 +29,7 @@ config.after(:suite) do
28
29
  end
29
30
  ```
30
31
 
31
- This gem makes use of [audio-playback](https://github.com/arirusso/audio-playback), which requires both **libsndfile** and **portaudio**.
32
- Both libraries are definitely available on *Homebrew* and likely available on *APT*, *YUM*, as well as other package managers.
33
-
34
- Currently, running `bin/setup` will attempt to install both via Homebrew. If you don't have Homebrew, feel free to remove lines 6 and 7 from `bin/setup`
35
- and install **libsndfile** and **portaudio** through other sources before attempting to run `bundle install`
32
+ This gem makes use of [sox](http://sox.sourceforge.net/) for audio playback, which must be installed separately.
36
33
 
37
34
  ## Development
38
35
 
File without changes
@@ -32,5 +32,4 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency "bundler", "~> 1.15"
33
33
  spec.add_development_dependency "rake", "~> 10.0"
34
34
  spec.add_development_dependency "rspec", "~> 3.0"
35
- spec.add_runtime_dependency "audio-playback", "~> 0.0.8"
36
35
  end
@@ -1,5 +1,4 @@
1
1
  require "clapper/version"
2
- require "audio-playback"
3
2
  require 'csv'
4
3
 
5
4
  module Clapper
@@ -9,7 +8,7 @@ module Clapper
9
8
  f.close
10
9
  parsed_examples = Clapper.parse_examples(old_examples)
11
10
  will_clap = false
12
- f = CSV.open("tests.csv", "w")
11
+ f = CSV.open(Clapper.path_to_testfile, "w")
13
12
  example_list.each do |example|
14
13
  if parsed_examples[example.id] == nil && example.execution_result.status == :passed
15
14
  will_clap = true
@@ -19,17 +18,16 @@ module Clapper
19
18
  f << [example.id, example.execution_result.status]
20
19
  end
21
20
  f.close
22
-
23
21
  Clapper.clap(will_clap)
24
22
  end
25
23
 
26
24
  private
27
25
 
28
26
  def self.openFile
29
- if !File.exist?("tests.csv")
30
- CSV.new(File.new("tests.csv", "w+"))
27
+ if !File.exist?(Clapper.path_to_testfile)
28
+ CSV.new(File.new(Clapper.path_to_testfile, "w+"))
31
29
  else
32
- CSV.open("tests.csv", "r+")
30
+ CSV.open(Clapper.path_to_testfile, "r+")
33
31
  end
34
32
  end
35
33
 
@@ -41,16 +39,17 @@ module Clapper
41
39
  end
42
40
 
43
41
  def self.clap(will_clap)
44
- output = AudioPlayback::Device::Output.by_id(1)
45
- options = {
46
- :channels => [0,1],
47
- :latency => 1,
48
- :output_device => output,
49
- :duration => 5
50
- }
51
42
  if will_clap
52
- playback = AudioPlayback.play("audio/Clapping.wav", options)
53
- playback.block
43
+ `play #{Clapper.path_to_audio} trim 0 5`
54
44
  end
55
45
  end
46
+
47
+ def self.path_to_audio
48
+ File.join(File.dirname(__FILE__), '../assets/Clapping.wav')
49
+ end
50
+
51
+ def self.path_to_testfile
52
+ # File.join(File.dirname(__FILE__), '../assets/tests.csv')
53
+ "tests.csv"
54
+ end
56
55
  end
@@ -1,3 +1,3 @@
1
1
  module Clapper
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Simoni
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-14 00:00:00.000000000 Z
11
+ date: 2017-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,20 +52,6 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
- - !ruby/object:Gem::Dependency
56
- name: audio-playback
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - "~>"
60
- - !ruby/object:Gem::Version
61
- version: 0.0.8
62
- type: :runtime
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - "~>"
67
- - !ruby/object:Gem::Version
68
- version: 0.0.8
69
55
  description: A gem that claps when you pass Rspec tests. See github page for instructions
70
56
  on how to use.
71
57
  email: jsimoni03@gmail.com
@@ -80,8 +66,7 @@ files:
80
66
  - LICENSE.txt
81
67
  - README.md
82
68
  - Rakefile
83
- - audio/Clapping.mp3
84
- - audio/Clapping.wav
69
+ - assets/Clapping.wav
85
70
  - bin/console
86
71
  - bin/setup
87
72
  - clapper.gemspec
Binary file