schmurfy-bacon 1.4.9 → 1.5.0

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
  SHA1:
3
- metadata.gz: e4abce2d3e72e41bd4bde3847cea09d657bcc92b
4
- data.tar.gz: 7b4fc2919a6a24dc7fa908956a618bc22d1ec739
3
+ metadata.gz: a528245ce5236bc7d393a4fcc2814b25e887e539
4
+ data.tar.gz: 6e30b927e619f4d3e97d00649126e79729ed22a4
5
5
  SHA512:
6
- metadata.gz: 32f5e4950ddbff9d36d71526464f3c90a10cde13924c211d365b298836ee3ccb7e7e41a10baa27cc10d7d153f0ad062f9aac530b740448cc6700454c0314335f
7
- data.tar.gz: e9f6d1149cebd13fbdadf09be1e944a3b47b1356e186606ca46875baca4d8b653b3c3ad97c61ee49d92e1355e232b19d364c3b131bff2cbbd7addf6f67de5909
6
+ metadata.gz: d4f0c06669923e989e26bf802e7412cbcd5527fd93f068c3e4c6d3cea0ff234b3fdbdb44d0dbea1f580f0274a17d7e23926e62ad377d97389948f9b53ffd7f63
7
+ data.tar.gz: 486e17393476b8b902ab9ce63189cda45f5c693b00412ff03cb292aae8b648ff00a8a2b31b7d7dd6bf1ede4658804ae9ac04f60798162282784c33f45f25c63f
data/bacon.gemspec CHANGED
@@ -21,6 +21,7 @@ http://github.com/chneukirchen/bacon
21
21
  s.test_files = []
22
22
 
23
23
  s.add_dependency 'term-ansicolor'
24
+ s.add_dependency 'hitimes', '~> 1.2.2'
24
25
 
25
26
 
26
27
  s.author = 'Christian Neukirchen'
data/lib/bacon.rb CHANGED
@@ -7,6 +7,8 @@
7
7
  # Bacon is freely distributable under the terms of an MIT-style license.
8
8
  # See COPYING or http://www.opensource.org/licenses/mit-license.php.
9
9
 
10
+ require 'hitimes'
11
+
10
12
  module Bacon
11
13
  Counter = Hash.new(0)
12
14
  ErrorLog = ""
@@ -109,17 +111,19 @@ module Bacon
109
111
  end
110
112
 
111
113
  def run_requirement(description, spec)
112
- Bacon.handle_requirement description do
114
+ Bacon.handle_requirement description do |timing|
113
115
  begin
114
116
  Counter[:depth] += 1
115
117
  rescued = false
116
118
  begin
117
119
  prev_req = nil
118
120
 
119
- execute_spec do
120
- @before.each { |block| instance_eval(&block) }
121
- prev_req = Counter[:requirements]
122
- instance_eval(&spec)
121
+ timing << Hitimes::Interval.measure do
122
+ execute_spec do
123
+ @before.each { |block| instance_eval(&block) }
124
+ prev_req = Counter[:requirements]
125
+ instance_eval(&spec)
126
+ end
123
127
  end
124
128
  rescue Object => e
125
129
  rescued = true
data/lib/bacon/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Bacon
2
- VERSION = "1.4.9"
2
+ VERSION = "1.5.0"
3
3
  end
@@ -13,14 +13,16 @@ module BetterOutput
13
13
 
14
14
  def handle_requirement(description)
15
15
  print "#{spaces} ~ #{description}"
16
- error_type, err = yield
16
+ timing = []
17
+ error_type, err = yield(timing)
17
18
 
18
19
  # goto beginning of line
19
20
  print "\e[G\e[K"
20
21
 
21
22
  case error_type
22
23
  when ""
23
- puts "#{spaces} #{Color.green}✔#{Color.reset} #{description}"
24
+ duration = (timing[0] * 1000).to_i
25
+ puts "#{spaces} #{Color.green}✔#{Color.reset} #{description} [#{duration} ms]"
24
26
 
25
27
  when :failed
26
28
  puts "#{spaces} #{Color.red}✘#{Color.reset} #{description}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schmurfy-bacon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.9
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Neukirchen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-08-11 00:00:00.000000000 Z
11
+ date: 2014-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: term-ansicolor
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: hitimes
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 1.2.2
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 1.2.2
27
41
  description: |
28
42
  Bacon is a small RSpec clone weighing less than 350 LoC but
29
43
  nevertheless providing all essential features.