greener 0.0.1.1 → 0.0.1.2

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: a8ee00975481d14b7de2a3c4c5704e38e2ae7f8d
4
- data.tar.gz: e3b4e819ebbd7dffba73cbcce66537534b5e1a3c
3
+ metadata.gz: 4a4c2f033e269791bfbef80978c096695c6847f2
4
+ data.tar.gz: 7647963368a1e66d16664b7660c40979b5fb560e
5
5
  SHA512:
6
- metadata.gz: 018e3986bb9ae95dcaf5101190865c62d562b27724639b294990252d1e2b3ee7385f5f3b0e2f4a127ac10100b2eb5f8506d47bde510d6e62dd37af89f5be4ce2
7
- data.tar.gz: f6ffa76be7bdfbca5ac6b1586691ee5ceaaa34f9d1090015388759d602d990e8c452dcd005903826ddfc79df3acac71caf1979007fffafd47376cf54a75b9b07
6
+ metadata.gz: 41e90af06a1f0355c7499a833aaf30bc1c30c633659b769f0dc8c102707916c199e5a4ba117d99c3ddb47fce7e8d3602629fce1898992c9f1539ba7bc9a18792
7
+ data.tar.gz: 733319f7a35759b6017c23c7443dc9df85df46daafa862cc091bdaab7f3c3384f12696c286a28df33fccae7705d290b8d7622011635b85270f9357f23479412a
@@ -84,7 +84,7 @@ module Greener
84
84
 
85
85
  hash["Include"].each { |glob| includes += files_matching_glob(glob) } if hash["Include"]
86
86
  hash["Exclude"].each { |glob| excludes += files_matching_glob(glob) } if hash["Exclude"]
87
- @files = includes - excludes
87
+ @files = (includes - excludes).uniq
88
88
  end
89
89
 
90
90
  def default_absolute_path
@@ -1,3 +1,7 @@
1
1
  module Greener
2
2
  class CustomError < StandardError; end
3
+
4
+ module Error
5
+ class LintFailed < Greener::CustomError; end
6
+ end
3
7
  end
@@ -30,9 +30,7 @@ module Greener
30
30
  puts ""
31
31
  end
32
32
 
33
- conclusion = @results.empty? ? "no offenses detected" : "#{@results.count} offense(s) detected"
34
-
35
- puts "#{@config.files.count} file(s) inspected, #{conclusion}"
33
+ print_final_line
36
34
  end
37
35
 
38
36
  private
@@ -49,5 +47,13 @@ module Greener
49
47
  @results += checker.violations
50
48
  end
51
49
  end
50
+
51
+ def print_final_line
52
+ conclusion = @results.empty? ? "no offenses detected" : "#{@results.count} offense(s) detected"
53
+
54
+ res = "#{@config.files.count} file(s) inspected, #{conclusion}"
55
+ return puts(res) if @results.empty?
56
+ fail Greener::Error::LintFailed, res
57
+ end
52
58
  end
53
59
  end
@@ -1,4 +1,4 @@
1
1
  # Gem version
2
2
  module Greener
3
- VERSION = "0.0.1.1"
3
+ VERSION = "0.0.1.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greener
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.1
4
+ version: 0.0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - smoll