what_error 0.1.0.2 β 0.1.2
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 +4 -4
- data/lib/what_error.rb +23 -15
- 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: b31bf5d343a7b825f3f6e09eedf9da4a830576e616e7249a73ec4c5cc925a6dd
|
|
4
|
+
data.tar.gz: '098f318d2600912f25a4bc9cb0cb9b6eb2480c656990d1682c75becf0254d3a8'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ce628a9ca8d2b2327f561f73e1b6bc4251472b0ef9310c20aed547077c00bea2ab474690895f93e59e6a70049d200de1272ab255805a08070e464a2926a467d0
|
|
7
|
+
data.tar.gz: 7cfaac6537c9afa245aa38da81600e3a51d2775fe3a8aabe0c990bff2bf51fb1197102193e43d8baed30e65a9e9f8231b51b6df5ad7790bf3dd66960e5299355
|
data/lib/what_error.rb
CHANGED
|
@@ -1,19 +1,29 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
def in_irb?
|
|
4
|
+
defined?(IRB) ||
|
|
5
|
+
$0 == "irb" ||
|
|
6
|
+
(caller.any? { |line| line.include?('irb') }) ||
|
|
7
|
+
(defined?(BindingInspector) && !ENV['TERM_PROGRAM'].nil?)
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
if ! in_irb? then
|
|
11
|
+
|
|
3
12
|
module WhatError
|
|
4
|
-
VERSION = "0.1.
|
|
13
|
+
VERSION = "0.1.2"
|
|
5
14
|
class << self
|
|
6
15
|
def vykurchhtjtcddhtdxhxbfxbttxjyytsgnxtyxxfudutdutdtxx
|
|
7
|
-
# I rolled my face on the keyboard
|
|
16
|
+
# I rolled over my face on the keyboard
|
|
17
|
+
|
|
18
|
+
@cf = Kernel.caller[-1][/^(.+?):/, 1] or raise ArgumentError, "unknown file"
|
|
8
19
|
|
|
9
20
|
# Why?
|
|
10
|
-
if
|
|
11
|
-
puts "π«:
|
|
12
|
-
|
|
21
|
+
if @cf =~ /-/ then
|
|
22
|
+
puts "π«: UwU, I cannnnont red ths QAQ, SOOOOOOORRRYYYY!!! (Shrink into a ball)"
|
|
23
|
+
exit
|
|
13
24
|
end
|
|
14
25
|
|
|
15
|
-
@
|
|
16
|
-
@emojis = "ππππ€£ππ€ππ₯°πππ€π€πππ·π ππ‘ππβΊοΈπ«πππ¨π°πππ±π£π₯Ίπ€ππ₯π€π’πͺπππ©ππ
π₯΅π€‘π€₯π€π€«π€€π€ͺπ€―π€©π₯Άπ« π΅βπ«π€’".chars
|
|
26
|
+
@emojis = "πππππππ€£ππ€ππ₯°πππ€π€πππ·π ππ‘ππβΊοΈπ«πππ¨π°πππ±π£π₯Ίπ€ππ₯π€π’πͺπππ©ππ
π₯΅π€‘π€₯π€π€«π€€π€ͺπ€―π€©π₯Άπ« π΅βπ«π€’π©πΎπ".chars
|
|
17
27
|
@dir = %w[/mnt /usr /home /bin /ruby /etc /shared /var /opt /include]
|
|
18
28
|
@e_classes = ObjectSpace.each_object(Class).select { |c| c < StandardError }
|
|
19
29
|
|
|
@@ -45,13 +55,6 @@ module WhatError
|
|
|
45
55
|
return "#{@cf}:#{rand(1..10000)}: #{e.message} (\e[1;4m#{e.class}\e[0m)\n"
|
|
46
56
|
end
|
|
47
57
|
|
|
48
|
-
def in_irb?
|
|
49
|
-
defined?(IRB) ||
|
|
50
|
-
$0 == "irb" ||
|
|
51
|
-
(caller.any? { |line| line.include?('irb') }) ||
|
|
52
|
-
(defined?(BindingInspector) && !ENV['TERM_PROGRAM'].nil?)
|
|
53
|
-
end
|
|
54
|
-
|
|
55
58
|
def sub_fake_backtrace(e)
|
|
56
59
|
bt = e.backtrace.map do |b|
|
|
57
60
|
b.gsub(/'.+?'/, @emojis.sample)
|
|
@@ -68,4 +71,9 @@ module WhatError
|
|
|
68
71
|
end
|
|
69
72
|
|
|
70
73
|
WhatError.vykurchhtjtcddhtdxhxbfxbttxjyytsgnxtyxxfudutdutdtxx
|
|
71
|
-
WhatError.send(:in_irb?)
|
|
74
|
+
WhatError.send(:in_irb?)
|
|
75
|
+
|
|
76
|
+
else
|
|
77
|
+
puts "π«: Sorry, WhatError is disabled in IRB. Please require in actual ruby files. UwU, im so cuuuuuute."
|
|
78
|
+
raise "disabled in IRB"
|
|
79
|
+
end
|
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: what_error
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- tacocat
|
|
8
8
|
bindir: bin
|
|
9
9
|
cert_chain: []
|
|
10
|
-
date: 2025-11-
|
|
10
|
+
date: 2025-11-16 00:00:00.000000000 Z
|
|
11
11
|
dependencies: []
|
|
12
12
|
description: "A mischievous Ruby gem that randomly replaces your code errors with
|
|
13
13
|
exceptions from the StandardError family and generates completely fake, confusing
|