addressable 1.0.3 → 1.0.4
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 +4 -0
- data/coverage/-Library-Ruby-Gems-1_8-gems-rcov-0_8_1_2_0-lib-rcov_rb.html +1 -1
- data/coverage/-Library-Ruby-Gems-1_8-gems-rspec-1_1_3-bin-spec.html +1 -1
- data/coverage/-Library-Ruby-Gems-1_8-gems-rspec-1_1_3-lib-spec_rb.html +1 -1
- data/coverage/-Library-Ruby-Gems-1_8-gems-rspec-1_1_3-plugins-mock_frameworks-rspec_rb.html +1 -1
- data/coverage/index.html +6 -6
- data/coverage/lib-addressable-uri_rb.html +735 -732
- data/coverage/lib-addressable-version_rb.html +33 -33
- data/lib/addressable/uri.rb +3 -0
- data/lib/addressable/version.rb +1 -1
- data/spec/addressable/uri_spec.rb +27 -5
- metadata +1 -1
@@ -553,7 +553,7 @@ span.run100 {
|
|
553
553
|
</style>
|
554
554
|
</head>
|
555
555
|
<body><h3>C0 code coverage information</h3>
|
556
|
-
<p>Generated on Sat May 03 13:
|
556
|
+
<p>Generated on Sat May 03 13:17:31 -0400 2008 with <a href='http://eigenclass.org/hiki/rcov'>rcov 0.8.1.2</a>
|
557
557
|
</p>
|
558
558
|
<hr/>
|
559
559
|
<pre><span class='marked0'>Code reported as executed by Ruby looks like this...
|
@@ -598,38 +598,38 @@ span.run100 {
|
|
598
598
|
</tr>
|
599
599
|
</tbody>
|
600
600
|
</table>
|
601
|
-
<pre><span class="
|
602
|
-
</span><span class="
|
603
|
-
</span><span class="
|
604
|
-
</span><span class="
|
605
|
-
</span><span class="
|
606
|
-
</span><span class="
|
607
|
-
</span><span class="
|
608
|
-
</span><span class="
|
609
|
-
</span><span class="
|
610
|
-
</span><span class="
|
611
|
-
</span><span class="
|
612
|
-
</span><span class="
|
613
|
-
</span><span class="
|
614
|
-
</span><span class="
|
615
|
-
</span><span class="
|
616
|
-
</span><span class="
|
617
|
-
</span><span class="
|
618
|
-
</span><span class="
|
619
|
-
</span><span class="
|
620
|
-
</span><span class="
|
621
|
-
</span><span class="
|
622
|
-
</span><span class="
|
623
|
-
</span><span class="
|
624
|
-
</span><span class="
|
625
|
-
</span><span class="
|
626
|
-
</span><span class="
|
627
|
-
</span><span class="
|
628
|
-
</span><span class="
|
629
|
-
</span><span class="
|
630
|
-
</span><span class="
|
631
|
-
</span><span class="
|
632
|
-
</span><span class="
|
601
|
+
<pre><span class="inferred0"><a name="line1"></a> 1 #--
|
602
|
+
</span><span class="inferred1"><a name="line2"></a> 2 # Addressable, Copyright (c) 2006-2008 Bob Aman
|
603
|
+
</span><span class="inferred0"><a name="line3"></a> 3 #
|
604
|
+
</span><span class="inferred1"><a name="line4"></a> 4 # Permission is hereby granted, free of charge, to any person obtaining
|
605
|
+
</span><span class="inferred0"><a name="line5"></a> 5 # a copy of this software and associated documentation files (the
|
606
|
+
</span><span class="inferred1"><a name="line6"></a> 6 # "Software"), to deal in the Software without restriction, including
|
607
|
+
</span><span class="inferred0"><a name="line7"></a> 7 # without limitation the rights to use, copy, modify, merge, publish,
|
608
|
+
</span><span class="inferred1"><a name="line8"></a> 8 # distribute, sublicense, and/or sell copies of the Software, and to
|
609
|
+
</span><span class="inferred0"><a name="line9"></a> 9 # permit persons to whom the Software is furnished to do so, subject to
|
610
|
+
</span><span class="inferred1"><a name="line10"></a>10 # the following conditions:
|
611
|
+
</span><span class="inferred0"><a name="line11"></a>11 #
|
612
|
+
</span><span class="inferred1"><a name="line12"></a>12 # The above copyright notice and this permission notice shall be
|
613
|
+
</span><span class="inferred0"><a name="line13"></a>13 # included in all copies or substantial portions of the Software.
|
614
|
+
</span><span class="inferred1"><a name="line14"></a>14 #
|
615
|
+
</span><span class="inferred0"><a name="line15"></a>15 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
616
|
+
</span><span class="inferred1"><a name="line16"></a>16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
617
|
+
</span><span class="inferred0"><a name="line17"></a>17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
618
|
+
</span><span class="inferred1"><a name="line18"></a>18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
619
|
+
</span><span class="inferred0"><a name="line19"></a>19 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
620
|
+
</span><span class="inferred1"><a name="line20"></a>20 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
621
|
+
</span><span class="inferred0"><a name="line21"></a>21 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
622
|
+
</span><span class="inferred1"><a name="line22"></a>22 #++
|
623
|
+
</span><span class="inferred0"><a name="line23"></a>23
|
624
|
+
</span><span class="marked1"><a name="line24"></a>24 module Addressable
|
625
|
+
</span><span class="marked0"><a name="line25"></a>25 module ADDRESSABLE_VERSION #:nodoc:
|
626
|
+
</span><span class="marked1"><a name="line26"></a>26 MAJOR = 1
|
627
|
+
</span><span class="marked0"><a name="line27"></a>27 MINOR = 0
|
628
|
+
</span><span class="marked1"><a name="line28"></a>28 TINY = 4
|
629
|
+
</span><span class="inferred0"><a name="line29"></a>29
|
630
|
+
</span><span class="marked1"><a name="line30"></a>30 STRING = [MAJOR, MINOR, TINY].join('.')
|
631
|
+
</span><span class="inferred0"><a name="line31"></a>31 end
|
632
|
+
</span><span class="inferred1"><a name="line32"></a>32 end
|
633
633
|
</span></pre><hr/>
|
634
634
|
<p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a>
|
635
635
|
version 0.8.1.2.</p>
|
data/lib/addressable/uri.rb
CHANGED
data/lib/addressable/version.rb
CHANGED
@@ -105,6 +105,24 @@ describe Addressable::URI, "when created with a nil host but " +
|
|
105
105
|
end
|
106
106
|
end
|
107
107
|
|
108
|
+
describe Addressable::URI, "when created with a path that hasn't been " +
|
109
|
+
"prefixed with a '/' but a host specified" do
|
110
|
+
it "should prefix a '/' to the path" do
|
111
|
+
Addressable::URI.new(
|
112
|
+
"http", nil, nil, "example.com", nil, "path", nil, nil
|
113
|
+
).should == Addressable::URI.parse("http://example.com/path")
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
describe Addressable::URI, "when created with a path that hasn't been " +
|
118
|
+
"prefixed with a '/' but no host specified" do
|
119
|
+
it "should prefix a '/' to the path" do
|
120
|
+
Addressable::URI.new(
|
121
|
+
"http", nil, nil, nil, nil, "path", nil, nil
|
122
|
+
).should == Addressable::URI.parse("http:path")
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
108
126
|
# Section 1.1.2 of RFC 3986
|
109
127
|
describe Addressable::URI, " when parsed from " +
|
110
128
|
"'ftp://ftp.is.co.za/rfc/rfc1808.txt'" do
|
@@ -728,7 +746,11 @@ describe Addressable::URI, " when parsed from " +
|
|
728
746
|
|
729
747
|
# Based on http://intertwingly.net/blog/2004/07/31/URI-Equivalence
|
730
748
|
it "should be equivalent to 'http://example.com/C%CC%A7'" do
|
731
|
-
|
749
|
+
if Addressable::URI::IDNA.send(:use_libidn?)
|
750
|
+
@uri.should == Addressable::URI.parse("http://example.com/C%CC%A7")
|
751
|
+
else
|
752
|
+
pending("Skipping IDN specification because GNU libidn is unavailable.")
|
753
|
+
end
|
732
754
|
end
|
733
755
|
|
734
756
|
it "should not change if encoded with the normalizing algorithm" do
|
@@ -2108,7 +2130,7 @@ describe Addressable::URI, " when parsed from " +
|
|
2108
2130
|
@uri.should ==
|
2109
2131
|
Addressable::URI.parse("http://www.xn--8ws00zhy3a.com/")
|
2110
2132
|
else
|
2111
|
-
|
2133
|
+
pending("Skipping IDN specification because GNU libidn is unavailable.")
|
2112
2134
|
end
|
2113
2135
|
end
|
2114
2136
|
|
@@ -2131,7 +2153,7 @@ describe Addressable::URI, " when parsed from " +
|
|
2131
2153
|
Addressable::URI.parse(
|
2132
2154
|
"http://www.xn--8ws00zhy3a.com/%20some%20spaces%20/")
|
2133
2155
|
else
|
2134
|
-
|
2156
|
+
pending("Skipping IDN specification because GNU libidn is unavailable.")
|
2135
2157
|
end
|
2136
2158
|
end
|
2137
2159
|
|
@@ -2151,7 +2173,7 @@ describe Addressable::URI, " when parsed from " +
|
|
2151
2173
|
if Addressable::URI::IDNA.send(:use_libidn?)
|
2152
2174
|
@uri.display_uri.to_s.should == "http://www.詹姆斯.com/"
|
2153
2175
|
else
|
2154
|
-
|
2176
|
+
pending("Skipping IDN specification because GNU libidn is unavailable.")
|
2155
2177
|
end
|
2156
2178
|
end
|
2157
2179
|
end
|
@@ -2170,7 +2192,7 @@ describe Addressable::URI, " when parsed from " +
|
|
2170
2192
|
@uri.normalize!.to_s.should ==
|
2171
2193
|
"http://www.xn--8ws00zhy3a.com/atomtests/iri/%E8%A9%B9.html"
|
2172
2194
|
else
|
2173
|
-
|
2195
|
+
pending("Skipping IDN specification because GNU libidn is unavailable.")
|
2174
2196
|
end
|
2175
2197
|
end
|
2176
2198
|
end
|