yard-junk 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog.md +5 -0
- data/README.md +5 -5
- data/lib/yard-junk/janitor.rb +1 -0
- data/lib/yard-junk/janitor/html_reporter.rb +2 -2
- data/lib/yard-junk/logger/message.rb +17 -5
- data/yard-junk.gemspec +5 -8
- metadata +25 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d528277a6fb7bba1da971f94aae6b57026c389f3
|
4
|
+
data.tar.gz: 1e87ce70c14f718fcb2cd46eb4dcc5bbb86824e1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8a095dad1cbc9da2e87a038ed30f563982ac38eb0f18c4f060cf0251ded6fea8cb40eccfb2405710789933b7f5c54faff649626e725678ef675bf3b35dd6d91
|
7
|
+
data.tar.gz: 2466c0a768593a605283f7c136bfb4d012a28701dbf3b32026e48da138162528fd9789275bba4c7dfa94aa6d8a3db6136ae4b91419a5727ab317722d9552dc83
|
data/Changelog.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# Yard-Junk changelog
|
2
2
|
|
3
|
+
## 0.0.3 -- 2017-09-07
|
4
|
+
|
5
|
+
* Wiser dependency on `did_you_mean`, should not break CIs now.
|
6
|
+
* Support for Ruby 2.1 and 2.2.
|
7
|
+
|
3
8
|
## 0.0.2 -- 2017-09-03
|
4
9
|
|
5
10
|
* Lots of small cleanups and enchancement of README, Gemfile and directory structure ([@olleolleolle]);
|
data/README.md
CHANGED
@@ -387,7 +387,7 @@ Add this to your `Rakefile`:
|
|
387
387
|
|
388
388
|
```ruby
|
389
389
|
require 'yard-junk/rake'
|
390
|
-
YardJunk::Rake.
|
390
|
+
YardJunk::Rake.define_task
|
391
391
|
```
|
392
392
|
|
393
393
|
and then run it (or add to your `.travis.yml`) as
|
@@ -395,12 +395,12 @@ and then run it (or add to your `.travis.yml`) as
|
|
395
395
|
rake yard:junk
|
396
396
|
```
|
397
397
|
|
398
|
-
Rake task also
|
398
|
+
The Rake task also takes formatter arguments, at task-definition time:
|
399
399
|
|
400
400
|
```ruby
|
401
|
-
YardJunk::Rake.
|
402
|
-
YardJunk::Rake.
|
403
|
-
YardJunk::Rake.
|
401
|
+
YardJunk::Rake.define_task(:text) # default
|
402
|
+
YardJunk::Rake.define_task(text: 'logs/yard.log') # text to file
|
403
|
+
YardJunk::Rake.define_task(:text, html: 'build-artifacts/junk-yard.html') # text to STDOUT, html to file
|
404
404
|
```
|
405
405
|
|
406
406
|
## Reasons
|
data/lib/yard-junk/janitor.rb
CHANGED
@@ -8,7 +8,7 @@ module YardJunk
|
|
8
8
|
# for usage with Jenkins. See {BaseReporter} for details about reporters.
|
9
9
|
#
|
10
10
|
class HtmlReporter < BaseReporter
|
11
|
-
HEADER =
|
11
|
+
HEADER = <<-HTML
|
12
12
|
<!DOCTYPE html>
|
13
13
|
<html lang="en">
|
14
14
|
<header>
|
@@ -46,7 +46,7 @@ module YardJunk
|
|
46
46
|
<h1>YARD Validation Report</h1>
|
47
47
|
HTML
|
48
48
|
|
49
|
-
FOOTER =
|
49
|
+
FOOTER = <<-HTML
|
50
50
|
</body>
|
51
51
|
</html>
|
52
52
|
HTML
|
@@ -10,7 +10,7 @@ module YardJunk
|
|
10
10
|
def initialize(message:, severity: :warn, code_object: nil, file: nil, line: nil, **extra)
|
11
11
|
@message = message.gsub(/\s{2,}/, ' ')
|
12
12
|
@file = file
|
13
|
-
@line = line
|
13
|
+
@line = line && line.to_i
|
14
14
|
@code_object = code_object
|
15
15
|
@severity = severity
|
16
16
|
@extra = extra
|
@@ -25,7 +25,7 @@ module YardJunk
|
|
25
25
|
type: type,
|
26
26
|
message: message,
|
27
27
|
file: file,
|
28
|
-
line: line
|
28
|
+
line: (line && line.to_i) || 1
|
29
29
|
}.merge(extra)
|
30
30
|
end
|
31
31
|
|
@@ -47,7 +47,7 @@ module YardJunk
|
|
47
47
|
|
48
48
|
# DidYouMean changed API dramatically between 1.0 and 1.1, and different rubies have different
|
49
49
|
# versions of it bundled.
|
50
|
-
if DidYouMean.const_defined?(:SpellCheckable)
|
50
|
+
if DidYouMean.const_defined?(:SpellCheckable) # 1.0 +
|
51
51
|
class SpellChecker < Struct.new(:error, :dictionary) # rubocop:disable Style/StructInheritance
|
52
52
|
include DidYouMean::SpellCheckable
|
53
53
|
|
@@ -59,10 +59,22 @@ module YardJunk
|
|
59
59
|
def spell_check(error, dictionary)
|
60
60
|
SpellChecker.new(error, dictionary).corrections
|
61
61
|
end
|
62
|
-
elsif DidYouMean.const_defined?(:SpellChecker)
|
62
|
+
elsif DidYouMean.const_defined?(:SpellChecker) # 1.1+
|
63
63
|
def spell_check(error, dictionary)
|
64
64
|
DidYouMean::SpellChecker.new(dictionary: dictionary).correct(error)
|
65
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
|
66
78
|
else
|
67
79
|
def spell_check(*)
|
68
80
|
[]
|
@@ -93,7 +105,7 @@ module YardJunk
|
|
93
105
|
end
|
94
106
|
|
95
107
|
def type
|
96
|
-
name
|
108
|
+
!name || name.end_with?('::Message') ? 'UnknownError' : name.sub(/^.+::/, '')
|
97
109
|
end
|
98
110
|
|
99
111
|
def valid_type?(type)
|
data/yard-junk.gemspec
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'yard-junk'
|
3
|
-
s.version = '0.0.
|
3
|
+
s.version = '0.0.3'
|
4
4
|
s.authors = ['Victor Shepelev']
|
5
5
|
s.email = 'zverok.offline@gmail.com'
|
6
6
|
s.homepage = 'https://github.com/zverok/junk_yard'
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
EOF
|
12
12
|
s.licenses = ['MIT']
|
13
13
|
|
14
|
-
s.required_ruby_version = '>= 2.
|
14
|
+
s.required_ruby_version = '>= 2.1.0'
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split($RS).reject do |file|
|
17
17
|
file =~ /^(?:
|
@@ -33,15 +33,12 @@ Gem::Specification.new do |s|
|
|
33
33
|
|
34
34
|
s.add_dependency 'rainbow'
|
35
35
|
s.add_dependency 'yard'
|
36
|
-
|
37
|
-
|
38
|
-
else
|
39
|
-
s.add_dependency 'did_you_mean', '~> 1.1'
|
40
|
-
end
|
36
|
+
s.add_dependency 'did_you_mean'
|
37
|
+
s.add_dependency 'backports'
|
41
38
|
|
42
39
|
s.add_development_dependency 'rubocop', '>= 0.49'
|
43
40
|
s.add_development_dependency 'rspec', '>= 3'
|
44
|
-
s.add_development_dependency 'rubocop-rspec'
|
41
|
+
s.add_development_dependency 'rubocop-rspec', '= 1.15.1' # 1.16.0 is broken on JRuby
|
45
42
|
s.add_development_dependency 'rspec-its', '~> 1'
|
46
43
|
#s.add_development_dependency 'saharspec' # saharspec is moving target!
|
47
44
|
s.add_development_dependency 'fakefs'
|
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
|
+
version: 0.0.3
|
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-
|
11
|
+
date: 2017-09-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rainbow
|
@@ -42,16 +42,30 @@ dependencies:
|
|
42
42
|
name: did_you_mean
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :runtime
|
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: '
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: backports
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rubocop
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +98,16 @@ dependencies:
|
|
84
98
|
name: rubocop-rspec
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- -
|
101
|
+
- - '='
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
103
|
+
version: 1.15.1
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- -
|
108
|
+
- - '='
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
110
|
+
version: 1.15.1
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: rspec-its
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -217,7 +231,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
217
231
|
requirements:
|
218
232
|
- - ">="
|
219
233
|
- !ruby/object:Gem::Version
|
220
|
-
version: 2.
|
234
|
+
version: 2.1.0
|
221
235
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
222
236
|
requirements:
|
223
237
|
- - ">="
|