ambient_spec 2.0.1 → 2.0.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26d9681fe02cc318a9cee8d88f767472d214434d30a1e4bf112220fbd9c4a92e
|
4
|
+
data.tar.gz: ea1656753c8efe5e65e99f8fa0e6349267d4c4e8150f1b0e5c6c31117ed218c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bc950c582cd4e70279da0a2061510d5fe0e34acd9c78e24e060d476a6aec484a78d2c5dff443ff28718fb684591a841d9e1f97131222a2a0d686019d8f2ff55
|
7
|
+
data.tar.gz: 7b0189469bb71b40fd9d96a7f99c05a54f628df5fab17fdb87fea8a18b8f4fdf5dead852144f74dbe5de179a309800393003b716138fddf20768553d05553bd5
|
@@ -4,10 +4,6 @@ class AmbientDocumentationFormatter < RSpec::Core::Formatters::DocumentationForm
|
|
4
4
|
|
5
5
|
RSpec::Core::Formatters.register self, :example_passed, :example_failed
|
6
6
|
|
7
|
-
def example_started
|
8
|
-
@start_time = Time.now
|
9
|
-
end
|
10
|
-
|
11
7
|
def example_passed(_)
|
12
8
|
player.sing(:pass)
|
13
9
|
super
|
data/lib/ambient_spec/player.rb
CHANGED
@@ -6,16 +6,17 @@ module AmbientSpec
|
|
6
6
|
|
7
7
|
FIFTHS = %w{c g d a e b f}.freeze
|
8
8
|
PATCHES = %w{breathy dark ghost harp piano plasma swirl waves}.freeze
|
9
|
+
PATH_TO_FILES = File.join(File.dirname(File.expand_path(__FILE__)), 'sounds').freeze
|
9
10
|
|
10
11
|
def sing(status=:pass)
|
11
12
|
if status == :pass
|
12
13
|
return unless should_play?
|
13
14
|
folder = PATCHES.sample
|
14
15
|
filename = FIFTHS.sample
|
15
|
-
system("afplay #{
|
16
|
+
system("afplay #{PATH_TO_FILES}/#{folder}/#{filename}.wav &>/dev/null &")
|
16
17
|
increment_timer
|
17
18
|
else
|
18
|
-
system("afplay #{
|
19
|
+
system("afplay #{PATH_TO_FILES}/failure/failure.wav &>/dev/null &")
|
19
20
|
end
|
20
21
|
end
|
21
22
|
|
@@ -29,9 +30,5 @@ module AmbientSpec
|
|
29
30
|
@last_played_at = Time.now
|
30
31
|
end
|
31
32
|
|
32
|
-
def path_to_files
|
33
|
-
@path_to_files ||= File.join(File.dirname(File.expand_path(__FILE__)), 'sounds')
|
34
|
-
end
|
35
|
-
|
36
33
|
end
|
37
34
|
end
|
data/lib/ambient_spec/version.rb
CHANGED