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 +4 -4
- data/README.md +2 -5
- data/{audio → assets}/Clapping.wav +0 -0
- data/clapper.gemspec +0 -1
- data/lib/clapper.rb +14 -15
- data/lib/clapper/version.rb +1 -1
- metadata +3 -18
- data/audio/Clapping.mp3 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1c4c88ee82c430c24ba02e7f17f48dfe8ae12e8
|
4
|
+
data.tar.gz: b28b0db8118bf3c1da174b45804431cf2d75c3c2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 [
|
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
|
data/clapper.gemspec
CHANGED
data/lib/clapper.rb
CHANGED
@@ -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(
|
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?(
|
30
|
-
CSV.new(File.new(
|
27
|
+
if !File.exist?(Clapper.path_to_testfile)
|
28
|
+
CSV.new(File.new(Clapper.path_to_testfile, "w+"))
|
31
29
|
else
|
32
|
-
CSV.open(
|
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
|
-
|
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
|
data/lib/clapper/version.rb
CHANGED
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.
|
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-
|
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
|
-
-
|
84
|
-
- audio/Clapping.wav
|
69
|
+
- assets/Clapping.wav
|
85
70
|
- bin/console
|
86
71
|
- bin/setup
|
87
72
|
- clapper.gemspec
|
data/audio/Clapping.mp3
DELETED
Binary file
|