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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/clausewitz/spelling/checker.rb +2 -2
- data/lib/clausewitz/spelling/results.rb +8 -7
- data/lib/clausewitz/spelling/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f8c556909a39c8688c055fa38b876b59d453c0c
|
4
|
+
data.tar.gz: 1a580f4bc9a6daa78d5a17ad929f363b20b159d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bffe4c8fc273e9f1e429885d2e8d3ca3d7169800999593adea3e09fd9aff507dedf14fa11a945251dce89f0b31a1c774574ab7971d6764f99f99365350fbd02
|
7
|
+
data.tar.gz: 34c8ae8e4830ea1fc4a901e017324caf2b6ebc5f56d71392910b11b36fe1947e456c6fd244f40242916db8ac9f69dcc8d54d5ef6dc36c1ea2b835d3bfa3a8cf9
|
data/Gemfile.lock
CHANGED
@@ -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
|
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}
|
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
|
58
|
-
puts "
|
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!
|
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
|