absolutize 0.0.7 → 0.0.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,5 @@
1
1
 
2
- h1. Absolutize v0.0.7
2
+ h1. Absolutize v0.0.8
3
3
 
4
4
  h2. Intro
5
5
 
@@ -16,7 +16,7 @@ class Absolutize
16
16
  def url(relative_url)
17
17
  # encode the url if the new url contains spaces but doesn't contain %, i.e isn't already encoded
18
18
  relative_url = relative_url.split("#").first if relative_url.include?"#" and @options[:remove_anchors]
19
- relative_url = URI.encode(relative_url, " <>\{\}|\\\^\[\]`") if @options[:force_escaping]
19
+ relative_url = URI.encode(relative_url, " <>\{\}|\\\^\[\]|`") if @options[:force_escaping]
20
20
 
21
21
  absolute_url = nil
22
22
  begin
@@ -16,7 +16,7 @@ class Absolutize
16
16
  def url(relative_url)
17
17
  # encode the url if the new url contains spaces but doesn't contain %, i.e isn't already encoded
18
18
  relative_url = relative_url.split("#").first if relative_url.include?"#" and @options[:remove_anchors]
19
- relative_url = URI.encode(relative_url, " <>\{\}|\\\^\[\]`") if @options[:force_escaping]
19
+ relative_url = URI.encode(relative_url, " <>\{\}|\\\^\[\]|`") if @options[:force_escaping]
20
20
 
21
21
  absolute_url = nil
22
22
  begin
@@ -39,6 +39,9 @@ describe Absolutize do
39
39
  it "should not encode existing encoded characters" do
40
40
  @absolutize.url("/root%20folder/asdf.html?id=[asdf]").to_s.should == "http://www.baseurl.com/root%20folder/asdf.html?id=%5Basdf%5D"
41
41
  end
42
+ it "should encode with pipes" do
43
+ @absolutize.url("/root%20folder/asdf.html?lang=en|us").to_s.should == "http://www.baseurl.com/root%20folder/asdf.html?lang=en%7Cus"
44
+ end
42
45
  end
43
46
 
44
47
  describe "with remove_anchors true" do
@@ -39,6 +39,9 @@ describe Absolutize do
39
39
  it "should not encode existing encoded characters" do
40
40
  @absolutize.url("/root%20folder/asdf.html?id=[asdf]").to_s.should == "http://www.baseurl.com/root%20folder/asdf.html?id=%5Basdf%5D"
41
41
  end
42
+ it "should encode with pipes" do
43
+ @absolutize.url("/root%20folder/asdf.html?lang=en|us").to_s.should == "http://www.baseurl.com/root%20folder/asdf.html?lang=en%7Cus"
44
+ end
42
45
  end
43
46
 
44
47
  describe "with remove_anchors true" do
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: absolutize
3
3
  version: !ruby/object:Gem::Version
4
- hash: 17
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 7
10
- version: 0.0.7
9
+ - 8
10
+ version: 0.0.8
11
11
  platform: ruby
12
12
  authors:
13
13
  - Stewart McKee
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-06 00:00:00 +01:00
18
+ date: 2010-08-09 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21