skunk 0.1.0 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9792e73da1c20854f3eb7f9f96af486132bf2e2cca8a7f3aadd6038487ec7ef0
4
- data.tar.gz: 5cb6a6c3bfd1b009db448b3584a7871452753a124540da96d5b448eec20191e2
3
+ metadata.gz: ef09af7a1b681dd7ed6c4d647722be36f1f31fb1475127bf7179f74a8387b2b1
4
+ data.tar.gz: 02d009e31e053fc944efcff71d87688e9132509fc9911948245a83cc559b4107
5
5
  SHA512:
6
- metadata.gz: 333bf77a14154f09e8ed7f205bfc3b93845788da9ac0088e66b2a3269c858184234cd5efa5eec92371ee74d22e568bff86f360d371622f24e446153bd5d7c89b
7
- data.tar.gz: 997bad01c5e50c8b936f9364e497dbff9f99cff76c352c51f44f43922f4073ae1378d21177f52c786b3555cb09296eb8daed6b492ddbabfe808c2bcecb9db980
6
+ metadata.gz: 116a79026c8c16e72012063e5d59b5191f21ca57115fbbe810d44ce03608284ec1090e71e14e0e828411ea779e7593d8408967e80d34851cfc1630f3d7c191d9
7
+ data.tar.gz: 546637856b882b66d974110e7dc7756166fdcd194d4ab351888f75664460e25bd4356e3002e3756f0ea6c3614fec992a693b52681f4fe0374339397892cc5ee4
data/CHANGELOG.md ADDED
@@ -0,0 +1,16 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.2.0] - 2019-10-15
10
+ ### Changed
11
+ - Now `skunk` will not report status for files that start with `test/` or `spec/`
12
+
13
+ ## [0.1.0] - 2019-10-15
14
+ ### Added
15
+ - Now `skunk` uses `rubycritic-simplecov` to generate a console report with a list
16
+ of files and their "StinkScore"
@@ -16,7 +16,7 @@ module Skunk
16
16
  def update_status_message
17
17
  opts = table_options.merge(headings: HEADINGS, rows: table)
18
18
 
19
- ttable = Terminal::Table.new(opts)
19
+ ttable = Terminal::Table.new(opts)
20
20
 
21
21
  @status_message = "#{ttable}\n\n"
22
22
 
@@ -29,7 +29,11 @@ module Skunk
29
29
  private
30
30
 
31
31
  def analysed_modules_count
32
- @analysed_modules_count ||= analysed_modules.count
32
+ @analysed_modules_count ||= non_test_modules.count
33
+ end
34
+
35
+ def non_test_modules
36
+ @non_test_modules ||= analysed_modules.reject { |x| x.pathname.to_s.start_with?("test", "spec")}
33
37
  end
34
38
 
35
39
  def worst
@@ -37,15 +41,15 @@ module Skunk
37
41
  end
38
42
 
39
43
  def sorted_modules
40
- @sorted_modules ||= analysed_modules.sort_by(&:stink_score).reverse!
44
+ @sorted_modules ||= non_test_modules.sort_by(&:stink_score).reverse!
41
45
  end
42
46
 
43
47
  def total_stink_score
44
- @total_stink_score ||= analysed_modules.map(&:stink_score).inject(0.0, :+)
48
+ @total_stink_score ||= non_test_modules.map(&:stink_score).inject(0.0, :+)
45
49
  end
46
50
 
47
51
  def total_churn_times_cost
48
- analysed_modules.map(&:churn_times_cost).sum
52
+ non_test_modules.map(&:churn_times_cost).sum
49
53
  end
50
54
 
51
55
  def stink_score
@@ -43,9 +43,5 @@ module RubyCritic
43
43
  safe_churn = churn > 0 ? churn : 1
44
44
  @churn_times_cost ||= safe_churn * cost
45
45
  end
46
-
47
- def method_name
48
-
49
- end
50
46
  end
51
47
  end
data/lib/skunk/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Skunk
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: skunk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ernesto Tagwerker
@@ -176,6 +176,7 @@ files:
176
176
  - ".reek.yml"
177
177
  - ".rubocop.yml"
178
178
  - ".rubocop_todo.yml"
179
+ - CHANGELOG.md
179
180
  - Gemfile
180
181
  - Gemfile.lock
181
182
  - README.md