fix 0.9.1 → 0.10.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: dd360d19130573cc3f1739c92b36968035052098
4
- data.tar.gz: dab9e988bf108c9990a91199d4759ffb9d2f575d
3
+ metadata.gz: eae82f600d8eeae1817987ea21a0d4377ffda7da
4
+ data.tar.gz: de7db5c010702f6e1623275f0d7e2f294582ca43
5
5
  SHA512:
6
- metadata.gz: 4d8d7024d99161e350e009a6619b6a96f8bcbd33bd2af5840ea00590ed43a9054af1a7677d0cf4718df38391907e26b3178cbcf94f72a8c49d913d8a69b8bbe5
7
- data.tar.gz: ccc657af7b9b2697c9ed12689b6946ecf97cc15764e33267c242989058d64042362326bd64c9f45db7c5c14aa1c21d27861e22601c44120ce5ea08332e7feab1
6
+ metadata.gz: defc73b6383bcfb2607e5b842ac1490dcffadfd1429f250459721b64c52b6e48f7f0b37c021cbde0d777abced316128f859a57ed962eb5d3695000b35086a583
7
+ data.tar.gz: 0bff3242e83234ab17e743f16776ead4ded7b2fd8753f92ebc6f5d3c2e87a4012efb79d2b09419ad2e7ab25ce19c60a396d6bcec26584273228df3aeddd4e896
Binary file
data.tar.gz.sig CHANGED
@@ -1,2 +1,4 @@
1
- Sj3�+N�\����^uh��vqA#�k�nPJ�_�n�a�y��CyV�!
2
- �a������nMB�j�/Nag&d�0x
1
+ pUMv¯���W��^�C�/Q��|
2
+ �#�c���El\2�{S� ։�~����"�H�uD��nh�����X�w~�Y��=����jD���0�(,��gW�Z'+C��+3|�O"���Y�X�����&����)�:L�Ɣ�j�a&g
3
+ +��?m�[8:B�p���͌f�yC֓
4
+ �#!r~Y
@@ -1 +1 @@
1
- 0.9.1
1
+ 0.10.0
@@ -0,0 +1 @@
1
+ c1529ea230a72517e4d15da268661f0c06c0294f456e2bec9dcb455fd85febda7de4237466414d02a662e3a2b370471d20852138f45fc3fbb5d8fef270d9e356
@@ -15,13 +15,13 @@ Gem::Specification.new do |spec|
15
15
  spec.require_paths = ['lib']
16
16
 
17
17
  spec.add_dependency 'defi', '~> 1.1.0'
18
- spec.add_dependency 'spectus', '~> 2.4.0'
18
+ spec.add_dependency 'spectus', '~> 2.7.0'
19
19
 
20
20
  spec.add_development_dependency 'bundler', '~> 1.10'
21
21
  spec.add_development_dependency 'rake', '~> 10.4'
22
22
  spec.add_development_dependency 'yard', '~> 0.8'
23
23
  spec.add_development_dependency 'simplecov', '~> 0.10'
24
- spec.add_development_dependency 'rubocop', '~> 0.33'
24
+ spec.add_development_dependency 'rubocop', '~> 0.34'
25
25
 
26
26
  spec.cert_chain = ['certs/gem-fixrb-public_cert.pem']
27
27
  private_key = File.expand_path('~/.ssh/gem-fixrb-private_key.pem')
@@ -23,7 +23,10 @@ module Fix
23
23
  f
24
24
  end
25
25
 
26
- print result.to_char if @configuration.fetch(:verbose, true)
26
+ if @configuration.fetch(:verbose, true)
27
+ print result.to_char(@configuration.fetch(:color, false))
28
+ end
29
+
27
30
  results << result
28
31
  end
29
32
  end
@@ -40,7 +40,7 @@ module Fix
40
40
 
41
41
  # @private
42
42
  def alerts
43
- test.results.reject { |r| r.to_char == '.' }
43
+ test.results.reject { |r| r.to_sym.equal?(:success) }
44
44
  end
45
45
 
46
46
  # @private
@@ -51,7 +51,19 @@ module Fix
51
51
  # @private
52
52
  def results_banner
53
53
  alerts.map.with_index(1) do |r, i|
54
- "#{i}. #{r.message}\n" + maybe_backtrace(r)
54
+ s = "#{i}. #{r.message}\n" + maybe_backtrace(r)
55
+
56
+ next s unless @test.configuration.fetch(:color)
57
+
58
+ if r.to_sym.equal?(:success)
59
+ "\e[32m#{s}\e[0m"
60
+ elsif r.to_sym.equal?(:info)
61
+ "\e[33m#{s}\e[0m"
62
+ elsif r.to_sym.equal?(:failure)
63
+ "\e[35m#{s}\e[0m"
64
+ else
65
+ "\e[31m#{s}\e[0m"
66
+ end
55
67
  end
56
68
  end
57
69
 
@@ -62,10 +74,24 @@ module Fix
62
74
 
63
75
  # @private
64
76
  def statistics_banner
65
- "#{test.statistics.fetch(:pass_percent)}% compliant - " \
66
- "#{test.statistics.fetch(:total_infos)} infos, " \
67
- "#{test.statistics.fetch(:total_failures)} failures, " \
68
- "#{test.statistics.fetch(:total_errors)} errors\n"
77
+ s = "#{test.statistics.fetch(:pass_percent)}% compliant - " \
78
+ "#{test.statistics.fetch(:total_infos)} infos, " \
79
+ "#{test.statistics.fetch(:total_failures)} failures, " \
80
+ "#{test.statistics.fetch(:total_errors)} errors\n"
81
+
82
+ return s unless @test.configuration.fetch(:color)
83
+
84
+ stats = test.statistics
85
+
86
+ if stats.fetch(:total_errors) > 0
87
+ "\e[31m#{s}\e[0m"
88
+ elsif stats.fetch(:total_failures) > 0
89
+ "\e[35m#{s}\e[0m"
90
+ elsif stats.fetch(:total_infos) > 0
91
+ "\e[33m#{s}\e[0m"
92
+ else
93
+ "\e[32m#{s}\e[0m"
94
+ end
69
95
  end
70
96
  end
71
97
  end
@@ -13,7 +13,7 @@ module Fix
13
13
  # @param options [Hash] Some options.
14
14
  # @param specs [Proc] The specs to test against the object.
15
15
  def initialize(front_object, options = {}, &specs)
16
- @configuration = { verbose: true }
16
+ @configuration = { verbose: true, color: false }
17
17
  @configuration.update(options)
18
18
 
19
19
  start_time = Time.now
@@ -46,9 +46,9 @@ module Fix
46
46
  def statistics
47
47
  {
48
48
  pass_percent: pass_percent,
49
- total_infos: results.count { |r| r.to_char == 'I' },
50
- total_failures: results.count { |r| r.to_char == 'F' },
51
- total_errors: results.count { |r| r.to_char == 'E' }
49
+ total_infos: results.count { |r| r.to_sym.equal?(:info) },
50
+ total_failures: results.count { |r| r.to_sym.equal?(:failure) },
51
+ total_errors: results.count { |r| r.to_sym.equal?(:error) }
52
52
  }
53
53
  end
54
54
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cyril Wack
@@ -30,7 +30,7 @@ cert_chain:
30
30
  dzJvWzQ1+dJU6WQv75E9ddSkaQrK3nhdgQVu+/wgvGSrsMvOGNz+LXaSDxQqZuwX
31
31
  0KNQFuIukfrdk8URwRnHoAnvx4U93iUw
32
32
  -----END CERTIFICATE-----
33
- date: 2015-09-11 00:00:00.000000000 Z
33
+ date: 2015-09-13 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: defi
@@ -52,14 +52,14 @@ dependencies:
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: 2.4.0
55
+ version: 2.7.0
56
56
  type: :runtime
57
57
  prerelease: false
58
58
  version_requirements: !ruby/object:Gem::Requirement
59
59
  requirements:
60
60
  - - "~>"
61
61
  - !ruby/object:Gem::Version
62
- version: 2.4.0
62
+ version: 2.7.0
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: bundler
65
65
  requirement: !ruby/object:Gem::Requirement
@@ -122,14 +122,14 @@ dependencies:
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: '0.33'
125
+ version: '0.34'
126
126
  type: :development
127
127
  prerelease: false
128
128
  version_requirements: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - "~>"
131
131
  - !ruby/object:Gem::Version
132
- version: '0.33'
132
+ version: '0.34'
133
133
  description: Specing framework for Ruby.
134
134
  email:
135
135
  - contact@cyril.email
@@ -153,6 +153,7 @@ files:
153
153
  - checksum/fix-0.7.0.gem.sha512
154
154
  - checksum/fix-0.8.0.gem.sha512
155
155
  - checksum/fix-0.9.0.gem.sha512
156
+ - checksum/fix-0.9.1.gem.sha512
156
157
  - fix.gemspec
157
158
  - lib/fix.rb
158
159
  - lib/fix/helpers/it_helper.rb
metadata.gz.sig CHANGED
Binary file