spellr 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/spellr/reporter.rb +20 -0
- data/lib/spellr/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e09ecd923199d9533b1aa92210b6c4f8b02c03f3c4f420a46fd1519248556bff
|
4
|
+
data.tar.gz: ad58ff25a6c0e96598da4dc0bf86f6f380132be18866ff3c861237190aea4e71
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a47ec69ccdb59b1de84f509ec25457331b8b9306bb566e7f34a13872d36bd7a7d288e61eb73e96674da2fc1730f7cc41f250f8894457a97f02d656fbd3bfb9ca
|
7
|
+
data.tar.gz: a792a72098ec9601a06c2eacb279db00fc87a3b6e232d5466a896070420103115ae63f0699ce1de79a185839270c8b6b3d6bc0ca2b2ca100394079da4a6721ba
|
data/CHANGELOG.md
CHANGED
data/lib/spellr/reporter.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require_relative 'base_reporter'
|
4
|
+
require 'shellwords'
|
4
5
|
|
5
6
|
module Spellr
|
6
7
|
class Reporter < Spellr::BaseReporter
|
@@ -8,12 +9,31 @@ module Spellr
|
|
8
9
|
puts "\n"
|
9
10
|
puts "#{pluralize 'file', counts[:checked]} checked"
|
10
11
|
puts "#{pluralize 'error', counts[:total]} found"
|
12
|
+
|
13
|
+
interactive_command if counts[:total].positive?
|
11
14
|
end
|
12
15
|
|
13
16
|
def call(token)
|
14
17
|
super
|
15
18
|
|
19
|
+
filenames << token.location.file.relative_path.to_s
|
16
20
|
increment(:total)
|
17
21
|
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def interactive_command
|
26
|
+
puts "\nto add or replace words interactively, run:"
|
27
|
+
command = ['spellr', '--interactive']
|
28
|
+
# sort is purely for repeatability for tests. so
|
29
|
+
command.concat(counts[:filenames].to_a.sort) unless counts[:filenames].length > 20
|
30
|
+
|
31
|
+
puts " #{Shellwords.join(command)}"
|
32
|
+
end
|
33
|
+
|
34
|
+
def filenames
|
35
|
+
output.counts[:filenames] = Set.new unless output.counts.key?(:filenames)
|
36
|
+
output.counts[:filenames]
|
37
|
+
end
|
18
38
|
end
|
19
39
|
end
|
data/lib/spellr/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spellr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dana Sherson
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -318,7 +318,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
318
318
|
- !ruby/object:Gem::Version
|
319
319
|
version: '0'
|
320
320
|
requirements: []
|
321
|
-
rubygems_version: 3.
|
321
|
+
rubygems_version: 3.1.2
|
322
322
|
signing_key:
|
323
323
|
specification_version: 4
|
324
324
|
summary: Spell check your source code
|