rubycritic 4.2.2 → 4.3.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: 424498e508cb543906927834dd6226231c3602bf45a82ff7a4e0bf2cf14370db
4
- data.tar.gz: ab4853611bb576d549e600e211a5293104b7833f9829e4512983a8e6ed5af4ea
3
+ metadata.gz: 62ee34293c30117c1da578023a3e0c07987e8eab3635bdbdb968ce3bf5865307
4
+ data.tar.gz: 3e6ef1bca43844d501fe7eadef2becef64a31b5655e14806ff2e93c97d7ddaa7
5
5
  SHA512:
6
- metadata.gz: 18b1c8522388ab7faf98637915e5f5b198fc49a762f88727b73c3915dedb38d8099346885206ae33368274abd92d2eb7fb2f93914d6e0fb9084cc7fed50c8698
7
- data.tar.gz: 259b6c142432a85d6724d650f4868977c81c71978a9811b4fa337fce3b48aaf623bf42e64e3162a2511262fd6135eab4cff3441b6a3d9c9260bc911accfcd91e
6
+ metadata.gz: 8f76b61f6551397562efafeff70947289663fba7c13cf9a1d2c3bfa6eeae3cd41447d512f866b8ed079990ef2d2e31fdffa51110a255a7fc7e19f30299cddcd3
7
+ data.tar.gz: f456e3f523bafd22bd8760122f4fe9504ef1ea57afdc2edad73c3b3dc01083ab8ba26e6db0c584bb1eaff7eb4cdeb60d2f27f6472e3a310f3dc4180c24818350
data/CHANGELOG.md CHANGED
@@ -1,4 +1,9 @@
1
- # master [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.2.2...master)
1
+ # master [(unreleased)](https://github.com/whitesmith/rubycritic/compare/v4.3.0...master)
2
+
3
+ # v4.3.0 / 2019-23-26 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.2.2...v4.3.0)
4
+
5
+ * [FEATURE] Show which files are uncommited in git (by [@GeoffTidey][])
6
+ * [BUGFIX] Fixes TypeError when `.resultset.json` is not found (by [@etagwerker][])
2
7
 
3
8
  # v4.2.2 / 2019-11-12 [(commits)](https://github.com/whitesmith/rubycritic/compare/v4.2.1...v4.2.2)
4
9
 
@@ -306,3 +311,4 @@
306
311
  [@etagwerker]: https://github.com/etagwerker
307
312
  [@cvoltz]: https://github.com/cvoltz
308
313
  [@Adre]: https://github.com/Adre
314
+ [@GeoffTidey]: https://github.com/GeoffTidey
@@ -10,7 +10,7 @@ module RubyCritic
10
10
  # Complexity is reduced by a factor of 25 when calculating cost
11
11
  COMPLEXITY_FACTOR = 25.0
12
12
 
13
- attribute :coverage
13
+ attribute :coverage, Float, default: 0.0
14
14
  attribute :name
15
15
  attribute :smells_count
16
16
  attribute :file_location
@@ -52,11 +52,16 @@ module RubyCritic
52
52
  end
53
53
 
54
54
  def self.switch_branch(branch)
55
- uncommitted_changes? ? abort('Uncommitted changes are present.') : `git checkout #{branch}`
55
+ dirty = !uncommitted_changes.blank?
56
+ abort("Uncommitted changes are present: #{uncommitted_changes}") if dirty
57
+
58
+ git("checkout #{branch}")
56
59
  end
57
60
 
58
- def self.uncommitted_changes?
59
- !`git diff-index HEAD --`.empty?
61
+ def self.uncommitted_changes
62
+ return @uncommitted_changes if defined? @uncommitted_changes
63
+
64
+ @uncommitted_changes = git('diff-index HEAD --').chomp! || ''
60
65
  end
61
66
 
62
67
  def self.modified_files
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RubyCritic
4
- VERSION = '4.2.2'.freeze
4
+ VERSION = '4.3.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubycritic
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.2.2
4
+ version: 4.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Simoes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-12 00:00:00.000000000 Z
11
+ date: 2019-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: flay