yard-junk 0.0.4 → 0.0.5

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: d2951dd9b76ead149237efbb2d837868f334db37
4
- data.tar.gz: 6b9e03ce2ec1b7f2c6eebb3fa7a23fa2bad10c95
3
+ metadata.gz: 4f026c0bf7f4d4490bc4a95d445fafb80d4bfe35
4
+ data.tar.gz: 26a7538f89dd38d6352575e563b5192b5d15bef0
5
5
  SHA512:
6
- metadata.gz: 5b007c4ee552650b8c49d13619cbb98fb3dad7855ebf7a807c0c32ded821535197266e6511ef5754097937286a5bf1832e748fb824c38f9529914322e158e810
7
- data.tar.gz: f58438719e6d9a11a7bd995d336e09f97b59aeaf5b81094e46fe7852ebfebe9c574f0fcd80455163333213c4f5f4da71130dac193a77b7dacdf73f63a07c89b7
6
+ metadata.gz: 8cffcf86cc22223300d43cac2609f8aa31c51b65c01c9f9fd9a56a8ddf4cf44e207a51f63543f1e14321c01df538f29288c43948f0356bde1306c7c4d4baa903
7
+ data.tar.gz: ebde7f6f891bc40cc7f9ebb6be60890b8884a3c4390de1c6a92302a6c759e87ee2b7a695ec61dcc7de9a40bf5bfc57bf186114bd9c270d786420a34a86be0662
@@ -1,5 +1,9 @@
1
1
  # Yard-Junk changelog
2
2
 
3
+ ## 0.0.5 -- 2017-09-11
4
+
5
+ * Fix gem conflict with `did_you_mean`.
6
+
3
7
  ## 0.0.4 -- 2017-09-09
4
8
 
5
9
  * Support for partial reports `yard-junk --path path/to/folder` (#13)
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'yard'
3
4
  require_relative 'yard-junk/version'
4
5
  require_relative 'yard-junk/logger'
5
6
  require_relative 'yard-junk/command_line'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'did_you_mean'
3
+ require_relative 'spellcheck'
4
4
 
5
5
  module YardJunk
6
6
  class Logger
@@ -43,43 +43,7 @@ module YardJunk
43
43
  self.class.type
44
44
  end
45
45
 
46
- private
47
-
48
- # DidYouMean changed API dramatically between 1.0 and 1.1, and different rubies have different
49
- # versions of it bundled.
50
- if DidYouMean.const_defined?(:SpellCheckable) # 1.0 +
51
- class SpellChecker < Struct.new(:error, :dictionary) # rubocop:disable Style/StructInheritance
52
- include DidYouMean::SpellCheckable
53
-
54
- def candidates
55
- {error => dictionary}
56
- end
57
- end
58
-
59
- def spell_check(error, dictionary)
60
- SpellChecker.new(error, dictionary).corrections
61
- end
62
- elsif DidYouMean.const_defined?(:SpellChecker) # 1.1+
63
- def spell_check(error, dictionary)
64
- DidYouMean::SpellChecker.new(dictionary: dictionary).correct(error)
65
- end
66
- elsif DidYouMean.const_defined?(:BaseFinder) # < 1.0
67
- class SpellFinder < Struct.new(:error, :dictionary) # rubocop:disable Style/StructInheritance
68
- include DidYouMean::BaseFinder
69
-
70
- def searches
71
- {error => dictionary}
72
- end
73
- end
74
-
75
- def spell_check(error, dictionary)
76
- SpellFinder.new(error, dictionary).suggestions
77
- end
78
- else
79
- def spell_check(*)
80
- []
81
- end
82
- end
46
+ include Spellcheck
83
47
 
84
48
  class << self
85
49
  def registry
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ begin
4
+ require 'did_you_mean'
5
+ rescue LoadError # rubocop:disable Lint/HandleExceptions
6
+ end
7
+
8
+ module YardJunk
9
+ class Logger
10
+ module Spellcheck
11
+ # DidYouMean changed API dramatically between 1.0 and 1.1, and different rubies have different
12
+ # versions of it bundled.
13
+ if !Kernel.const_defined?(:DidYouMean)
14
+ def spell_check(*)
15
+ []
16
+ end
17
+ elsif DidYouMean.const_defined?(:SpellCheckable) # 1.0 +
18
+ class SpellChecker < Struct.new(:error, :dictionary) # rubocop:disable Style/StructInheritance
19
+ include DidYouMean::SpellCheckable
20
+
21
+ def candidates
22
+ {error => dictionary}
23
+ end
24
+ end
25
+
26
+ def spell_check(error, dictionary)
27
+ SpellChecker.new(error, dictionary).corrections
28
+ end
29
+ elsif DidYouMean.const_defined?(:SpellChecker) # 1.1+
30
+ def spell_check(error, dictionary)
31
+ DidYouMean::SpellChecker.new(dictionary: dictionary).correct(error)
32
+ end
33
+ elsif DidYouMean.const_defined?(:BaseFinder) # < 1.0
34
+ class SpellFinder < Struct.new(:error, :dictionary) # rubocop:disable Style/StructInheritance
35
+ include DidYouMean::BaseFinder
36
+
37
+ def searches
38
+ {error => dictionary}
39
+ end
40
+ end
41
+
42
+ def spell_check(error, dictionary)
43
+ SpellFinder.new(error, dictionary).suggestions
44
+ end
45
+ else
46
+ def spell_check(*)
47
+ []
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -6,7 +6,7 @@ module YardJunk
6
6
  # @private
7
7
  MINOR = 0
8
8
  # @private
9
- PATCH = 4
9
+ PATCH = 5
10
10
 
11
11
  # @private
12
12
  VERSION = [MINOR, MAJOR, PATCH].join('.')
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
35
35
 
36
36
  s.add_dependency 'rainbow'
37
37
  s.add_dependency 'yard'
38
- s.add_dependency 'did_you_mean'
38
+ s.add_dependency 'did_you_mean' if RUBY_VERSION < '2.3'
39
39
  s.add_dependency 'backports'
40
40
 
41
41
  s.add_development_dependency 'rubocop', '>= 0.49'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: yard-junk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Victor Shepelev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-09-09 00:00:00.000000000 Z
11
+ date: 2017-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rainbow
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: did_you_mean
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: backports
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -217,6 +203,7 @@ files:
217
203
  - lib/yard-junk/janitor/text_reporter.rb
218
204
  - lib/yard-junk/logger.rb
219
205
  - lib/yard-junk/logger/message.rb
206
+ - lib/yard-junk/logger/spellcheck.rb
220
207
  - lib/yard-junk/rake.rb
221
208
  - lib/yard-junk/version.rb
222
209
  - yard-junk.gemspec