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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9df7410c75a7e4c7ff3b8defecfdd38252571090e5edacbf46e562be7f27d3e
4
- data.tar.gz: a7f24ff28fccb5bf4da96891849994442d2d27ad2097bfce246543efd80d1274
3
+ metadata.gz: e09ecd923199d9533b1aa92210b6c4f8b02c03f3c4f420a46fd1519248556bff
4
+ data.tar.gz: ad58ff25a6c0e96598da4dc0bf86f6f380132be18866ff3c861237190aea4e71
5
5
  SHA512:
6
- metadata.gz: a582e1b04c1f5f39637877b1f28c468d89c671bc8675bcadd639206b03753ac1df2c83dda0f88d42fb0f0eda1869a33fbb217e0bea45aaa6abc30e363d35774f
7
- data.tar.gz: 60065eb1def72bb64ed99ef1186eb80d2ea9a6ef908e538677ae830747893b30358f7eee3c8d384cc31186366ac3cb546e6522400d5bc43df2a900818d171e86
6
+ metadata.gz: a47ec69ccdb59b1de84f509ec25457331b8b9306bb566e7f34a13872d36bd7a7d288e61eb73e96674da2fc1730f7cc41f250f8894457a97f02d656fbd3bfb9ca
7
+ data.tar.gz: a792a72098ec9601a06c2eacb279db00fc87a3b6e232d5466a896070420103115ae63f0699ce1de79a185839270c8b6b3d6bc0ca2b2ca100394079da4a6721ba
@@ -1,3 +1,6 @@
1
+ # v0.8.8
2
+ - output a suggested `spellr --interactive` command with filenames, when running this without --interactive
3
+
1
4
  # v0.8.7
2
5
  - Recognize URL with tilde in path
3
6
 
@@ -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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Spellr
4
- VERSION = '0.8.7'
4
+ VERSION = '0.8.8'
5
5
  end
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.7
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-19 00:00:00.000000000 Z
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.0.8
321
+ rubygems_version: 3.1.2
322
322
  signing_key:
323
323
  specification_version: 4
324
324
  summary: Spell check your source code