clausewitz-spelling 0.2.18 → 0.2.22
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 +25 -25
- data/clausewitz-spelling.gemspec +1 -1
- data/lib/clausewitz/localisation.rb +8 -2
- data/lib/clausewitz/spelling/checker.rb +3 -3
- data/lib/clausewitz/spelling/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66e994d86e1b228992fd31667ba198ae660cbaee762d062c20c8ff1411f74f27
|
4
|
+
data.tar.gz: 517d3e13686eb64a9ea5838c977ea808ed170d1fca84a75d6b004bc59e59653a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ea9f582c79ce7422a50efa84b6ab7d8035a190a49d907136b26a230a5086f27205a587f3dfdca689e4b1d3c334a5d2334d4ac633f3aeda9cdd92b262f953ce3
|
7
|
+
data.tar.gz: 0636f4de76c9558434b5bf430a51ae76b8a6c4ae96829d062cc34677541a7e60ef7634d9f45c606c0c1115c51d27dc562d9a9bdc1aa50b60be10f203b2de6205
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
clausewitz-spelling (0.2.
|
4
|
+
clausewitz-spelling (0.2.22)
|
5
5
|
colorize
|
6
6
|
damerau-levenshtein
|
7
7
|
ffi-hunspell-wtchappell
|
@@ -11,45 +11,45 @@ PATH
|
|
11
11
|
GEM
|
12
12
|
remote: https://rubygems.org/
|
13
13
|
specs:
|
14
|
-
coderay (1.1.
|
14
|
+
coderay (1.1.3)
|
15
15
|
colorize (0.8.1)
|
16
|
-
damerau-levenshtein (1.3.
|
17
|
-
diff-lcs (1.
|
18
|
-
ffi (1.
|
16
|
+
damerau-levenshtein (1.3.3)
|
17
|
+
diff-lcs (1.4.4)
|
18
|
+
ffi (1.15.4)
|
19
19
|
ffi-hunspell-wtchappell (0.4.0)
|
20
20
|
ffi (~> 1.0)
|
21
|
-
method_source (0.
|
22
|
-
optimist (3.0.
|
23
|
-
pragmatic_tokenizer (3.0
|
21
|
+
method_source (1.0.0)
|
22
|
+
optimist (3.0.1)
|
23
|
+
pragmatic_tokenizer (3.2.0)
|
24
24
|
unicode
|
25
|
-
pry (0.
|
26
|
-
coderay (~> 1.1
|
27
|
-
method_source (~>
|
25
|
+
pry (0.14.1)
|
26
|
+
coderay (~> 1.1)
|
27
|
+
method_source (~> 1.0)
|
28
28
|
rake (10.5.0)
|
29
|
-
rspec (3.
|
30
|
-
rspec-core (~> 3.
|
31
|
-
rspec-expectations (~> 3.
|
32
|
-
rspec-mocks (~> 3.
|
33
|
-
rspec-core (3.
|
34
|
-
rspec-support (~> 3.
|
35
|
-
rspec-expectations (3.
|
29
|
+
rspec (3.10.0)
|
30
|
+
rspec-core (~> 3.10.0)
|
31
|
+
rspec-expectations (~> 3.10.0)
|
32
|
+
rspec-mocks (~> 3.10.0)
|
33
|
+
rspec-core (3.10.1)
|
34
|
+
rspec-support (~> 3.10.0)
|
35
|
+
rspec-expectations (3.10.1)
|
36
36
|
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
-
rspec-support (~> 3.
|
38
|
-
rspec-mocks (3.
|
37
|
+
rspec-support (~> 3.10.0)
|
38
|
+
rspec-mocks (3.10.2)
|
39
39
|
diff-lcs (>= 1.2.0, < 2.0)
|
40
|
-
rspec-support (~> 3.
|
41
|
-
rspec-support (3.
|
40
|
+
rspec-support (~> 3.10.0)
|
41
|
+
rspec-support (3.10.3)
|
42
42
|
unicode (0.4.4.4)
|
43
43
|
|
44
44
|
PLATFORMS
|
45
|
-
|
45
|
+
x86_64-linux
|
46
46
|
|
47
47
|
DEPENDENCIES
|
48
|
-
bundler
|
48
|
+
bundler
|
49
49
|
clausewitz-spelling!
|
50
50
|
pry
|
51
51
|
rake (~> 10.0)
|
52
52
|
rspec (~> 3.0)
|
53
53
|
|
54
54
|
BUNDLED WITH
|
55
|
-
|
55
|
+
2.2.33
|
data/clausewitz-spelling.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
|
23
|
-
spec.add_development_dependency "bundler"
|
23
|
+
spec.add_development_dependency "bundler"
|
24
24
|
spec.add_development_dependency "rake", "~> 10.0"
|
25
25
|
spec.add_development_dependency "rspec", "~> 3.0"
|
26
26
|
spec.add_development_dependency "pry"
|
@@ -83,7 +83,6 @@ module Clausewitz
|
|
83
83
|
current_lang = nil
|
84
84
|
text.lines.each do |line|
|
85
85
|
line.strip!
|
86
|
-
next if line.empty? || line =~ /^#/
|
87
86
|
lang_match = LANG_MAP.keys.find { |lang| line == "#{lang}:" }
|
88
87
|
if lang_match
|
89
88
|
current_lang = lang_match
|
@@ -93,13 +92,20 @@ module Clausewitz
|
|
93
92
|
errors = ["Cannot parse loc key without a langauge being set!"]
|
94
93
|
fail(UnparseableFileError, errors)
|
95
94
|
end
|
95
|
+
if line =~ /^#\s*spellcheck_ignore:/
|
96
|
+
current_ignores = contents[current_lang]["spellcheck_ignore"] || []
|
97
|
+
new_ignores = line.split(/:\s*/, 1)[1].split(',').map(&:strip)
|
98
|
+
current_ignores = (current_ignores + new_ignores).uniq
|
99
|
+
contents[current_lang]["spellcheck_ignore"] = current_ignores
|
100
|
+
end
|
101
|
+
next if line.empty? || line =~ /^#/
|
96
102
|
key, value = line.split(/\s/, 2)
|
97
103
|
key.gsub!(/:(\d+)?$/, '')
|
98
104
|
value.gsub!(/(^"|"$)/, '')
|
99
105
|
contents[current_lang] ||= {}
|
100
106
|
contents[current_lang][key] = value
|
101
107
|
end
|
102
|
-
|
108
|
+
contents
|
103
109
|
end
|
104
110
|
|
105
111
|
def self.pre_validate(text)
|
@@ -138,7 +138,7 @@ module Clausewitz; module Spelling
|
|
138
138
|
entry.gsub!(/\$([A-Z]|\||\d|=)+\$/, '')
|
139
139
|
|
140
140
|
# Remove other localisation bits we don't care about.
|
141
|
-
entry.gsub!(/§(%|\*|=|\d|
|
141
|
+
entry.gsub!(/§(%|\*|=|\d|[A-Za-z]|\+|-|!)/, '')
|
142
142
|
entry.gsub!(/(£|\$)\w+(\|.+\$)?/, '')
|
143
143
|
|
144
144
|
## We should also remove punctuation that is never part of words, like
|
@@ -257,8 +257,8 @@ module Clausewitz; module Spelling
|
|
257
257
|
|
258
258
|
# Make sure a file to be checked is actually present and readable.
|
259
259
|
def validate_filepath!(filepath)
|
260
|
-
|
261
|
-
|
260
|
+
puts ("No such file '#{filepath}'!") unless filepath.exist?
|
261
|
+
puts ("Cannot read '#{filepath}'!") unless filepath.readable?
|
262
262
|
end
|
263
263
|
end
|
264
264
|
end; end
|
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clausewitz-spelling
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Will Chappell
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,7 +136,7 @@ dependencies:
|
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
|
-
description:
|
139
|
+
description:
|
140
140
|
email:
|
141
141
|
- wtchappell@gmail.com
|
142
142
|
executables:
|
@@ -167,7 +167,7 @@ homepage: http://github.com/wtchappell/clausewitz-spelling
|
|
167
167
|
licenses:
|
168
168
|
- MIT
|
169
169
|
metadata: {}
|
170
|
-
post_install_message:
|
170
|
+
post_install_message:
|
171
171
|
rdoc_options: []
|
172
172
|
require_paths:
|
173
173
|
- lib
|
@@ -182,8 +182,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
182
182
|
- !ruby/object:Gem::Version
|
183
183
|
version: '0'
|
184
184
|
requirements: []
|
185
|
-
rubygems_version: 3.
|
186
|
-
signing_key:
|
185
|
+
rubygems_version: 3.2.29
|
186
|
+
signing_key:
|
187
187
|
specification_version: 4
|
188
188
|
summary: Spellchecker tool for Clausewitz engine files
|
189
189
|
test_files: []
|