deadfinder 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b8024d88f4693ba6418aab2cca93f3c267fa823f2fa7b47116d39d7d6adb3d40
4
- data.tar.gz: 0c494d74bbbb448eb482204b2525478847d13b62e32c4b2cbd97f16315890973
3
+ metadata.gz: 8ddb8f1182cbb94fdb1c270ff6d0af2ae176fdb2376a52496fc535c69a1c576c
4
+ data.tar.gz: 5f49781224441d738fade165e0fae6c851c6739de2959e8c32601ebd9495e16c
5
5
  SHA512:
6
- metadata.gz: b231b730274c98b22672a4169cb943054db76b6ae0fec70f66eee4eb9e314217942b71d0d4da854556d8f7ec81e33d29be8cb9a758ea12ab3d7aec4ce40907b0
7
- data.tar.gz: 55ae74b443389b62dbd34150deed7e9de433540ca8e2796ed753d90366849f8690d6025d21cd513154e2379cf31c582817c7dd5119ecf629da42dd1d2571296a
6
+ metadata.gz: 5875750e01d1b909390a566b94a4daeeee5e2df3da81528d2c2cf4f831ef92c5e1d46732bbe4425cf5b0ba751136faa9ac7cb0dffeb6beefa0a4fabfa805e2b7
7
+ data.tar.gz: bc62403a89307870b0166f530928f8ce1c951e131818b3ac55bc6d879e5e8273189dc120ee51740fccb3eaf2f473bc5d9bcfbb3441ae17c1793fe83f9c0de716
@@ -4,44 +4,51 @@ require 'colorize'
4
4
 
5
5
  class Logger
6
6
  @silent = false
7
+ @mutex = Mutex.new
7
8
 
8
9
  def self.set_silent
9
- @silent = true
10
+ @mutex.synchronize { @silent = true }
10
11
  end
11
12
 
12
13
  def self.unset_silent
13
- @silent = false
14
+ @mutex.synchronize { @silent = false }
14
15
  end
15
16
 
16
17
  def self.silent?
17
- @silent
18
+ @mutex.synchronize { @silent }
19
+ end
20
+
21
+ def self.log(prefix, text, color)
22
+ return if silent?
23
+
24
+ puts prefix.colorize(color) + text.to_s.colorize(:"light_#{color}")
18
25
  end
19
26
 
20
27
  def self.info(text)
21
- puts 'ℹ '.colorize(:blue) + text.to_s.colorize(:light_blue) unless silent?
28
+ log('ℹ ', text, :blue)
22
29
  end
23
30
 
24
31
  def self.error(text)
25
- puts '⚠︎ '.colorize(:red) + text.to_s unless silent?
32
+ log('⚠︎ ', text, :red)
26
33
  end
27
34
 
28
35
  def self.target(text)
29
- puts '► '.colorize(:green) + text.to_s.colorize(:light_green) unless silent?
36
+ log('► ', text, :green)
30
37
  end
31
38
 
32
39
  def self.sub_info(text)
33
- puts ' ● '.colorize(:blue) + text.to_s.colorize(:light_blue) unless silent?
40
+ log(' ● ', text, :blue)
34
41
  end
35
42
 
36
43
  def self.sub_done(text)
37
- puts ' ✓ '.colorize(:blue) + text.to_s.colorize(:light_blue) unless silent?
44
+ log(' ✓ ', text, :blue)
38
45
  end
39
46
 
40
47
  def self.found(text)
41
- puts "#{text}".colorize(:red) unless silent?
48
+ log('', text, :red)
42
49
  end
43
50
 
44
51
  def self.verbose(text)
45
- puts ' ➜ '.colorize(:yellow) + text.to_s.colorize(:light_yellow) unless silent?
52
+ log(' ➜ ', text, :yellow)
46
53
  end
47
54
  end
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- VERSION = '1.5.0'
3
+ VERSION = '1.5.1'
data/lib/deadfinder.rb CHANGED
@@ -200,7 +200,7 @@ class DeadFinder < Thor
200
200
  class_option :headers, aliases: :H, default: [], type: :array,
201
201
  desc: 'Custom HTTP headers to send with initial request'
202
202
  class_option :worker_headers, default: [], type: :array, desc: 'Custom HTTP headers to send with worker requests'
203
- class_option :user_agent, default: 'Mozilla/5.0 (compatible; DeadFinder/1.5.0;)', type: :string,
203
+ class_option :user_agent, default: 'Mozilla/5.0 (compatible; DeadFinder/1.5.1;)', type: :string,
204
204
  desc: 'User-Agent string to use for requests'
205
205
  class_option :proxy, aliases: :p, default: '', type: :string, desc: 'Proxy server to use for requests'
206
206
  class_option :silent, aliases: :s, default: false, type: :boolean, desc: 'Silent mode'
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deadfinder
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - hahwul
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-10-17 00:00:00.000000000 Z
10
+ date: 2024-12-26 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: colorize
@@ -190,7 +189,6 @@ licenses:
190
189
  metadata:
191
190
  rubygems_mfa_required: 'true'
192
191
  source_code_uri: https://github.com/hahwul/deadfinder
193
- post_install_message:
194
192
  rdoc_options: []
195
193
  require_paths:
196
194
  - lib
@@ -205,8 +203,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
205
203
  - !ruby/object:Gem::Version
206
204
  version: '0'
207
205
  requirements: []
208
- rubygems_version: 3.5.3
209
- signing_key:
206
+ rubygems_version: 3.6.2
210
207
  specification_version: 4
211
208
  summary: Find dead-links (broken links)
212
209
  test_files: []