clausewitz-spelling 0.2.3 → 0.2.4

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
  SHA256:
3
- metadata.gz: cc8fdce4a42ffacd2b315b506c48e4d10cab6fedc33727c14acfa21f53222fd5
4
- data.tar.gz: a3b5b208d6707d52e364c7afea4d430a11cb3e0740db23e27a5df7cf4c7beff9
3
+ metadata.gz: 72934fe1a38a001b59b01610c918b4d1fc721b1bad7c93d88b98e29de27c5afa
4
+ data.tar.gz: 58a8843c180c16feb72ffa296063d0f102c91f453334783370fe0c179b8d24fc
5
5
  SHA512:
6
- metadata.gz: 75931cc9b6f7b80b5b82605aa5126e64ece40f3a9b65dad26fa6da81b20f189c2ee4f8b11ba7dbb76fc81c836e8ec61e619382a2385c465df224dbc74e23a001
7
- data.tar.gz: 8a4467800b1ca58653a3b9bded35813f6d47d2d25ec55bf5352c59a41f6d2967798d9331af924a8cd2fb9b85963d71f974c864c1e3dee93c29d04ab44199482b
6
+ metadata.gz: e63d6154357dc6b659189f5b0af701933e5cffb7f80d18f57d66726d3bd5c939d808f186184cff799c129aaaa014b820af5fa6aecac1da8636b6a7e9b89dea48
7
+ data.tar.gz: e13bc6151cc4e6f7a025a36d6ed0c766b075ffd66f4bab4e4adc97f3ae73c352b5c6d7357dd0227dd249f8eb7f61d7dd41dfbf8770b561a517ff3822f26a145f
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- clausewitz-spelling (0.2.3)
4
+ clausewitz-spelling (0.2.4)
5
5
  colorize
6
6
  damerau-levenshtein
7
7
  ffi-hunspell-wtchappell
@@ -18,6 +18,9 @@ class Main
18
18
  opt :suggestion_count,
19
19
  "How many suggestions to display",
20
20
  type: :int
21
+ opt :verbose,
22
+ "Whether to display additional output while running",
23
+ default: false
21
24
  Clausewitz::Localisation::LANG_MAP.each do |_, config|
22
25
  opt "#{config.name}_dialect".to_sym,
23
26
  "Select dialect for #{config.name.capitalize}",
@@ -39,6 +42,7 @@ class Main
39
42
  checker_opts[:custom_dicts] = opts[:custom_dicts]
40
43
  checker_opts[:dialect_map] = dialect_map
41
44
  checker_opts[:suggestion_count] = opts[:suggestion_count]
45
+ checker_opts[:verbose] = opts[:verbose]
42
46
 
43
47
  [checker_opts, args]
44
48
  end
@@ -19,6 +19,7 @@ module Clausewitz; module Spelling
19
19
  @custom_dicts = opts[:custom_dicts] || []
20
20
  @dialect_map = opts[:dialect_map] || {}
21
21
  @suggestion_count = opts[:suggestion_count] || DEFAULT_SUGGESTION_COUNT
22
+ @verbose = opts[:verbose]
22
23
 
23
24
  load_dictionaries!
24
25
  end
@@ -47,6 +48,7 @@ module Clausewitz; module Spelling
47
48
  end
48
49
 
49
50
  def check_file(filepath)
51
+ puts "Checking file '#{filepath}'..." if @verbose
50
52
  results = []
51
53
  begin
52
54
  filepath = Pathname.new(filepath)
@@ -102,6 +104,7 @@ module Clausewitz; module Spelling
102
104
 
103
105
  # Remove other localisation bits we don't care about.
104
106
  entry.gsub!(/§(%|\*|=|\d|W|G|R|B|Y|b|M|g|T|l|H|\+|-|!)/, '')
107
+ entry.gsub!(/£\w+/, '')
105
108
 
106
109
  ## We should also remove punctuation that is never part of words, like
107
110
  ## exclamation points, commas, semi-colons, and question marks.
@@ -154,7 +157,6 @@ module Clausewitz; module Spelling
154
157
  return if is_plural_number?(word)
155
158
  return if is_ordinal?(word)
156
159
  return if is_percentage?(word)
157
- return if is_icon?(word)
158
160
  return if is_initial?(word)
159
161
  return if is_psalm?(word)
160
162
  return if is_tag?(word)
@@ -198,7 +198,8 @@ module Clausewitz; module Spelling
198
198
  spacer = ' ' * indent
199
199
  secondspacer = ' ' * (indent + 2)
200
200
  "#{spacer}#{@filepath} could not be parsed\n".red +
201
- "#{secondspacer}#{@error.message}".red
201
+ "#{secondspacer}#{@error.message}\n".red +
202
+ "Make sure every entry has exactly two spaces in front of it.".red
202
203
  end
203
204
  end
204
205
  end; end # Clausewitz::Spelling
@@ -1,5 +1,5 @@
1
1
  module Clausewitz
2
2
  module Spelling
3
- VERSION = "0.2.3"
3
+ VERSION = "0.2.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: clausewitz-spelling
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Chappell
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-06-16 00:00:00.000000000 Z
11
+ date: 2019-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler