escape_utils 0.1.7 → 0.1.8
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.
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/escape_utils.gemspec +1 -1
- data/ext/escape_utils.c +1 -1
- data/lib/escape_utils.rb +1 -1
- data/spec/uri/escape_spec.rb +2 -2
- metadata +3 -3
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.8
|
data/escape_utils.gemspec
CHANGED
data/ext/escape_utils.c
CHANGED
@@ -7,7 +7,7 @@ static rb_encoding *utf8Encoding;
|
|
7
7
|
#define IS_HEX(c) (c >= 48 || c <= 57) && (c >= 65 || c <= 70) && (c >= 97 || c <= 102)
|
8
8
|
#define NOT_HEX(c) (c < 48 || c > 57) && (c < 65 || c > 90) && (c < 97 || c > 122)
|
9
9
|
#define UNHEX(c) (c >= '0' && c <= '9' ? c - '0' : c >= 'A' && c <= 'F' ? c - 'A' + 10 : c - 'a' + 10)
|
10
|
-
#define URI_SAFE(c) (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') ||
|
10
|
+
#define URI_SAFE(c) (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c== 45 || c == 46 || c == 95 || c == 126
|
11
11
|
// ALPHA / DIGIT / "-" / "." / "_" / "~"
|
12
12
|
|
13
13
|
static size_t escape_html(unsigned char *out, const unsigned char *in, size_t in_len) {
|
data/lib/escape_utils.rb
CHANGED
data/spec/uri/escape_spec.rb
CHANGED
@@ -7,7 +7,7 @@ describe EscapeUtils, "escape_uri" do
|
|
7
7
|
end
|
8
8
|
|
9
9
|
it "should escape a basic url" do
|
10
|
-
EscapeUtils.escape_uri("http://www.homerun.com/").should eql("http%3A
|
10
|
+
EscapeUtils.escape_uri("http://www.homerun.com/").should eql("http%3A%2F%2Fwww.homerun.com%2F")
|
11
11
|
end
|
12
12
|
|
13
13
|
# NOTE: from Rack's test suite
|
@@ -23,7 +23,7 @@ describe EscapeUtils, "escape_uri" do
|
|
23
23
|
|
24
24
|
# NOTE: from Rack's test suite
|
25
25
|
it "should escape a string of mixed characters" do
|
26
|
-
EscapeUtils.escape_uri("q1!2\"'w$5&7/z8)?\\").should eql("q1%212%22
|
26
|
+
EscapeUtils.escape_uri("q1!2\"'w$5&7/z8)?\\").should eql("q1%212%22%27w%245%267%2Fz8%29%3F%5C")
|
27
27
|
end
|
28
28
|
|
29
29
|
# NOTE: from Rack's test suite
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: escape_utils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 8
|
10
|
+
version: 0.1.8
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Brian Lopez
|