starting_blocks-blinky 0.0.7 → 0.0.8
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.
- data/lib/starting_blocks-blinky.rb +62 -0
- data/starting_blocks-blinky.gemspec +1 -1
- metadata +4 -4
@@ -1,4 +1,66 @@
|
|
1
1
|
require 'starting_blocks'
|
2
2
|
require 'blinky'
|
3
3
|
|
4
|
+
# fix issue where no light will cause lock-up
|
5
|
+
module Blinky
|
6
|
+
class LightFactory
|
7
|
+
class << self
|
8
|
+
alias :original_detect_lights :detect_lights
|
9
|
+
def detect_lights plugins, recipes
|
10
|
+
original_detect_lights plugins, recipes
|
11
|
+
rescue
|
12
|
+
[]
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
module StartingBlocks
|
19
|
+
module Extensions
|
20
|
+
class BlinkyLighting
|
21
|
+
|
22
|
+
def initialize
|
23
|
+
@light = Blinky.new.light
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.turn_off!
|
27
|
+
Blinky.new.light.off!
|
28
|
+
end
|
29
|
+
|
30
|
+
def receive_files_to_run files
|
31
|
+
@spec_count = files.count
|
32
|
+
return if files.count == 0
|
33
|
+
change_color_to :yellow
|
34
|
+
end
|
35
|
+
|
36
|
+
def receive_results results
|
37
|
+
return if @spec_count == 0
|
38
|
+
if (results[:tests] || 0) == 0
|
39
|
+
change_color_to :red
|
40
|
+
elsif (results[:errors] || 0) > 0
|
41
|
+
change_color_to :red
|
42
|
+
elsif (results[:failures] || 0) > 0
|
43
|
+
change_color_to :red
|
44
|
+
elsif (results[:skips] || 0) > 0
|
45
|
+
change_color_to :yellow
|
46
|
+
else
|
47
|
+
change_color_to :green
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
def change_color_to(color)
|
52
|
+
case color
|
53
|
+
when :green
|
54
|
+
@light.success!
|
55
|
+
when :red
|
56
|
+
@light.failure!
|
57
|
+
when :yellow
|
58
|
+
@light.building!
|
59
|
+
end
|
60
|
+
rescue
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
|
4
66
|
StartingBlocks::Publisher.subscribers << StartingBlocks::Extensions::BlinkyLighting.new
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "starting_blocks-blinky"
|
7
|
-
spec.version = '0.0.
|
7
|
+
spec.version = '0.0.8'
|
8
8
|
spec.authors = ["Darren Cauthon"]
|
9
9
|
spec.email = ["darren@cauthon.com"]
|
10
10
|
spec.description = %q{Turn colors when tests are run.}
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: starting_blocks-blinky
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -104,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
segments:
|
106
106
|
- 0
|
107
|
-
hash:
|
107
|
+
hash: 2312799966773532185
|
108
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
109
|
none: false
|
110
110
|
requirements:
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
segments:
|
115
115
|
- 0
|
116
|
-
hash:
|
116
|
+
hash: 2312799966773532185
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
119
|
rubygems_version: 1.8.24
|