pronto-spell 0.5.0 → 0.6.0

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
  SHA1:
3
- metadata.gz: d2ecaba8b5096fbf8f8b8a6de755508008ef98a2
4
- data.tar.gz: 117dedc21f1878b2ea6e219fe244f7d12f5a469f
3
+ metadata.gz: 30fc7a9b7901c64d7406fdeedd2b868837f72fdd
4
+ data.tar.gz: 61c331d95672195dd274e4e520f2852668d08a13
5
5
  SHA512:
6
- metadata.gz: f8b6d8465f429856ffb5149aa9f27c0177ef2824c1ddc00592e9296caa6e057dd5006fc098ce7c045c8b06104e3c3132891af90123f18f7ad5c0343048092f8a
7
- data.tar.gz: 5a38c6e4b5378433a864ba7fe0350186db5cb923b5fad74d97570c7c33ed84eeddf3152d7b43aa33d64dc54f7e44604268998c1f57d123a18d4354d99c60a3e8
6
+ metadata.gz: 501ebce54992da0b63934f268f0e1d6adacd026301d4f901e3669ca9dd7b64233dd4355eee1bed9cc5aef80131d5e450ff35f6c234b9155d16fac6c92bf99b7d
7
+ data.tar.gz: f3b2fe277ab7aae01d4822bea8061701a3c45b9b9edf48463b3e001128a681fc0deb8eb7b4e8f4e613407bf8564baddd1ed025b38d0cc95bbdc3b9ab512d3c5a
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License
2
2
 
3
- Copyright (c) 2015 Mindaugas Mozūras
3
+ Copyright (c) 2016 Mindaugas Mozūras
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -3,15 +3,10 @@ require 'ffi/aspell'
3
3
 
4
4
  module Pronto
5
5
  class Spell < Runner
6
- def initialize
7
- @speller = FFI::Aspell::Speller.new('en_US')
8
- @speller.suggestion_mode = 'fast'
9
- end
10
-
11
- def run(patches, _)
12
- return [] unless patches
6
+ def run
7
+ return [] unless @patches
13
8
 
14
- patches.select { |patch| patch.additions > 0 }
9
+ @patches.select { |patch| patch.additions > 0 }
15
10
  .map { |patch| inspect(patch) }
16
11
  .flatten.compact
17
12
  end
@@ -21,7 +16,7 @@ module Pronto
21
16
  words = line.content.scan(/[0-9a-zA-Z]+/)
22
17
  words.select { |word| word.length > 4 }
23
18
  .uniq
24
- .select { |word| !@speller.correct?(word) }
19
+ .select { |word| !speller.correct?(word) }
25
20
  .map { |word| new_message(word, line) }
26
21
  end
27
22
  end
@@ -30,10 +25,18 @@ module Pronto
30
25
  path = line.patch.delta.new_file[:path]
31
26
  level = :warning
32
27
 
33
- suggestions = @speller.suggestions(word)
28
+ suggestions = speller.suggestions(word)
34
29
  msg = "#{word} might not be spelled correctly. Spelling suggestions: #{suggestions}"
35
30
 
36
- Message.new(path, line, level, msg)
31
+ Message.new(path, line, level, msg, nil, self.class)
32
+ end
33
+
34
+ def speller
35
+ @speller ||= begin
36
+ result = FFI::Aspell::Speller.new('en_US')
37
+ result.suggestion_mode = 'fast'
38
+ result
39
+ end
37
40
  end
38
41
  end
39
42
  end
@@ -1,5 +1,5 @@
1
1
  module Pronto
2
2
  module SpellVersion
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'.freeze
4
4
  end
5
5
  end
@@ -1,6 +1,7 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
2
 
3
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
4
+ require 'English'
4
5
  require 'pronto/spell/version'
5
6
 
6
7
  Gem::Specification.new do |s|
@@ -31,9 +32,9 @@ Gem::Specification.new do |s|
31
32
  s.extra_rdoc_files = ['LICENSE', 'README.md']
32
33
  s.require_paths = ['lib']
33
34
 
34
- s.add_dependency('pronto', '~> 0.5.0')
35
+ s.add_dependency('pronto', '~> 0.6.0')
35
36
  s.add_dependency('ffi-aspell', '~> 1.1.0')
36
- s.add_development_dependency('rake', '~> 10.4')
37
- s.add_development_dependency('rspec', '~> 3.3')
37
+ s.add_development_dependency('rake', '~> 11.0')
38
+ s.add_development_dependency('rspec', '~> 3.4')
38
39
  s.add_development_dependency('rspec-its', '~> 1.2')
39
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pronto-spell
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mindaugas Mozūras
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-12-02 00:00:00.000000000 Z
11
+ date: 2016-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: pronto
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.5.0
19
+ version: 0.6.0
20
20
  type: :runtime
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: 0.5.0
26
+ version: 0.6.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: ffi-aspell
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,28 +44,28 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '10.4'
47
+ version: '11.0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '10.4'
54
+ version: '11.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '3.3'
61
+ version: '3.4'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '3.3'
68
+ version: '3.4'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rspec-its
71
71
  requirement: !ruby/object:Gem::Requirement