checklinks 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/checklinks +9 -4
- data/lib/checklinks/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 737c0145972fe61cb1b570fbb8fe7cc6ecef0965f199ed56049e49399a9c9a0d
|
4
|
+
data.tar.gz: 4fc58d20f3aa261a82bd2d8f4eab7d503efa552aa8e87abd6a6d7c6510a264c4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42d03d2a8fde7431a92ce2466622cd0f9b545e138c05f3f066a474612c8444824f764b63af5c2f3d8177058ed1a922f8b5f645a13c24b6e66dd7d4365bd3f9ee
|
7
|
+
data.tar.gz: 20c0796f5603e531e898655d0e2c6d6f9192e13dd8b7976f55e710337e4cb10b68df8ffe2870803c2ef2026d687a15a2a10d18ad9c6509df099c5986604037f1
|
data/Gemfile.lock
CHANGED
data/bin/checklinks
CHANGED
@@ -29,7 +29,7 @@ end
|
|
29
29
|
|
30
30
|
# Create worklists - ahead of processing anything as they refer to each other cylically
|
31
31
|
|
32
|
-
file_worklist = Checklinks::Worklist.new(*files)
|
32
|
+
file_worklist = Checklinks::Worklist.new(*files.shuffle)
|
33
33
|
url_worklist = Checklinks::Worklist.new
|
34
34
|
link_collector = Checklinks::Worklist.collector
|
35
35
|
status_worklist = Checklinks::Worklist.new
|
@@ -48,6 +48,7 @@ file_worklist.process(Set.new) do |filename, found_urls|
|
|
48
48
|
url_worklist.push url
|
49
49
|
link_collector.push [url, filename, line_number]
|
50
50
|
end
|
51
|
+
urls.shuffle!
|
51
52
|
line_number += 1
|
52
53
|
end
|
53
54
|
end
|
@@ -97,7 +98,7 @@ end
|
|
97
98
|
# Process status updates to print progress on the screen
|
98
99
|
|
99
100
|
status_worklist.process({ok: 0, error: 0, ignored: 0, clear: 0}) do |message, state|
|
100
|
-
print "\r#{' '*state[:clear]}\r"
|
101
|
+
print "\r#{' '*state[:clear]}\r" if $stdout.tty?
|
101
102
|
case message.first
|
102
103
|
when :try
|
103
104
|
puts message.last
|
@@ -110,7 +111,7 @@ status_worklist.process({ok: 0, error: 0, ignored: 0, clear: 0}) do |message, st
|
|
110
111
|
error_collector.push
|
111
112
|
end
|
112
113
|
line = "[#{state[:ok].to_s.rjust(5)} ok, #{state[:ignored].to_s.rjust(5)} ignored, #{state[:error].to_s.rjust(5)} errors, #{file_worklist.size.to_s.rjust(5)} files left, #{url_worklist.size.to_s.rjust(5)} URLs left]"
|
113
|
-
print line
|
114
|
+
print line if $stdout.tty?
|
114
115
|
state[:clear] = line.length
|
115
116
|
end
|
116
117
|
|
@@ -123,7 +124,11 @@ errors = error_collector.close
|
|
123
124
|
|
124
125
|
# Print a report
|
125
126
|
|
126
|
-
|
127
|
+
if $stdout.tty?
|
128
|
+
puts "\r#{' '*status_state[:clear]}\r"
|
129
|
+
else
|
130
|
+
puts
|
131
|
+
end
|
127
132
|
|
128
133
|
if errors.empty?
|
129
134
|
puts 'Ok!'
|
data/lib/checklinks/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checklinks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Seaton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09-
|
11
|
+
date: 2020-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email:
|