fuubar 2.2.0 → 2.3.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.md +5 -2
- data/lib/fuubar.rb +49 -14
- data/lib/fuubar/output.rb +1 -0
- data/spec/fuubar/output_spec.rb +1 -0
- data/spec/fuubar_spec.rb +4 -2
- metadata +20 -21
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 731a08e3acb3e7640f3d9e88791a9e312eecffb8
|
4
|
+
data.tar.gz: 68d93a5bdd40004a3dc5ef9b8e7f95c6d8772698
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dbfbb4396ca66e950b7808800e9e6435759d1cd6b8ac4f0e10129b3a740713b6b462b1938270f65c445d359964e81bc97d3c7a5d3a10043c002ae82307e1d5f
|
7
|
+
data.tar.gz: 1de02b998161ecaf7add33120276d9fee4461394ee7625e8c9c4fe4a735eb3207c7efb11848d25a9c599de6c854af5a80537faf9e9c83f1da6edde9b6168e52b
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.md
CHANGED
@@ -11,8 +11,11 @@ Supported Rubies
|
|
11
11
|
* MRI Ruby 1.8.7
|
12
12
|
* MRI Ruby 1.9.2
|
13
13
|
* MRI Ruby 1.9.3
|
14
|
-
* MRI Ruby 2.0.
|
15
|
-
* MRI Ruby 2.1.
|
14
|
+
* MRI Ruby 2.0.x
|
15
|
+
* MRI Ruby 2.1.x
|
16
|
+
* MRI Ruby 2.2.x
|
17
|
+
* MRI Ruby 2.3.x
|
18
|
+
* MRI Ruby 2.4.x
|
16
19
|
* JRuby (in 1.8 compat mode)
|
17
20
|
* JRuby (in 1.9 compat mode)
|
18
21
|
|
data/lib/fuubar.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'rspec/core'
|
3
4
|
require 'rspec/core/formatters/base_text_formatter'
|
4
5
|
require 'ruby-progressbar'
|
@@ -9,14 +10,19 @@ RSpec.configuration.add_setting :fuubar_progress_bar_options, :default => {}
|
|
9
10
|
class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
10
11
|
DEFAULT_PROGRESS_BAR_OPTIONS = { :format => ' %c/%C |%w>%i| %e ' }.freeze
|
11
12
|
|
12
|
-
RSpec::Core::Formatters.register self,
|
13
|
+
RSpec::Core::Formatters.register self,
|
14
|
+
:start,
|
13
15
|
:message,
|
14
16
|
:example_passed,
|
15
17
|
:example_pending,
|
16
18
|
:example_failed,
|
19
|
+
:example_started,
|
20
|
+
:example_finished,
|
17
21
|
:dump_failures
|
18
22
|
|
19
|
-
attr_accessor :
|
23
|
+
attr_accessor :example_tick_thread,
|
24
|
+
:example_tick_lock,
|
25
|
+
:progress,
|
20
26
|
:passed_count,
|
21
27
|
:pending_count,
|
22
28
|
:failed_count
|
@@ -24,22 +30,23 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
24
30
|
def initialize(*args)
|
25
31
|
super
|
26
32
|
|
33
|
+
self.example_tick_lock = Mutex.new
|
27
34
|
self.progress = ProgressBar.create(
|
28
|
-
DEFAULT_PROGRESS_BAR_OPTIONS
|
29
|
-
merge(:throttle_rate => continuous_integration? ? 1.0 : nil)
|
30
|
-
merge(:total => 0,
|
31
|
-
|
32
|
-
|
35
|
+
DEFAULT_PROGRESS_BAR_OPTIONS
|
36
|
+
.merge(:throttle_rate => continuous_integration? ? 1.0 : nil)
|
37
|
+
.merge(:total => 0,
|
38
|
+
:output => output,
|
39
|
+
:autostart => false)
|
33
40
|
)
|
34
41
|
end
|
35
42
|
|
36
43
|
def start(notification)
|
37
|
-
progress_bar_options = DEFAULT_PROGRESS_BAR_OPTIONS
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
44
|
+
progress_bar_options = DEFAULT_PROGRESS_BAR_OPTIONS
|
45
|
+
.merge(:throttle_rate => continuous_integration? ? 1.0 : nil)
|
46
|
+
.merge(configuration.fuubar_progress_bar_options)
|
47
|
+
.merge(:total => notification.count,
|
48
|
+
:output => output,
|
49
|
+
:autostart => false)
|
43
50
|
|
44
51
|
self.progress = ProgressBar.create(progress_bar_options)
|
45
52
|
self.passed_count = 0
|
@@ -51,6 +58,14 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
51
58
|
with_current_color { progress.start }
|
52
59
|
end
|
53
60
|
|
61
|
+
def example_started(notification)
|
62
|
+
self.example_tick_thread = start_tick_thread(notification)
|
63
|
+
end
|
64
|
+
|
65
|
+
def example_finished(_notification)
|
66
|
+
example_tick_thread.kill
|
67
|
+
end
|
68
|
+
|
54
69
|
def example_passed(_notification)
|
55
70
|
self.passed_count += 1
|
56
71
|
|
@@ -74,6 +89,12 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
74
89
|
increment
|
75
90
|
end
|
76
91
|
|
92
|
+
def example_tick(_notification)
|
93
|
+
example_tick_lock.synchronize do
|
94
|
+
refresh
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
77
98
|
def message(notification)
|
78
99
|
if progress.respond_to? :log
|
79
100
|
progress.log(notification.message)
|
@@ -99,6 +120,10 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
99
120
|
with_current_color { progress.increment }
|
100
121
|
end
|
101
122
|
|
123
|
+
def refresh
|
124
|
+
with_current_color { progress.refresh }
|
125
|
+
end
|
126
|
+
|
102
127
|
def with_current_color
|
103
128
|
output.print "\e[#{color_code_for(current_color)}m" if color_enabled?
|
104
129
|
yield
|
@@ -129,6 +154,16 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
|
|
129
154
|
|
130
155
|
def continuous_integration?
|
131
156
|
@continuous_integration ||= \
|
132
|
-
|
157
|
+
[nil, '', 'false'].exclude?(ENV['CONTINUOUS_INTEGRATION'])
|
158
|
+
end
|
159
|
+
|
160
|
+
def start_tick_thread(notification)
|
161
|
+
Thread.new do
|
162
|
+
loop do
|
163
|
+
sleep(1)
|
164
|
+
|
165
|
+
example_tick(notification)
|
166
|
+
end
|
167
|
+
end
|
133
168
|
end
|
134
169
|
end
|
data/lib/fuubar/output.rb
CHANGED
data/spec/fuubar/output_spec.rb
CHANGED
data/spec/fuubar_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
2
3
|
require 'fuubar'
|
3
4
|
require 'stringio'
|
4
5
|
require 'ostruct'
|
@@ -8,8 +9,8 @@ describe Fuubar do
|
|
8
9
|
let(:output) do
|
9
10
|
io = StringIO.new
|
10
11
|
|
11
|
-
allow(io).to receive(:tty?)
|
12
|
-
|
12
|
+
allow(io).to receive(:tty?)
|
13
|
+
.and_return(true)
|
13
14
|
|
14
15
|
io
|
15
16
|
end
|
@@ -261,3 +262,4 @@ describe Fuubar do
|
|
261
262
|
end
|
262
263
|
end
|
263
264
|
end
|
265
|
+
# rubocop:enable Metrics/LineLength
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fuubar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.3.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicholas Evans
|
@@ -14,26 +14,26 @@ cert_chain:
|
|
14
14
|
-----BEGIN CERTIFICATE-----
|
15
15
|
MIIDrjCCApagAwIBAgIBATANBgkqhkiG9w0BAQUFADBOMRowGAYDVQQDDBFhY2Nv
|
16
16
|
dW50c19ydWJ5Z2VtczEbMBkGCgmSJomT8ixkARkWC3RoZWtvbXBhbmVlMRMwEQYK
|
17
|
-
|
17
|
+
CZImiZPyLGQBGRYD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0wHxYf06r3ZcHTulhk1suztLCWyUxyOkGj4IW+LXPRGP66o
|
31
|
+
6qcofBVFh7GXatsgbj87f7a8/opXaeQHqC2X18sCTwOCcO5PjtFrXK7A3v1u2yRj
|
32
|
+
rEe6qyTkY77mRgG3f/feAizAvYYkPxOngUwN8rpfKpU5iESS4UUaxIi3AGJHgTw2
|
33
|
+
etYUO0DlNY/qYfSfExrgt0W5dZeT09V++WPlYauHw/EZtAB0AsJwVdtIscq0HSvX
|
34
|
+
yH9AFp3KIe0v70EXzao/94n+XoDULrHEhqGMo34iS+37ZA==
|
35
35
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
36
|
+
date: 2017-12-31 00:00:00.000000000 Z
|
37
37
|
dependencies:
|
38
38
|
- !ruby/object:Gem::Dependency
|
39
39
|
name: rspec-core
|
@@ -133,16 +133,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
133
133
|
version: '0'
|
134
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
|
-
- - "
|
136
|
+
- - ">"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
138
|
+
version: 1.3.1
|
139
139
|
requirements: []
|
140
140
|
rubyforge_project:
|
141
|
-
rubygems_version: 2.
|
141
|
+
rubygems_version: 2.6.14
|
142
142
|
signing_key:
|
143
143
|
specification_version: 4
|
144
144
|
summary: the instafailing RSpec progress bar formatter
|
145
145
|
test_files:
|
146
146
|
- spec/fuubar/output_spec.rb
|
147
147
|
- spec/fuubar_spec.rb
|
148
|
-
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|