fuubar 2.3.2 → 2.4.1

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.
Files changed (7) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +0 -0
  3. data.tar.gz.sig +0 -0
  4. data/README.md +119 -58
  5. data/lib/fuubar.rb +28 -21
  6. metadata +11 -35
  7. metadata.gz.sig +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bc131d5dbd7aa378742d9358d78351fa7ed928083faac077f2b0a553cd2e4018
4
- data.tar.gz: 771c6d140e875296f0bcdefdfb7904b42723f6f66bdc92511311a08d49fb783c
3
+ metadata.gz: f33c75eecd40f56ed951ba0271450860b3ebebbb0bbd1176f77a78de206b28f6
4
+ data.tar.gz: 185aa80a3b147b9c6178871c09474e7ffe9231219e3b4cb48cdf0262678dfcfb
5
5
  SHA512:
6
- metadata.gz: b05503c671beaf5a2d9a4184f9d3c0e216c4f1cdf31732db26de0a9f323b57325bc4fe5959d3c324e124cfb7374bc7b2d93b1d5acace372d58bf7ec7bd2907a6
7
- data.tar.gz: d537243787d29fc734dc9180b570c659785f6103be90169d61c2ebabcbd835fbe990445cedc7daebc0e0ddc3630be0d11a44d18067ffa8d64eff19ce41bc50bf
6
+ metadata.gz: d8d30b539b96fe08156290d6ac407cea29a062e1b29eaf8fa39e041a8844abbb221775a0678e6644c0b1568b8996a5995ed84d23fc11729b0613b102af712d5c
7
+ data.tar.gz: e6f41f9692280dae28a8c44daf08f9df19a59b083579ea195d29a166d63bf68a88816137d7d9b17f4733556e2087756b04363990cd1a1f2aa5387db0959f99ec
Binary file
data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -1,108 +1,169 @@
1
- #Fuubar
2
-
1
+ Fuubar
2
+ ================================================================================
3
3
  [![Gem Version](https://img.shields.io/gem/v/fuubar.svg)](https://rubygems.org/gems/fuubar) ![Rubygems Rank Overall](https://img.shields.io/gem/rt/fuubar.svg) ![Rubygems Rank Daily](https://img.shields.io/gem/rd/fuubar.svg) ![Rubygems Downloads](https://img.shields.io/gem/dv/fuubar/stable.svg) [![Build Status](https://img.shields.io/travis/thekompanee/fuubar/master.svg)](http://travis-ci.org/thekompanee/fuubar) [![Code Climate](https://codeclimate.com/github/thekompanee/fuubar.svg)](https://codeclimate.com/github/thekompanee/fuubar)
4
4
 
5
- Fuubar is an instafailing [RSpec](http://github.com/rspec) formatter that uses a progress bar instead of a string of letters and dots as feedback.
6
-
7
- [![gif](http://i.imgur.com/GIiA53s.gif)](http://vimeo.com/16845253).
5
+ fuubar is an instafailing [RSpec][rspec] formatter that uses
6
+ a progress bar instead of a string of letters and dots as feedback.
8
7
 
9
- Supported Rubies
10
- --------------------------------
11
- * MRI Ruby 1.8.7
12
- * MRI Ruby 1.9.2
13
- * MRI Ruby 1.9.3
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
19
- * JRuby (in 1.8 compat mode)
20
- * JRuby (in 1.9 compat mode)
8
+ ![examples][example-gif]
21
9
 
22
10
  Installation
23
11
  --------------------------------------------------------------------------------
24
12
 
25
- First:
26
-
27
13
  ```ruby
28
14
  gem install fuubar
29
- ```
30
15
 
31
- or in your Gemfile
16
+ # or in your Gemfile
32
17
 
33
- ```ruby
34
18
  gem 'fuubar'
35
19
  ```
36
20
 
37
- Then, when running rspec:
38
-
39
- ```
40
- rspec --format Fuubar --color spec
41
- ```
42
-
43
- Or, if you want to use Fuubar as your default formatter, simply put the options in your `.rspec` file:
21
+ Usage
22
+ --------------------------------------------------------------------------------
44
23
 
45
- --format Fuubar
46
- --color
24
+ In order to use fuubar, you have three options.
47
25
 
48
- Security
49
- --------------------------------------------------------------------------------
26
+ ### Option 1: Invoke It Manually Via The Command Line ###
50
27
 
51
- fuubar is cryptographically signed. To be sure the gem you install hasn’t been
52
- tampered with:
28
+ ```
29
+ rspec --format Fuubar --color
30
+ ```
53
31
 
54
- * Add my public key (if you haven’t already) as a trusted certificate
32
+ ### Option 2: Add It To Your Local `.rspec` File ###
55
33
 
56
34
  ```
57
- gem cert --add <(curl -Ls https://raw.github.com/thekompanee/fuubar/master/certs/thekompanee.pem)
35
+ # .rspec
36
+
37
+ --format Fuubar
38
+ --color
58
39
  ```
59
40
 
60
- * gem install fuubar -P MediumSecurity
41
+ ### Option 3: Add It To Your `spec_helper.rb` ###
61
42
 
62
- The `MediumSecurity` trust profile will verify signed gems, but allow the
63
- installation of unsigned dependencies.
43
+ ```ruby
44
+ # spec/spec_helper.rb
64
45
 
65
- This is necessary because not all of fuubar has a dependency on RSpec which
66
- isn't signed, so we cannot use `HighSecurity`.
46
+ RSpec.configure do |config|
47
+ config.add_formatter 'Fuubar'
48
+ end
49
+ ```
67
50
 
68
51
  Advanced Usage
69
52
  --------------------------------
70
53
 
71
- ### Customizing the Bar ###
54
+ ### Customizing The Bar ###
72
55
 
73
- Fuubar exposes an RSpec configuration variable called `fuubar_progress_bar_options` which, when set will be passed directly to [ruby-progressbar](https://github.com/jfelchner/ruby-progressbar) which does all the heavy lifting. Take a look at the documentation for details on all of the options you can pass in.
56
+ fuubar exposes an RSpec configuration variable called
57
+ `fuubar_progress_bar_options` which, when set will be passed directly to
58
+ [ruby-progressbar][rpb-github] which does all the heavy lifting. Take a look at
59
+ the [ruby-progressbar documentation][rpb-docs] for details on all of the options
60
+ you can pass in.
74
61
 
75
- Let's say for example that you would like to change the format of the bar. You would do that like so:
62
+ #### Example ####
63
+
64
+ Let's say for example that you would like to change the format of the bar. You
65
+ would do that like so:
76
66
 
77
67
  ```ruby
78
- # spec_helper.rb
68
+ # spec/spec_helper.rb
79
69
 
80
70
  RSpec.configure do |config|
81
71
  config.fuubar_progress_bar_options = { :format => 'My Fuubar! <%B> %p%% %a' }
82
72
  end
83
73
  ```
84
74
 
85
- would make it so that, when Fuubar is output, it would look something like:
75
+ would make it so that, when fuubar is output, it would look something like:
86
76
 
87
77
  My Fuubar! <================================ > 53.44% 00:12:31
88
78
 
89
- Issues
90
- --------------------------------
79
+ ### Hiding Pending/Skipped Spec Summary ###
91
80
 
92
- If you have problems, please create a [Github issue](https://github.com/jeffkreeftmeijer/fuubar/issues).
81
+ By default fuubar follows RSpec's lead and will dump out a summary of all of the
82
+ pending specs in the suite once the test run is over. This is a good idea
83
+ because the additional noise is a nudge to fix those tests. We realize however
84
+ that not all teams have the luxury of implementing all of the pending specs and
85
+ therefore fuubar gives you the option of supressing that summary.
93
86
 
94
- Credits
95
- --------------------------------
87
+ #### Example ####
88
+
89
+ ```ruby
90
+ # spec/spec_helper.rb
96
91
 
97
- fuubar was created by [Jeff Kreeftmeijer](https://github.com/jeffkreeftmeijer)
98
- fuubar is maintained by [Jeff Kreeftmeijer](https://github.com/jeffkreeftmeijer) and [The Kompanee, Ltd.](http://www.thekompanee.com)
92
+ RSpec.configure do |config|
93
+ config.fuubar_output_pending_results = false
94
+ end
95
+ ```
99
96
 
100
- Contributing
97
+ ### Disabling Auto-Refresh ###
98
+
99
+ By default fuubar will automatically refresh the bar (and therefore the ETA)
100
+ every second. Unfortunately this doesn't play well with things like debuggers.
101
+ When you're debugging, having a bar show up every second is undesireable.
102
+ [Pry][pry] gives us hooks so that we can automatically disable the refresh when
103
+ it's used. Unfortunately [byebug][byebug] does not and disabling the bar must be
104
+ done manually.
105
+
106
+ #### Example ####
107
+
108
+ ```ruby
109
+ # spec/spec_helper.rb
110
+
111
+ RSpec.configure do |config|
112
+ config.fuubar_auto_refresh = false
113
+ end
114
+ ```
115
+
116
+ Security
117
+ --------------------------------------------------------------------------------
118
+
119
+ fuubar is cryptographically signed. To be sure the gem you install hasn’t been
120
+ tampered with, follow these steps:
121
+
122
+ 1. Add my public key (if you haven’t already) as a trusted certificate
123
+
124
+ ```
125
+ gem cert --add <(curl -Ls https://raw.github.com/thekompanee/fuubar/master/certs/thekompanee.pem)
126
+ ```
127
+
128
+ 2. Install fuubar telling it to use security checks when possible.
129
+
130
+ ```
131
+ gem install fuubar -P MediumSecurity
132
+ ```
133
+
134
+ > **Note:** The `MediumSecurity` trust profile will verify signed gems, but
135
+ > allow the installation of unsigned dependencies.
136
+ >
137
+ > This is necessary because fuubar has a dependency on RSpec which isn't signed,
138
+ > and therefore we cannot use `HighSecurity`, which requires signed gems.
139
+
140
+ Credits
101
141
  --------------------------------------------------------------------------------
102
142
 
103
- Found an issue? Have a great idea? Want to help? Great! Create an issue [issue](http://github.com/jeffkreeftmeijer/fuubar/issues) for it, or even better; fork the project and fix the problem yourself. Pull requests are always welcome. :)
143
+ fuubar was written by [Jeff Felchner][jefff-profile] and [Jeff
144
+ Kreeftmeijer][jeffk-profile]
145
+
146
+ ![The Kompanee][kompanee-logo]
147
+
148
+ fuubar is maintained and funded by [The Kompanee, Ltd.][kompanee-site]
149
+
150
+ The names and logos for The Kompanee are trademarks of The Kompanee, Ltd.
104
151
 
105
152
  License
106
- --------------------------------
153
+ --------------------------------------------------------------------------------
107
154
 
108
- fuubar is Copyright &copy; 2010-2016 Jeff Kreeftmeijer and Jeff Felchner. It is free software, and may be redistributed under the terms specified in the LICENSE file.
155
+ fuubar is Copyright &copy; 2010-2019 Jeff Kreeftmeijer and Jeff Felchner. It is
156
+ free software, and may be redistributed under the terms specified in the
157
+ [LICENSE][license] file.
158
+
159
+ [byebug]: https://github.com/deivid-rodriguez/byebug
160
+ [example-gif]: https://kompanee-public-assets.s3.amazonaws.com/readmes/fuubar-examples.gif
161
+ [jefff-profile]: https://github.com/jfelchner
162
+ [jeffk-profile]: https://github.com/jeffkreeftmeijer
163
+ [kompanee-logo]: https://kompanee-public-assets.s3.amazonaws.com/readmes/kompanee-horizontal-black.png
164
+ [kompanee-site]: http://www.thekompanee.com
165
+ [license]: https://github.com/thekompanee/fuubar/blob/master/LICENSE.txt
166
+ [pry]: https://github.com/pry/pry
167
+ [rpb-docs]: https://github.com/jfelchner/ruby-progressbar/wiki/Options
168
+ [rpb-github]: https://github.com/jfelchner/ruby-progressbar
169
+ [rspec]: https://github.com/rspec
@@ -5,7 +5,18 @@ require 'rspec/core/formatters/base_text_formatter'
5
5
  require 'ruby-progressbar'
6
6
  require 'fuubar/output'
7
7
 
8
- RSpec.configuration.add_setting :fuubar_progress_bar_options, :default => {}
8
+ RSpec.configuration.add_setting :fuubar_progress_bar_options, :default => {}
9
+ RSpec.configuration.add_setting :fuubar_auto_refresh, :default => true
10
+ RSpec.configuration.add_setting :fuubar_output_pending_results, :default => true
11
+
12
+ if Object.const_defined?('Pry')
13
+ Pry.
14
+ config.
15
+ hooks.
16
+ add_hook(:when_started, :fuubar_kill_refresh) do |_target, _opt, _|
17
+ RSpec.configuration.fuubar_auto_refresh = false
18
+ end
19
+ end
9
20
 
10
21
  class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
11
22
  DEFAULT_PROGRESS_BAR_OPTIONS = { :format => ' %c/%C |%w>%i| %e ' }.freeze
@@ -13,6 +24,7 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
13
24
  RSpec::Core::Formatters.register self,
14
25
  :close,
15
26
  :dump_failures,
27
+ :dump_pending,
16
28
  :example_failed,
17
29
  :example_passed,
18
30
  :example_pending,
@@ -51,16 +63,15 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
51
63
  self.passed_count = 0
52
64
  self.pending_count = 0
53
65
  self.failed_count = 0
54
- self.example_tick_thread = start_tick_thread(notification)
55
-
56
- if Object.const_defined?('Pry')
57
- Pry.
58
- config.
59
- hooks.
60
- add_hook(:when_started, :fuubar_kill_refresh) do |_target, _opt, _|
61
- example_tick_thread.kill
62
- end
63
- end
66
+ self.example_tick_thread = Thread.new do
67
+ loop do
68
+ sleep(1)
69
+
70
+ if configuration.fuubar_auto_refresh
71
+ example_tick(notification)
72
+ end
73
+ end
74
+ end # rubocop:disable Layout/BlockAlignment
64
75
 
65
76
  super
66
77
 
@@ -115,6 +126,12 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
115
126
  #
116
127
  end
117
128
 
129
+ def dump_pending(notification)
130
+ return unless configuration.fuubar_output_pending_results
131
+
132
+ super
133
+ end
134
+
118
135
  # rubocop:disable Naming/MemoizedInstanceVariableName
119
136
  def output
120
137
  @fuubar_output ||= Fuubar::Output.new(super, configuration.tty?)
@@ -163,14 +180,4 @@ class Fuubar < RSpec::Core::Formatters::BaseTextFormatter
163
180
  @continuous_integration ||= \
164
181
  ![nil, '', 'false'].include?(ENV['CONTINUOUS_INTEGRATION'])
165
182
  end
166
-
167
- def start_tick_thread(notification)
168
- Thread.new do
169
- loop do
170
- sleep(1)
171
-
172
- example_tick(notification)
173
- end
174
- end
175
- end
176
183
  end
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.3.2
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Evans
@@ -37,7 +37,7 @@ cert_chain:
37
37
  09JNgxpgZHCDuKwoycU+wXdWVSzMtchMQygnEu6th1SY5qHj4ISipBEBtKG0MdgB
38
38
  L3AbMAHTztj5YI+gvmpuV1B4Zv1QZjZWOeNSnLZdrnOQbyyDBzJyXmNV
39
39
  -----END CERTIFICATE-----
40
- date: 2018-08-03 00:00:00.000000000 Z
40
+ date: 2019-07-03 00:00:00.000000000 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec-core
@@ -73,42 +73,14 @@ dependencies:
73
73
  requirements:
74
74
  - - "~>"
75
75
  - !ruby/object:Gem::Version
76
- version: '3.0'
77
- type: :development
78
- prerelease: false
79
- version_requirements: !ruby/object:Gem::Requirement
80
- requirements:
81
- - - "~>"
82
- - !ruby/object:Gem::Version
83
- version: '3.0'
84
- - !ruby/object:Gem::Dependency
85
- name: chamber
86
- requirement: !ruby/object:Gem::Requirement
87
- requirements:
88
- - - "~>"
89
- - !ruby/object:Gem::Version
90
- version: '2.3'
91
- type: :development
92
- prerelease: false
93
- version_requirements: !ruby/object:Gem::Requirement
94
- requirements:
95
- - - "~>"
96
- - !ruby/object:Gem::Version
97
- version: '2.3'
98
- - !ruby/object:Gem::Dependency
99
- name: awesome_print
100
- requirement: !ruby/object:Gem::Requirement
101
- requirements:
102
- - - "~>"
103
- - !ruby/object:Gem::Version
104
- version: '1.7'
76
+ version: '3.7'
105
77
  type: :development
106
78
  prerelease: false
107
79
  version_requirements: !ruby/object:Gem::Requirement
108
80
  requirements:
109
81
  - - "~>"
110
82
  - !ruby/object:Gem::Version
111
- version: '1.7'
83
+ version: '3.7'
112
84
  description: the instafailing RSpec progress bar formatter
113
85
  email:
114
86
  - jeff@kreeftmeijer.nl
@@ -125,7 +97,12 @@ homepage: https://github.com/thekompanee/fuubar
125
97
  licenses:
126
98
  - MIT
127
99
  metadata:
128
- allowed_push_host: https://rubygems.org
100
+ bug_tracker_uri: https://github.com/thekompanee/fuubar/issues
101
+ changelog_uri: https://github.com/thekompanee/fuubar/blob/master/CHANGELOG.md
102
+ documentation_uri: https://github.com/thekompanee/fuubar/tree/releases/v2.4.0
103
+ homepage_uri: https://github.com/thekompanee/fuubar
104
+ source_code_uri: https://github.com/thekompanee/fuubar
105
+ wiki_uri: https://github.com/thekompanee/fuubar/wiki
129
106
  post_install_message:
130
107
  rdoc_options: []
131
108
  require_paths:
@@ -141,8 +118,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
141
118
  - !ruby/object:Gem::Version
142
119
  version: '0'
143
120
  requirements: []
144
- rubyforge_project:
145
- rubygems_version: 2.7.7
121
+ rubygems_version: 3.0.4
146
122
  signing_key:
147
123
  specification_version: 4
148
124
  summary: the instafailing RSpec progress bar formatter
metadata.gz.sig CHANGED
Binary file