chutney 3.0.0 → 3.0.1

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
  SHA256:
3
- metadata.gz: a489eb526fae6a79ff386986463cf473aa4f5bc353448e99338781556f7fd194
4
- data.tar.gz: 5cd7a3264aba055c8fe738147edfa661f57e2c0e258d5991b42adbfb2af45f05
3
+ metadata.gz: da2d0aa4432eaa81b87b877c67dcada20758c521f193cfca6a91a83904ea209a
4
+ data.tar.gz: 1e2c22d44911f0816e0e28504c8a465105edf406848ea15305ef25af470c95d3
5
5
  SHA512:
6
- metadata.gz: 9fb8325c116764fadd900b0b98961eca7cf95f49ac171ef64e77e29f1806d6ff78bcca90ea9e2119320d33d81b13e67749fb3bf8e916df13e154871b54602b35
7
- data.tar.gz: 8290dd430b9b55c900179717c3b3fcd83ea805e9142751dec8c69ae4c1e2233a3d5392d8951705a3fed0678b3a9fd768941889b5e9086465fa54ced8c43b1811
6
+ metadata.gz: f9f1821d7d97ab7fc2f67cdc6e33d4f5ff94d4a1b7e20017bfe71b3b784697e54c3493d91812412dcfda8b18f54a756a8232e36c53ac653a99b34d97eaaefa76
7
+ data.tar.gz: eebac54200ed820084c183ab48eeb538aacec5a93ff4eef09552fa4917ec65d76e0c12e266689ecb149c9b0ab0fd93d178a405822fa4010c904bb21a4ff9c4d1
@@ -6,10 +6,6 @@ require 'tty/pie'
6
6
  module Chutney
7
7
  # format results as pie charts
8
8
  class PieFormatter < Formatter
9
- def initialize
10
- super
11
- end
12
-
13
9
  def format
14
10
  data = top_offences.map do |offence|
15
11
  {
@@ -127,10 +127,11 @@ module Chutney
127
127
  end
128
128
 
129
129
  def off_switch?(element = feature)
130
+ # require 'pry'; binding.pry
130
131
  off_switch = element.tags
132
+ .map(&:name)
131
133
  .then { |tags| tags || [] }
132
- .filter { |tag| tag[:type] == :Tag }
133
- .filter { |tag| tag[:name] == "@disable#{linter_name}" }
134
+ .filter { |tag_name| tag_name == "@disable#{linter_name}" }
134
135
  .count
135
136
  .positive?
136
137
  off_switch ||= off_switch?(feature) unless element == feature
@@ -138,16 +139,21 @@ module Chutney
138
139
  end
139
140
 
140
141
  def background
142
+ return unless feature&.background
143
+ return if off_switch?(feature)
144
+
141
145
  if block_given?
142
- yield(feature, feature&.background)
146
+ yield(feature, feature.background)
143
147
  else
144
- feature&.background
148
+ feature.background
145
149
  end
146
150
  end
147
151
 
148
152
  def scenarios
149
153
  if block_given?
150
154
  feature&.tests&.each do |test|
155
+ next if off_switch?(test)
156
+
151
157
  yield(feature, test)
152
158
  end
153
159
 
@@ -169,8 +175,12 @@ module Chutney
169
175
  end
170
176
 
171
177
  def steps
172
- feature&.tests&.each do |t|
173
- t.steps.each { |s| yield(feature, t, s) }
178
+ feature&.tests&.each do |test|
179
+ next if off_switch?(test)
180
+
181
+ test.steps.each do |step|
182
+ yield(feature, test, step)
183
+ end
174
184
  end
175
185
  end
176
186
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Chutney
4
- VERSION = '3.0.0'
4
+ VERSION = '3.0.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chutney
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nigel Brookes-Thomas
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2020-09-23 00:00:00.000000000 Z
14
+ date: 2020-09-29 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: amatch