clausewitz-spelling 0.1.7 → 0.1.8

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
  SHA1:
3
- metadata.gz: 66804d8bc78962331d3dddb0e4e983e56a106bac
4
- data.tar.gz: 71bd3664569c2d32c4f07b6f33a94f73df2c4450
3
+ metadata.gz: 6f8c556909a39c8688c055fa38b876b59d453c0c
4
+ data.tar.gz: 1a580f4bc9a6daa78d5a17ad929f363b20b159d8
5
5
  SHA512:
6
- metadata.gz: 5670f8cc682d9dfbc0c4753165d3247ec027910922268e8c35c8f99605d4c94ddacdf97f5f107f88d841f47c8e56754dcd2baf58aae6878fdfa7073997330e32
7
- data.tar.gz: 725e82c9bf1b900ece56e839278680ca3aac143437c6dfc0561eaa2e577adcb2f9220a2ba00413c92a1aa67f25bb468648fac7746e79c8cf3bbc70f76af17010
6
+ metadata.gz: 3bffe4c8fc273e9f1e429885d2e8d3ca3d7169800999593adea3e09fd9aff507dedf14fa11a945251dce89f0b31a1c774574ab7971d6764f99f99365350fbd02
7
+ data.tar.gz: 34c8ae8e4830ea1fc4a901e017324caf2b6ebc5f56d71392910b11b36fe1947e456c6fd244f40242916db8ac9f69dcc8d54d5ef6dc36c1ea2b835d3bfa3a8cf9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clausewitz-spelling (0.1.7)
4
+ clausewitz-spelling (0.1.8)
5
5
  colorize
6
6
  damerau-levenshtein
7
7
  ffi-aspell
@@ -57,9 +57,9 @@ module Clausewitz; module Spelling
57
57
  end
58
58
  FileResults.new(file_path, results)
59
59
  end
60
- rescue Psych::SyntaxError
60
+ rescue Psych::SyntaxError => e
61
61
  # If we fail to load the file it's probably busted.
62
- BadFormatFileResult.new(file_path)
62
+ BadFormatFileResult.new(file_path, e)
63
63
  end
64
64
 
65
65
  def check_files(file_paths)
@@ -33,20 +33,21 @@ module Clausewitz; module Spelling
33
33
  lang.key_results.empty?
34
34
  end
35
35
  successful.each do |lang|
36
- puts " #{@file_path}:#{lang.lang} passed".green
36
+ puts " #{@file_path.yellow}:#{lang.lang.yellow} #{'passed'.green}"
37
37
  end
38
38
  failed.each do |lang|
39
39
  failed_count = lang.key_results.size.to_s.red
40
- puts " #{@file_path}:#{lang.lang} has #{failed_count} langs with errors:"
40
+ puts " #{@file_path.yellow}:#{lang.lang.yellow} has #{failed_count} keys with errors:"
41
41
  lang.key_results.each(&:render)
42
42
  end
43
43
  end
44
44
  end
45
45
 
46
46
  class BadFormatFileResult
47
- attr_reader :file_path
48
- def initialize(file_path)
47
+ attr_reader :file_path, :error
48
+ def initialize(file_path, error)
49
49
  @file_path = file_path
50
+ @error = error
50
51
  end
51
52
 
52
53
  def failed?
@@ -54,8 +55,8 @@ module Clausewitz; module Spelling
54
55
  end
55
56
 
56
57
  def render
57
- puts " #{@file_path} appears to be formatted incorrectly!".red
58
- puts " Make sure that each loc key has *two* leading *spaces*.".yellow
58
+ puts " #{@file_path.yellow} #{'appears to be formatted incorrectly:'.red}"
59
+ puts " #{@error.message.red}"
59
60
  end
60
61
  end
61
62
 
@@ -71,7 +72,7 @@ module Clausewitz; module Spelling
71
72
  end
72
73
 
73
74
  def render
74
- puts " #{@file_path} has unknown language keys!".red
75
+ puts " #{@file_path.yellow} #{'has unknown language keys!'.red}"
75
76
  puts " Make sure that each loc key has *two* leading *spaces*.".yellow
76
77
  end
77
78
  end
@@ -1,5 +1,5 @@
1
1
  module Clausewitz
2
2
  module Spelling
3
- VERSION = "0.1.7"
3
+ VERSION = "0.1.8"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clausewitz-spelling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Chappell