rspec_pacman_formatter 0.1.2 → 0.1.3
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
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a0fdc0854ef8720cb35544c17ce314fc218c1eb61f0f911763a267e8b4a34f79
|
4
|
+
data.tar.gz: be70ad0288edd978dcfca78e5afb2a5b8168905978ae9f620973aa670db49745
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc922b545755370dcb71b83725fcfee1dea761a4c5358e3b6aabbb85cd9dd1d9352941289b48d66e84f6686ccf8e6d36d84ae6e4cf110013d9d1f2cbe60d2200
|
7
|
+
data.tar.gz: 664300459c9162cbe2048aa57fe4a8dbe6ae84e6289ea9506d15dbbd77b54eb0c32651893cb67976e7a2140ba671b586ad204927d05d4590f81e3f71e7997bd0
|
@@ -0,0 +1,17 @@
|
|
1
|
+
|
2
|
+
require 'colorize'
|
3
|
+
|
4
|
+
module RspecPacmanFormatter
|
5
|
+
class Characters
|
6
|
+
BLINKY = 'ᗣ'.light_red
|
7
|
+
PINKY = 'ᗣ'.light_magenta
|
8
|
+
INKY = 'ᗣ'.light_blue
|
9
|
+
CLYDE = 'ᗣ'.yellow
|
10
|
+
PACMAN = 'ᗧ'.light_yellow
|
11
|
+
PACDOT = '•'.light_yellow
|
12
|
+
|
13
|
+
def self.random_ghost
|
14
|
+
[BLINKY, PINKY, INKY, CLYDE].sample
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -27,7 +27,7 @@ module RspecPacmanFormatter
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def example_started(_)
|
30
|
-
step(
|
30
|
+
step(Characters::PACMAN)
|
31
31
|
end
|
32
32
|
|
33
33
|
def example_passed(_)
|
@@ -36,7 +36,7 @@ module RspecPacmanFormatter
|
|
36
36
|
|
37
37
|
def example_failed(_)
|
38
38
|
@failed += 1
|
39
|
-
step(
|
39
|
+
step(Characters.random_ghost)
|
40
40
|
end
|
41
41
|
|
42
42
|
def example_pending(_)
|
@@ -44,25 +44,25 @@ module RspecPacmanFormatter
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def close(_)
|
47
|
-
puts 'GAME OVER' if @failed > 0
|
47
|
+
puts 'GAME OVER'.red if @failed > 0
|
48
48
|
end
|
49
49
|
|
50
50
|
def update_progress_line
|
51
51
|
if @notification > @cols
|
52
52
|
if (@notification / @cols).eql?(@repetitions)
|
53
|
-
@progress_line =
|
53
|
+
@progress_line = Characters::PACDOT * (@notification - (@cols * @repetitions))
|
54
54
|
return
|
55
55
|
end
|
56
|
-
@progress_line =
|
56
|
+
@progress_line = Characters::PACDOT * @cols
|
57
57
|
return
|
58
58
|
end
|
59
|
-
@progress_line =
|
59
|
+
@progress_line = Characters::PACDOT * @notification
|
60
60
|
end
|
61
61
|
|
62
62
|
private
|
63
63
|
|
64
64
|
def step(character)
|
65
|
-
@progress_line = @progress_line.sub(
|
65
|
+
@progress_line = @progress_line.sub(/#{Regexp.quote(Characters::PACMAN)}|#{Regexp.quote(Characters::PACDOT)}/, character)
|
66
66
|
print format("%s\r", @progress_line)
|
67
67
|
if @progress_line[-1] =~ /ᗣ|\./
|
68
68
|
@repetitions += 1
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec_pacman_formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Luis Rojas Aragonés
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: colorize
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: bundler
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -69,6 +83,7 @@ files:
|
|
69
83
|
- bin/console
|
70
84
|
- bin/setup
|
71
85
|
- lib/rspec_pacman_formatter.rb
|
86
|
+
- lib/rspec_pacman_formatter/characters.rb
|
72
87
|
- lib/rspec_pacman_formatter/pacman.rb
|
73
88
|
- lib/rspec_pacman_formatter/version.rb
|
74
89
|
- rspec_pacman_formatter.gemspec
|
@@ -92,7 +107,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
92
107
|
version: '0'
|
93
108
|
requirements: []
|
94
109
|
rubyforge_project:
|
95
|
-
rubygems_version: 2.
|
110
|
+
rubygems_version: 2.7.3
|
96
111
|
signing_key:
|
97
112
|
specification_version: 4
|
98
113
|
summary: Pacman Formatter for rspec.
|