ctf-party 1.3.1 → 1.3.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/ctf_party.rb +1 -0
- data/lib/ctf_party/cgi.rb +58 -0
- data/lib/ctf_party/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 43e5c5fba11ab29415687644876bc3185a7b220adcc0da51bf36bac65b970600
|
4
|
+
data.tar.gz: 6dc55b3100a380a0ff2c11e61eda9f67fd7a7a1ae5fc9effae3bae870cf701df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36b8f7a716e66fcfb1aed39b71f586d5ad73e9c099a11651c7dfd29093e09f60b15e278036f7e4e7d74150ceca1c374308864634f8f58b8e4078ca261f60a389
|
7
|
+
data.tar.gz: 17618c1a863ed02b9f838bae87e2135e108d50350658c639494d9d9d2a7751319720a022f801a10a79a0bf0a03417d5262d043c137313d7a004dd08a81b5ab61
|
data/lib/ctf_party.rb
CHANGED
@@ -0,0 +1,58 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Ruby standard library
|
4
|
+
require 'cgi'
|
5
|
+
|
6
|
+
class String
|
7
|
+
# URL-encode the string
|
8
|
+
# @return [String] the URL-encoded string
|
9
|
+
# @example
|
10
|
+
# "'Stop!' said Fred".urlencode # => "%27Stop%21%27+said+Fred"
|
11
|
+
def urlencode
|
12
|
+
CGI.escape self
|
13
|
+
end
|
14
|
+
|
15
|
+
# URL-encode the string in place as described for {String#urlencode}.
|
16
|
+
def urlencode!
|
17
|
+
replace(urlencode)
|
18
|
+
end
|
19
|
+
|
20
|
+
# URL-decode the string
|
21
|
+
# @return [String] the URL-decoded string
|
22
|
+
# @example
|
23
|
+
# "%27Stop%21%27+said+Fred".urldecode # => "'Stop!' said Fred"
|
24
|
+
def urldecode
|
25
|
+
CGI.unescape self
|
26
|
+
end
|
27
|
+
|
28
|
+
# URL-decode the string in place as described for {String#urldecode}.
|
29
|
+
def urldecode!
|
30
|
+
replace(urldecode)
|
31
|
+
end
|
32
|
+
|
33
|
+
# HTML escape the string
|
34
|
+
# @return [String] the HTML escaped string
|
35
|
+
# @example
|
36
|
+
# 'Usage: foo "bar" <baz>'.htmlescape # => "Usage: foo "bar" <baz>"
|
37
|
+
def htmlescape
|
38
|
+
CGI.escapeHTML self
|
39
|
+
end
|
40
|
+
|
41
|
+
# HTML escape the string in place as described for {String#htmlescape}.
|
42
|
+
def htmlescape!
|
43
|
+
replace(htmlescape)
|
44
|
+
end
|
45
|
+
|
46
|
+
# HTML unescape the string
|
47
|
+
# @return [String] the HTML unescaped string
|
48
|
+
# @example
|
49
|
+
# "Usage: foo "bar" <baz>".htmlunescape # => "Usage: foo \"bar\" <baz>"
|
50
|
+
def htmlunescape
|
51
|
+
CGI.unescapeHTML self
|
52
|
+
end
|
53
|
+
|
54
|
+
# HTML unescape the string in place as described for {String#htmlunescape}.
|
55
|
+
def htmlunescape!
|
56
|
+
replace(htmlunescape)
|
57
|
+
end
|
58
|
+
end
|
data/lib/ctf_party/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ctf-party
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexandre ZANNI
|
@@ -136,6 +136,7 @@ files:
|
|
136
136
|
- lib/ctf_party.rb
|
137
137
|
- lib/ctf_party/base64.rb
|
138
138
|
- lib/ctf_party/case.rb
|
139
|
+
- lib/ctf_party/cgi.rb
|
139
140
|
- lib/ctf_party/digest.rb
|
140
141
|
- lib/ctf_party/flag.rb
|
141
142
|
- lib/ctf_party/hex.rb
|