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.
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.8 (September 29th, 2010)
4
+ * fix URI escaping one last time ;)
5
+
3
6
  ## 0.1.7 (September 29th, 2010)
4
7
  * fix URI escaping to act according to the RFC
5
8
  * add specs for URL escaping
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.7
1
+ 0.1.8
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{escape_utils}
8
- s.version = "0.1.7"
8
+ s.version = "0.1.8"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Brian Lopez"]
@@ -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') || (c >= 38 && c <= 47) || c == 95 || c == 126
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) {
@@ -4,7 +4,7 @@ require 'escape_utils_ext'
4
4
 
5
5
  EscapeUtils.send(:extend, EscapeUtils)
6
6
  module EscapeUtils
7
- VERSION = "0.1.7"
7
+ VERSION = "0.1.8"
8
8
 
9
9
  autoload :HtmlSafety, 'escape_utils/html_safety'
10
10
  end
@@ -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//www.homerun.com/")
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'w%245&7/z8)%3F%5C")
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: 21
4
+ hash: 11
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 7
10
- version: 0.1.7
9
+ - 8
10
+ version: 0.1.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Brian Lopez