addressable 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,9 +1,7 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
- <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
- <head>
4
- <title>lib/addressable/version.rb - C0 code coverage information</title>
5
- <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
6
- <style type='text/css'>span.cross-ref-title {
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><title>lib/addressable/version.rb - C0 code coverage information</title>
3
+ <style type='text/css'>body { background-color: rgb(240, 240, 245); }</style>
4
+ <style type='text/css'>span.cross-ref-title {
7
5
  font-size: 140%;
8
6
  }
9
7
  span.cross-ref a {
@@ -123,7 +121,7 @@ table.report tr.dark {
123
121
  background-color: rgb(230, 230, 235);
124
122
  }
125
123
  </style>
126
- <script type='text/javascript'>
124
+ <script type='text/javascript'>
127
125
  // <![CDATA[
128
126
  function toggleCode( id ) {
129
127
  if ( document.getElementById )
@@ -148,7 +146,7 @@ table.report tr.dark {
148
146
  document.writeln( "<style type=\"text/css\">span.cross-ref { display: none }</style>" )
149
147
  // ]]>
150
148
  </script>
151
- <style type='text/css'>span.run0 {
149
+ <style type='text/css'>span.run0 {
152
150
  background-color: rgb(178, 204, 255);
153
151
  display: block;
154
152
  }
@@ -553,111 +551,92 @@ span.run100 {
553
551
  display: block;
554
552
  }
555
553
  </style>
556
- </head>
557
- <body>
558
- <h3>C0 code coverage information</h3>
559
- <p>Generated on Sat Nov 03 20:49:05 -0400 2007 with <a href='http://eigenclass.org/hiki.rb?rcov'>rcov 0.8.0</a>
560
- </p>
561
- <hr /><pre><span class='marked0'>Code reported as executed by Ruby looks like this...
554
+ </head>
555
+ <body><h3>C0 code coverage information</h3>
556
+ <p>Generated on Sun Dec 09 23:54:29 -0500 2007 with <a href='http://eigenclass.org/hiki/rcov'>rcov 0.8.1.2</a>
557
+ </p>
558
+ <hr/>
559
+ <pre><span class='marked0'>Code reported as executed by Ruby looks like this...
562
560
  </span><span class='marked1'>and this: this line is also marked as covered.
563
561
  </span><span class='inferred0'>Lines considered as run by rcov, but not reported by Ruby, look like this,
564
562
  </span><span class='inferred1'>and this: these lines were inferred by rcov (using simple heuristics).
565
563
  </span><span class='uncovered0'>Finally, here&apos;s a line marked as not executed.
566
564
  </span></pre>
567
- <table class='report'>
568
- <thead>
569
- <tr>
570
- <td class='heading'>Name</td>
571
- <td class='heading'>Total lines</td>
572
- <td class='heading'>Lines of code</td>
573
- <td class='heading'>Total coverage</td>
574
- <td class='heading'>Code coverage</td>
575
- </tr>
576
- </thead>
577
- <tbody>
578
- <tr class='light'>
579
- <td>
580
- <a href='lib-addressable-version_rb.html'>lib/addressable/version.rb</a>
581
- </td>
582
- <td class='lines_total'>
583
- <tt>32</tt>
584
- </td>
585
- <td class='lines_code'>
586
- <tt>8</tt>
587
- </td>
588
- <td>
589
- <table cellspacing='0' cellpadding='0' align='right'>
590
- <tr>
591
- <td>
592
- <tt class='coverage_total'>100.0%</tt>&nbsp;</td>
593
- <td>
594
- <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
595
- <tr>
596
- <td class='covered' width='100' />
597
- <td class='uncovered' width='0' />
598
- </tr>
599
- </table>
600
- </td>
601
- </tr>
602
- </table>
603
- </td>
604
- <td>
605
- <table cellspacing='0' cellpadding='0' align='right'>
606
- <tr>
607
- <td>
608
- <tt class='coverage_code'>100.0%</tt>&nbsp;</td>
609
- <td>
610
- <table cellspacing='0' class='percent_graph' cellpadding='0' width='100'>
611
- <tr>
612
- <td class='covered' width='100' />
613
- <td class='uncovered' width='0' />
614
- </tr>
615
- </table>
616
- </td>
617
- </tr>
618
- </table>
619
- </td>
620
- </tr>
621
- </tbody>
622
- </table><pre><span class="inferred0"><a name="line1" /> 1 #--
623
- </span><span class="inferred1"><a name="line2" /> 2 # Addressable, Copyright (c) 2006-2007 Bob Aman
624
- </span><span class="inferred0"><a name="line3" /> 3 #
625
- </span><span class="inferred1"><a name="line4" /> 4 # Permission is hereby granted, free of charge, to any person obtaining
626
- </span><span class="inferred0"><a name="line5" /> 5 # a copy of this software and associated documentation files (the
627
- </span><span class="inferred1"><a name="line6" /> 6 # &quot;Software&quot;), to deal in the Software without restriction, including
628
- </span><span class="inferred0"><a name="line7" /> 7 # without limitation the rights to use, copy, modify, merge, publish,
629
- </span><span class="inferred1"><a name="line8" /> 8 # distribute, sublicense, and/or sell copies of the Software, and to
630
- </span><span class="inferred0"><a name="line9" /> 9 # permit persons to whom the Software is furnished to do so, subject to
631
- </span><span class="inferred1"><a name="line10" />10 # the following conditions:
632
- </span><span class="inferred0"><a name="line11" />11 #
633
- </span><span class="inferred1"><a name="line12" />12 # The above copyright notice and this permission notice shall be
634
- </span><span class="inferred0"><a name="line13" />13 # included in all copies or substantial portions of the Software.
635
- </span><span class="inferred1"><a name="line14" />14 #
636
- </span><span class="inferred0"><a name="line15" />15 # THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
637
- </span><span class="inferred1"><a name="line16" />16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
638
- </span><span class="inferred0"><a name="line17" />17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
639
- </span><span class="inferred1"><a name="line18" />18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
640
- </span><span class="inferred0"><a name="line19" />19 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
641
- </span><span class="inferred1"><a name="line20" />20 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
642
- </span><span class="inferred0"><a name="line21" />21 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
643
- </span><span class="inferred1"><a name="line22" />22 #++
644
- </span><span class="inferred0"><a name="line23" />23
645
- </span><span class="marked1"><a name="line24" />24 module Addressable
646
- </span><span class="marked0"><a name="line25" />25 module ADDRESSABLE_VERSION #:nodoc:
647
- </span><span class="marked1"><a name="line26" />26 MAJOR = 1
648
- </span><span class="marked0"><a name="line27" />27 MINOR = 0
649
- </span><span class="marked1"><a name="line28" />28 TINY = 0
650
- </span><span class="inferred0"><a name="line29" />29
651
- </span><span class="marked1"><a name="line30" />30 STRING = [MAJOR, MINOR, TINY].join('.')
652
- </span><span class="inferred0"><a name="line31" />31 end
653
- </span><span class="inferred1"><a name="line32" />32 end
654
- </span></pre><hr /> <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a> version 0.8.0.</p><p>
655
- <a href='http://validator.w3.org/check/referer'>
656
- <img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88' />
657
- </a>
658
- <a href='http://jigsaw.w3.org/css-validator/check/referer'>
659
- <img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px' />
660
- </a>
661
- </p>
662
- </body>
663
- </html>
565
+ <table class='report'><thead><tr><td class='heading'>Name</td>
566
+ <td class='heading'>Total lines</td>
567
+ <td class='heading'>Lines of code</td>
568
+ <td class='heading'>Total coverage</td>
569
+ <td class='heading'>Code coverage</td>
570
+ </tr>
571
+ </thead>
572
+ <tbody><tr class='light'><td><a href='lib-addressable-version_rb.html'>lib/addressable/version.rb</a>
573
+ </td>
574
+ <td class='lines_total'><tt>32</tt>
575
+ </td>
576
+ <td class='lines_code'><tt>8</tt>
577
+ </td>
578
+ <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_total'>100.0%</tt>
579
+ &nbsp;</td>
580
+ <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='100'/>
581
+ <td class='uncovered' width='0'/>
582
+ </tr>
583
+ </table>
584
+ </td>
585
+ </tr>
586
+ </table>
587
+ </td>
588
+ <td><table cellspacing='0' cellpadding='0' align='right'><tr><td><tt class='coverage_code'>100.0%</tt>
589
+ &nbsp;</td>
590
+ <td><table cellspacing='0' class='percent_graph' cellpadding='0' width='100'><tr><td class='covered' width='100'/>
591
+ <td class='uncovered' width='0'/>
592
+ </tr>
593
+ </table>
594
+ </td>
595
+ </tr>
596
+ </table>
597
+ </td>
598
+ </tr>
599
+ </tbody>
600
+ </table>
601
+ <pre><span class="inferred1"><a name="line1"></a> 1 #--
602
+ </span><span class="inferred0"><a name="line2"></a> 2 # Addressable, Copyright (c) 2006-2007 Bob Aman
603
+ </span><span class="inferred1"><a name="line3"></a> 3 #
604
+ </span><span class="inferred0"><a name="line4"></a> 4 # Permission is hereby granted, free of charge, to any person obtaining
605
+ </span><span class="inferred1"><a name="line5"></a> 5 # a copy of this software and associated documentation files (the
606
+ </span><span class="inferred0"><a name="line6"></a> 6 # &quot;Software&quot;), to deal in the Software without restriction, including
607
+ </span><span class="inferred1"><a name="line7"></a> 7 # without limitation the rights to use, copy, modify, merge, publish,
608
+ </span><span class="inferred0"><a name="line8"></a> 8 # distribute, sublicense, and/or sell copies of the Software, and to
609
+ </span><span class="inferred1"><a name="line9"></a> 9 # permit persons to whom the Software is furnished to do so, subject to
610
+ </span><span class="inferred0"><a name="line10"></a>10 # the following conditions:
611
+ </span><span class="inferred1"><a name="line11"></a>11 #
612
+ </span><span class="inferred0"><a name="line12"></a>12 # The above copyright notice and this permission notice shall be
613
+ </span><span class="inferred1"><a name="line13"></a>13 # included in all copies or substantial portions of the Software.
614
+ </span><span class="inferred0"><a name="line14"></a>14 #
615
+ </span><span class="inferred1"><a name="line15"></a>15 # THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND,
616
+ </span><span class="inferred0"><a name="line16"></a>16 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
617
+ </span><span class="inferred1"><a name="line17"></a>17 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
618
+ </span><span class="inferred0"><a name="line18"></a>18 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
619
+ </span><span class="inferred1"><a name="line19"></a>19 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
620
+ </span><span class="inferred0"><a name="line20"></a>20 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
621
+ </span><span class="inferred1"><a name="line21"></a>21 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
622
+ </span><span class="inferred0"><a name="line22"></a>22 #++
623
+ </span><span class="inferred1"><a name="line23"></a>23
624
+ </span><span class="marked0"><a name="line24"></a>24 module Addressable
625
+ </span><span class="marked1"><a name="line25"></a>25 module ADDRESSABLE_VERSION #:nodoc:
626
+ </span><span class="marked0"><a name="line26"></a>26 MAJOR = 1
627
+ </span><span class="marked1"><a name="line27"></a>27 MINOR = 0
628
+ </span><span class="marked0"><a name="line28"></a>28 TINY = 0
629
+ </span><span class="inferred1"><a name="line29"></a>29
630
+ </span><span class="marked0"><a name="line30"></a>30 STRING = [MAJOR, MINOR, TINY].join('.')
631
+ </span><span class="inferred1"><a name="line31"></a>31 end
632
+ </span><span class="inferred0"><a name="line32"></a>32 end
633
+ </span></pre><hr/>
634
+ <p>Generated using the <a href='http://eigenclass.org/hiki.rb?rcov'>rcov code coverage analysis tool for Ruby</a>
635
+ version 0.8.1.2.</p>
636
+ <p><a href='http://validator.w3.org/check/referer'><img src='http://www.w3.org/Icons/valid-xhtml10' height='31' alt='Valid XHTML 1.0!' width='88'/>
637
+ </a>
638
+ <a href='http://jigsaw.w3.org/css-validator/check/referer'><img src='http://jigsaw.w3.org/css-validator/images/vcss' alt='Valid CSS!' style='border:0;width:88px;height:31px'/>
639
+ </a>
640
+ </p>
641
+ </body>
642
+ </html>
@@ -268,28 +268,28 @@ This method does not take IRIs or IDNs into account.
268
268
  onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
269
269
  <div class="method-source-code" id="M000009-source">
270
270
  <pre>
271
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 354</span>
272
- 354: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-identifier">uri</span>)
273
- 355: <span class="ruby-identifier">uri_object</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>)
274
- 356: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
275
- 357: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">scheme</span>,
276
- 358: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">SCHEME</span>),
277
- 359: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">user</span>,
278
- 360: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
279
- 361: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">password</span>,
280
- 362: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
281
- 363: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">host</span>,
282
- 364: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
283
- 365: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">specified_port</span>,
284
- 366: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
285
- 367: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">path</span>,
286
- 368: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH</span>),
287
- 369: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">query</span>,
288
- 370: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">QUERY</span>),
289
- 371: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">fragment</span>,
290
- 372: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">FRAGMENT</span>)
291
- 373: ).<span class="ruby-identifier">to_s</span>
292
- 374: <span class="ruby-keyword kw">end</span>
271
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 357</span>
272
+ 357: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode</span>(<span class="ruby-identifier">uri</span>)
273
+ 358: <span class="ruby-identifier">uri_object</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>)
274
+ 359: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
275
+ 360: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">scheme</span>,
276
+ 361: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">SCHEME</span>),
277
+ 362: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">user</span>,
278
+ 363: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
279
+ 364: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">password</span>,
280
+ 365: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
281
+ 366: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">host</span>,
282
+ 367: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
283
+ 368: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">specified_port</span>,
284
+ 369: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
285
+ 370: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">path</span>,
286
+ 371: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH</span>),
287
+ 372: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">query</span>,
288
+ 373: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">QUERY</span>),
289
+ 374: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">fragment</span>,
290
+ 375: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">FRAGMENT</span>)
291
+ 376: ).<span class="ruby-identifier">to_s</span>
292
+ 377: <span class="ruby-keyword kw">end</span>
293
293
  </pre>
294
294
  </div>
295
295
  </div>
@@ -326,17 +326,17 @@ An example:
326
326
  onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
327
327
  <div class="method-source-code" id="M000007-source">
328
328
  <pre>
329
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 332</span>
330
- 332: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segment</span>, <span class="ruby-identifier">character_class</span>=
331
- 333: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">RESERVED</span> <span class="ruby-operator">+</span>
332
- 334: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">UNRESERVED</span>)
333
- 335: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">nil?</span>
334
- 336: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">gsub</span>(
335
- 337: <span class="ruby-node">/[^#{character_class}]/</span>
336
- 338: ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sequence</span><span class="ruby-operator">|</span>
337
- 339: (<span class="ruby-value str">&quot;%&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sequence</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'C'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">upcase</span>)
338
- 340: <span class="ruby-keyword kw">end</span>
339
- 341: <span class="ruby-keyword kw">end</span>
329
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 335</span>
330
+ 335: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segment</span>, <span class="ruby-identifier">character_class</span>=
331
+ 336: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">RESERVED</span> <span class="ruby-operator">+</span>
332
+ 337: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">UNRESERVED</span>)
333
+ 338: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">nil?</span>
334
+ 339: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">gsub</span>(
335
+ 340: <span class="ruby-node">/[^#{character_class}]/</span>
336
+ 341: ) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sequence</span><span class="ruby-operator">|</span>
337
+ 342: (<span class="ruby-value str">&quot;%&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">sequence</span>.<span class="ruby-identifier">unpack</span>(<span class="ruby-value str">'C'</span>)[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_s</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">upcase</span>)
338
+ 343: <span class="ruby-keyword kw">end</span>
339
+ 344: <span class="ruby-keyword kw">end</span>
340
340
  </pre>
341
341
  </div>
342
342
  </div>
@@ -440,58 +440,58 @@ Extracts uris from an arbitrary body of text.
440
440
  onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
441
441
  <div class="method-source-code" id="M000011-source">
442
442
  <pre>
443
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 420</span>
444
- 420: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">extract</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span>={})
445
- 421: <span class="ruby-identifier">defaults</span> = {<span class="ruby-identifier">:base</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:parse</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>}
446
- 422: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
447
- 423: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOptionError</span> <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">options</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">keys</span>).<span class="ruby-identifier">empty?</span>
448
- 424: <span class="ruby-comment cmt"># This regular expression needs to be less forgiving or else it would</span>
449
- 425: <span class="ruby-comment cmt"># match virtually all text. Which isn't exactly what we're going for.</span>
450
- 426: <span class="ruby-identifier">extract_regex</span> = <span class="ruby-regexp re">/((([a-z\+]+):)[^ \n\&lt;\&gt;\&quot;\\]+[\w\/])/</span>
451
- 427: <span class="ruby-identifier">extracted_uris</span> =
452
- 428: <span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">extract_regex</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>[<span class="ruby-value">0</span>] }
453
- 429: <span class="ruby-identifier">sgml_extract_regex</span> = <span class="ruby-regexp re">/&lt;[^&gt;]+href=\&quot;([^\&quot;]+?)\&quot;[^&gt;]*&gt;/</span>
454
- 430: <span class="ruby-identifier">sgml_extracted_uris</span> =
455
- 431: <span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">sgml_extract_regex</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>[<span class="ruby-value">0</span>] }
456
- 432: <span class="ruby-identifier">extracted_uris</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">sgml_extracted_uris</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">extracted_uris</span>)
457
- 433: <span class="ruby-identifier">textile_extract_regex</span> = <span class="ruby-regexp re">/\&quot;.+?\&quot;:([^ ]+\/[^ ]+)[ \,\.\;\:\?\!\&lt;\&gt;\&quot;]/i</span>
458
- 434: <span class="ruby-identifier">textile_extracted_uris</span> =
459
- 435: <span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">textile_extract_regex</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>[<span class="ruby-value">0</span>] }
460
- 436: <span class="ruby-identifier">extracted_uris</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">textile_extracted_uris</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">extracted_uris</span>)
461
- 437: <span class="ruby-identifier">parsed_uris</span> = []
462
- 438: <span class="ruby-identifier">base_uri</span> = <span class="ruby-keyword kw">nil</span>
463
- 439: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
464
- 440: <span class="ruby-identifier">base_uri</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base</span>].<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>)
465
- 441: <span class="ruby-identifier">base_uri</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base</span>].<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_uri</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
466
- 442: <span class="ruby-keyword kw">end</span>
467
- 443: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">uri_string</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">extracted_uris</span>
468
- 444: <span class="ruby-keyword kw">begin</span>
469
- 445: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_uri</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
470
- 446: <span class="ruby-identifier">parsed_uris</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri_string</span>)
471
- 447: <span class="ruby-keyword kw">else</span>
472
- 448: <span class="ruby-identifier">parsed_uris</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">base_uri</span> <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri_string</span>))
473
- 449: <span class="ruby-keyword kw">end</span>
474
- 450: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
475
- 451: <span class="ruby-keyword kw">nil</span>
476
- 452: <span class="ruby-keyword kw">end</span>
477
- 453: <span class="ruby-keyword kw">end</span>
478
- 454: <span class="ruby-identifier">parsed_uris</span>.<span class="ruby-identifier">reject!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span>
479
- 455: (<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/T\d+/</span> <span class="ruby-operator">||</span>
480
- 456: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;xmlns&quot;</span> <span class="ruby-operator">||</span>
481
- 457: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;xml&quot;</span> <span class="ruby-operator">||</span>
482
- 458: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;thr&quot;</span> <span class="ruby-operator">||</span>
483
- 459: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;this&quot;</span> <span class="ruby-operator">||</span>
484
- 460: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;float&quot;</span> <span class="ruby-operator">||</span>
485
- 461: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;user&quot;</span> <span class="ruby-operator">||</span>
486
- 462: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;username&quot;</span> <span class="ruby-operator">||</span>
487
- 463: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;out&quot;</span>)
488
- 464: <span class="ruby-keyword kw">end</span>
489
- 465: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:parse</span>]
490
- 466: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">parsed_uris</span>
491
- 467: <span class="ruby-keyword kw">else</span>
492
- 468: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">parsed_uris</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span> }
493
- 469: <span class="ruby-keyword kw">end</span>
494
- 470: <span class="ruby-keyword kw">end</span>
443
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 423</span>
444
+ 423: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">extract</span>(<span class="ruby-identifier">text</span>, <span class="ruby-identifier">options</span>={})
445
+ 424: <span class="ruby-identifier">defaults</span> = {<span class="ruby-identifier">:base</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">nil</span>, <span class="ruby-identifier">:parse</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">false</span>}
446
+ 425: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">options</span>)
447
+ 426: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidOptionError</span> <span class="ruby-keyword kw">unless</span> (<span class="ruby-identifier">options</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">defaults</span>.<span class="ruby-identifier">keys</span>).<span class="ruby-identifier">empty?</span>
448
+ 427: <span class="ruby-comment cmt"># This regular expression needs to be less forgiving or else it would</span>
449
+ 428: <span class="ruby-comment cmt"># match virtually all text. Which isn't exactly what we're going for.</span>
450
+ 429: <span class="ruby-identifier">extract_regex</span> = <span class="ruby-regexp re">/((([a-z\+]+):)[^ \n\&lt;\&gt;\&quot;\\]+[\w\/])/</span>
451
+ 430: <span class="ruby-identifier">extracted_uris</span> =
452
+ 431: <span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">extract_regex</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>[<span class="ruby-value">0</span>] }
453
+ 432: <span class="ruby-identifier">sgml_extract_regex</span> = <span class="ruby-regexp re">/&lt;[^&gt;]+href=\&quot;([^\&quot;]+?)\&quot;[^&gt;]*&gt;/</span>
454
+ 433: <span class="ruby-identifier">sgml_extracted_uris</span> =
455
+ 434: <span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">sgml_extract_regex</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>[<span class="ruby-value">0</span>] }
456
+ 435: <span class="ruby-identifier">extracted_uris</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">sgml_extracted_uris</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">extracted_uris</span>)
457
+ 436: <span class="ruby-identifier">textile_extract_regex</span> = <span class="ruby-regexp re">/\&quot;.+?\&quot;:([^ ]+\/[^ ]+)[ \,\.\;\:\?\!\&lt;\&gt;\&quot;]/i</span>
458
+ 437: <span class="ruby-identifier">textile_extracted_uris</span> =
459
+ 438: <span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">textile_extract_regex</span>).<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">match</span><span class="ruby-operator">|</span> <span class="ruby-identifier">match</span>[<span class="ruby-value">0</span>] }
460
+ 439: <span class="ruby-identifier">extracted_uris</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">textile_extracted_uris</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">extracted_uris</span>)
461
+ 440: <span class="ruby-identifier">parsed_uris</span> = []
462
+ 441: <span class="ruby-identifier">base_uri</span> = <span class="ruby-keyword kw">nil</span>
463
+ 442: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
464
+ 443: <span class="ruby-identifier">base_uri</span> = <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base</span>].<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>)
465
+ 444: <span class="ruby-identifier">base_uri</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">options</span>[<span class="ruby-identifier">:base</span>].<span class="ruby-identifier">to_s</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_uri</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
466
+ 445: <span class="ruby-keyword kw">end</span>
467
+ 446: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">uri_string</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">extracted_uris</span>
468
+ 447: <span class="ruby-keyword kw">begin</span>
469
+ 448: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_uri</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
470
+ 449: <span class="ruby-identifier">parsed_uris</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri_string</span>)
471
+ 450: <span class="ruby-keyword kw">else</span>
472
+ 451: <span class="ruby-identifier">parsed_uris</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-identifier">base_uri</span> <span class="ruby-operator">+</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri_string</span>))
473
+ 452: <span class="ruby-keyword kw">end</span>
474
+ 453: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
475
+ 454: <span class="ruby-keyword kw">nil</span>
476
+ 455: <span class="ruby-keyword kw">end</span>
477
+ 456: <span class="ruby-keyword kw">end</span>
478
+ 457: <span class="ruby-identifier">parsed_uris</span>.<span class="ruby-identifier">reject!</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span>
479
+ 458: (<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/T\d+/</span> <span class="ruby-operator">||</span>
480
+ 459: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;xmlns&quot;</span> <span class="ruby-operator">||</span>
481
+ 460: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;xml&quot;</span> <span class="ruby-operator">||</span>
482
+ 461: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;thr&quot;</span> <span class="ruby-operator">||</span>
483
+ 462: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;this&quot;</span> <span class="ruby-operator">||</span>
484
+ 463: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;float&quot;</span> <span class="ruby-operator">||</span>
485
+ 464: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;user&quot;</span> <span class="ruby-operator">||</span>
486
+ 465: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;username&quot;</span> <span class="ruby-operator">||</span>
487
+ 466: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;out&quot;</span>)
488
+ 467: <span class="ruby-keyword kw">end</span>
489
+ 468: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:parse</span>]
490
+ 469: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">parsed_uris</span>
491
+ 470: <span class="ruby-keyword kw">else</span>
492
+ 471: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">parsed_uris</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span> }
493
+ 472: <span class="ruby-keyword kw">end</span>
494
+ 473: <span class="ruby-keyword kw">end</span>
495
495
  </pre>
496
496
  </div>
497
497
  </div>
@@ -580,10 +580,10 @@ href="URI.html#M000030">path</a>&gt;
580
580
  onclick="toggleCode('M000025-source');return false;">[Source]</a></p>
581
581
  <div class="method-source-code" id="M000025-source">
582
582
  <pre>
583
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 643</span>
584
- 643: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ip_based_schemes</span>
585
- 644: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme_mapping</span>.<span class="ruby-identifier">keys</span>
586
- 645: <span class="ruby-keyword kw">end</span>
583
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 646</span>
584
+ 646: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">ip_based_schemes</span>
585
+ 647: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme_mapping</span>.<span class="ruby-identifier">keys</span>
586
+ 648: <span class="ruby-keyword kw">end</span>
587
587
  </pre>
588
588
  </div>
589
589
  </div>
@@ -606,17 +606,17 @@ Joins several uris together.
606
606
  onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
607
607
  <div class="method-source-code" id="M000006-source">
608
608
  <pre>
609
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 309</span>
610
- 309: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">join</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">uris</span>)
611
- 310: <span class="ruby-identifier">uri_objects</span> = <span class="ruby-identifier">uris</span>.<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span>
612
- 311: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>)
613
- 312: <span class="ruby-keyword kw">end</span>
614
- 313: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">uri_objects</span>.<span class="ruby-identifier">shift</span>.<span class="ruby-identifier">dup</span>
615
- 314: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">uri</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">uri_objects</span>
616
- 315: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">uri</span>)
617
- 316: <span class="ruby-keyword kw">end</span>
618
- 317: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
619
- 318: <span class="ruby-keyword kw">end</span>
609
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 312</span>
610
+ 312: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">join</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">uris</span>)
611
+ 313: <span class="ruby-identifier">uri_objects</span> = <span class="ruby-identifier">uris</span>.<span class="ruby-identifier">collect</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">uri</span><span class="ruby-operator">|</span>
612
+ 314: <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>)
613
+ 315: <span class="ruby-keyword kw">end</span>
614
+ 316: <span class="ruby-identifier">result</span> = <span class="ruby-identifier">uri_objects</span>.<span class="ruby-identifier">shift</span>.<span class="ruby-identifier">dup</span>
615
+ 317: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">uri</span> <span class="ruby-keyword kw">in</span> <span class="ruby-identifier">uri_objects</span>
616
+ 318: <span class="ruby-identifier">result</span>.<span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">uri</span>)
617
+ 319: <span class="ruby-keyword kw">end</span>
618
+ 320: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">result</span>
619
+ 321: <span class="ruby-keyword kw">end</span>
620
620
  </pre>
621
621
  </div>
622
622
  </div>
@@ -640,27 +640,27 @@ parts. Passing nil for any of these parameters is acceptable.
640
640
  onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
641
641
  <div class="method-source-code" id="M000012-source">
642
642
  <pre>
643
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 474</span>
644
- 474: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">scheme</span>, <span class="ruby-identifier">user</span>, <span class="ruby-identifier">password</span>, <span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">fragment</span>)
645
- 475: <span class="ruby-ivar">@scheme</span> = <span class="ruby-identifier">scheme</span>
646
- 476: <span class="ruby-ivar">@scheme</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@scheme</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
647
- 477: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">user</span>
648
- 478: <span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
649
- 479: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
650
- 480: <span class="ruby-ivar">@specified_port</span> = <span class="ruby-identifier">port</span>.<span class="ruby-identifier">to_s</span>
651
- 481: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">port</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Fixnum</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">port</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">port</span>
652
- 482: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@port</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-ivar">@port</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+$/</span>)
653
- 483: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidURIError</span>,
654
- 484: <span class="ruby-node">&quot;Invalid port number: #{@port.inspect}&quot;</span>
655
- 485: <span class="ruby-keyword kw">end</span>
656
- 486: <span class="ruby-ivar">@port</span> = <span class="ruby-ivar">@port</span>.<span class="ruby-identifier">to_i</span>
657
- 487: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@port</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
658
- 488: <span class="ruby-ivar">@path</span> = (<span class="ruby-identifier">path</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>)
659
- 489: <span class="ruby-ivar">@query</span> = <span class="ruby-identifier">query</span>
660
- 490: <span class="ruby-ivar">@fragment</span> = <span class="ruby-identifier">fragment</span>
661
- 491:
662
- 492: <span class="ruby-identifier">validate</span>()
663
- 493: <span class="ruby-keyword kw">end</span>
643
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 477</span>
644
+ 477: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">scheme</span>, <span class="ruby-identifier">user</span>, <span class="ruby-identifier">password</span>, <span class="ruby-identifier">host</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">query</span>, <span class="ruby-identifier">fragment</span>)
645
+ 478: <span class="ruby-ivar">@scheme</span> = <span class="ruby-identifier">scheme</span>
646
+ 479: <span class="ruby-ivar">@scheme</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@scheme</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
647
+ 480: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">user</span>
648
+ 481: <span class="ruby-ivar">@password</span> = <span class="ruby-identifier">password</span>
649
+ 482: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">host</span>
650
+ 483: <span class="ruby-ivar">@specified_port</span> = <span class="ruby-identifier">port</span>.<span class="ruby-identifier">to_s</span>
651
+ 484: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">port</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Fixnum</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">port</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">port</span>
652
+ 485: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@port</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span>(<span class="ruby-ivar">@port</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^\d+$/</span>)
653
+ 486: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidURIError</span>,
654
+ 487: <span class="ruby-node">&quot;Invalid port number: #{@port.inspect}&quot;</span>
655
+ 488: <span class="ruby-keyword kw">end</span>
656
+ 489: <span class="ruby-ivar">@port</span> = <span class="ruby-ivar">@port</span>.<span class="ruby-identifier">to_i</span>
657
+ 490: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@port</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
658
+ 491: <span class="ruby-ivar">@path</span> = (<span class="ruby-identifier">path</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>)
659
+ 492: <span class="ruby-ivar">@query</span> = <span class="ruby-identifier">query</span>
660
+ 493: <span class="ruby-ivar">@fragment</span> = <span class="ruby-identifier">fragment</span>
661
+ 494:
662
+ 495: <span class="ruby-identifier">validate</span>()
663
+ 496: <span class="ruby-keyword kw">end</span>
664
664
  </pre>
665
665
  </div>
666
666
  </div>
@@ -685,43 +685,43 @@ names.
685
685
  onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
686
686
  <div class="method-source-code" id="M000010-source">
687
687
  <pre>
688
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 382</span>
689
- 382: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalized_encode</span>(<span class="ruby-identifier">uri</span>)
690
- 383: <span class="ruby-identifier">uri_object</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>)
691
- 384: <span class="ruby-identifier">segments</span> = {
692
- 385: <span class="ruby-identifier">:scheme</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">scheme</span>),
693
- 386: <span class="ruby-identifier">:user</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">user</span>),
694
- 387: <span class="ruby-identifier">:password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">password</span>),
695
- 388: <span class="ruby-identifier">:host</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">host</span>),
696
- 389: <span class="ruby-identifier">:port</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">specified_port</span>),
697
- 390: <span class="ruby-identifier">:path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">path</span>),
698
- 391: <span class="ruby-identifier">:query</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">query</span>),
699
- 392: <span class="ruby-identifier">:fragment</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">fragment</span>)
700
- 393: }
701
- 394: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">IDNA</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:use_libidn?</span>)
702
- 395: <span class="ruby-identifier">segments</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
703
- 396: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
704
- 397: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-constant">IDN</span><span class="ruby-operator">::</span><span class="ruby-constant">Stringprep</span>.<span class="ruby-identifier">nfkc_normalize</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>)
705
- 398: <span class="ruby-keyword kw">end</span>
706
- 399: <span class="ruby-keyword kw">end</span>
707
- 400: <span class="ruby-keyword kw">end</span>
708
- 401: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
709
- 402: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:scheme</span>],
710
- 403: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">SCHEME</span>),
711
- 404: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:user</span>],
712
- 405: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
713
- 406: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:password</span>],
714
- 407: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
715
- 408: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:host</span>],
716
- 409: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:port</span>],
717
- 410: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:path</span>],
718
- 411: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH</span>),
719
- 412: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:query</span>],
720
- 413: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">QUERY</span>),
721
- 414: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:fragment</span>],
722
- 415: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">FRAGMENT</span>)
723
- 416: ).<span class="ruby-identifier">to_s</span>
724
- 417: <span class="ruby-keyword kw">end</span>
688
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 385</span>
689
+ 385: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalized_encode</span>(<span class="ruby-identifier">uri</span>)
690
+ 386: <span class="ruby-identifier">uri_object</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">uri</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>)
691
+ 387: <span class="ruby-identifier">segments</span> = {
692
+ 388: <span class="ruby-identifier">:scheme</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">scheme</span>),
693
+ 389: <span class="ruby-identifier">:user</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">user</span>),
694
+ 390: <span class="ruby-identifier">:password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">password</span>),
695
+ 391: <span class="ruby-identifier">:host</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">host</span>),
696
+ 392: <span class="ruby-identifier">:port</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">specified_port</span>),
697
+ 393: <span class="ruby-identifier">:path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">path</span>),
698
+ 394: <span class="ruby-identifier">:query</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">query</span>),
699
+ 395: <span class="ruby-identifier">:fragment</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">uri_object</span>.<span class="ruby-identifier">fragment</span>)
700
+ 396: }
701
+ 397: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">IDNA</span>.<span class="ruby-identifier">send</span>(<span class="ruby-identifier">:use_libidn?</span>)
702
+ 398: <span class="ruby-identifier">segments</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
703
+ 399: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
704
+ 400: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-constant">IDN</span><span class="ruby-operator">::</span><span class="ruby-constant">Stringprep</span>.<span class="ruby-identifier">nfkc_normalize</span>(<span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>)
705
+ 401: <span class="ruby-keyword kw">end</span>
706
+ 402: <span class="ruby-keyword kw">end</span>
707
+ 403: <span class="ruby-keyword kw">end</span>
708
+ 404: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
709
+ 405: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:scheme</span>],
710
+ 406: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">SCHEME</span>),
711
+ 407: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:user</span>],
712
+ 408: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
713
+ 409: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:password</span>],
714
+ 410: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">AUTHORITY</span>),
715
+ 411: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:host</span>],
716
+ 412: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:port</span>],
717
+ 413: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:path</span>],
718
+ 414: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">PATH</span>),
719
+ 415: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:query</span>],
720
+ 416: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">QUERY</span>),
721
+ 417: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">encode_segment</span>(<span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:fragment</span>],
722
+ 418: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">CharacterClasses</span><span class="ruby-operator">::</span><span class="ruby-constant">FRAGMENT</span>)
723
+ 419: ).<span class="ruby-identifier">to_s</span>
724
+ 420: <span class="ruby-keyword kw">end</span>
725
725
  </pre>
726
726
  </div>
727
727
  </div>
@@ -813,26 +813,26 @@ allow for better <a href="URI.html">URI</a> normalization.
813
813
  onclick="toggleCode('M000026-source');return false;">[Source]</a></p>
814
814
  <div class="method-source-code" id="M000026-source">
815
815
  <pre>
816
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 650</span>
817
- 650: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme_mapping</span>
818
- 651: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@protocol_mapping</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@protocol_mapping</span>.<span class="ruby-identifier">nil?</span>
819
- 652: <span class="ruby-ivar">@protocol_mapping</span> = {
820
- 653: <span class="ruby-value str">&quot;http&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">80</span>,
821
- 654: <span class="ruby-value str">&quot;https&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">443</span>,
822
- 655: <span class="ruby-value str">&quot;ftp&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">21</span>,
823
- 656: <span class="ruby-value str">&quot;tftp&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">69</span>,
824
- 657: <span class="ruby-value str">&quot;ssh&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">22</span>,
825
- 658: <span class="ruby-value str">&quot;svn+ssh&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">22</span>,
826
- 659: <span class="ruby-value str">&quot;telnet&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">23</span>,
827
- 660: <span class="ruby-value str">&quot;nntp&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">119</span>,
828
- 661: <span class="ruby-value str">&quot;gopher&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">70</span>,
829
- 662: <span class="ruby-value str">&quot;wais&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">210</span>,
830
- 663: <span class="ruby-value str">&quot;ldap&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">389</span>,
831
- 664: <span class="ruby-value str">&quot;prospero&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1525</span>
832
- 665: }
833
- 666: <span class="ruby-keyword kw">end</span>
834
- 667: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@protocol_mapping</span>
835
- 668: <span class="ruby-keyword kw">end</span>
816
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 653</span>
817
+ 653: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme_mapping</span>
818
+ 654: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@protocol_mapping</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@protocol_mapping</span>.<span class="ruby-identifier">nil?</span>
819
+ 655: <span class="ruby-ivar">@protocol_mapping</span> = {
820
+ 656: <span class="ruby-value str">&quot;http&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">80</span>,
821
+ 657: <span class="ruby-value str">&quot;https&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">443</span>,
822
+ 658: <span class="ruby-value str">&quot;ftp&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">21</span>,
823
+ 659: <span class="ruby-value str">&quot;tftp&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">69</span>,
824
+ 660: <span class="ruby-value str">&quot;ssh&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">22</span>,
825
+ 661: <span class="ruby-value str">&quot;svn+ssh&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">22</span>,
826
+ 662: <span class="ruby-value str">&quot;telnet&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">23</span>,
827
+ 663: <span class="ruby-value str">&quot;nntp&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">119</span>,
828
+ 664: <span class="ruby-value str">&quot;gopher&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">70</span>,
829
+ 665: <span class="ruby-value str">&quot;wais&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">210</span>,
830
+ 666: <span class="ruby-value str">&quot;ldap&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">389</span>,
831
+ 667: <span class="ruby-value str">&quot;prospero&quot;</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1525</span>
832
+ 668: }
833
+ 669: <span class="ruby-keyword kw">end</span>
834
+ 670: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@protocol_mapping</span>
835
+ 671: <span class="ruby-keyword kw">end</span>
836
836
  </pre>
837
837
  </div>
838
838
  </div>
@@ -856,13 +856,13 @@ href="URI.html">URI</a> segment. Returns a string.
856
856
  onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
857
857
  <div class="method-source-code" id="M000008-source">
858
858
  <pre>
859
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 345</span>
860
- 345: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">segment</span>)
861
- 346: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">nil?</span>
862
- 347: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/%[0-9a-f]{2}/i</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sequence</span><span class="ruby-operator">|</span>
863
- 348: <span class="ruby-identifier">sequence</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">3</span>].<span class="ruby-identifier">to_i</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">chr</span>
864
- 349: <span class="ruby-keyword kw">end</span>
865
- 350: <span class="ruby-keyword kw">end</span>
859
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 348</span>
860
+ 348: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">unencode_segment</span>(<span class="ruby-identifier">segment</span>)
861
+ 349: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">nil?</span>
862
+ 350: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">segment</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/%[0-9a-f]{2}/i</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">sequence</span><span class="ruby-operator">|</span>
863
+ 351: <span class="ruby-identifier">sequence</span>[<span class="ruby-value">1</span><span class="ruby-operator">..</span><span class="ruby-value">3</span>].<span class="ruby-identifier">to_i</span>(<span class="ruby-value">16</span>).<span class="ruby-identifier">chr</span>
864
+ 352: <span class="ruby-keyword kw">end</span>
865
+ 353: <span class="ruby-keyword kw">end</span>
866
866
  </pre>
867
867
  </div>
868
868
  </div>
@@ -887,96 +887,96 @@ Joins two URIs together.
887
887
  onclick="toggleCode('M000041-source');return false;">[Source]</a></p>
888
888
  <div class="method-source-code" id="M000041-source">
889
889
  <pre>
890
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 769</span>
891
- 769: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span>(<span class="ruby-identifier">uri</span>)
892
- 770: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
893
- 771: <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>)
894
- 772: <span class="ruby-keyword kw">end</span>
895
- 773: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
896
- 774: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
890
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 772</span>
891
+ 772: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">+</span>(<span class="ruby-identifier">uri</span>)
892
+ 773: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
893
+ 774: <span class="ruby-identifier">uri</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>)
897
894
  775: <span class="ruby-keyword kw">end</span>
898
- 776:
899
- 777: <span class="ruby-identifier">joined_scheme</span> = <span class="ruby-keyword kw">nil</span>
900
- 778: <span class="ruby-identifier">joined_user</span> = <span class="ruby-keyword kw">nil</span>
901
- 779: <span class="ruby-identifier">joined_password</span> = <span class="ruby-keyword kw">nil</span>
902
- 780: <span class="ruby-identifier">joined_host</span> = <span class="ruby-keyword kw">nil</span>
903
- 781: <span class="ruby-identifier">joined_port</span> = <span class="ruby-keyword kw">nil</span>
904
- 782: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">nil</span>
905
- 783: <span class="ruby-identifier">joined_query</span> = <span class="ruby-keyword kw">nil</span>
906
- 784: <span class="ruby-identifier">joined_fragment</span> = <span class="ruby-keyword kw">nil</span>
907
- 785:
908
- 786: <span class="ruby-comment cmt"># Section 5.2.2 of RFC 3986</span>
909
- 787: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
910
- 788: <span class="ruby-identifier">joined_scheme</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span>
911
- 789: <span class="ruby-identifier">joined_user</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">user</span>
912
- 790: <span class="ruby-identifier">joined_password</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">password</span>
913
- 791: <span class="ruby-identifier">joined_host</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>
914
- 792: <span class="ruby-identifier">joined_port</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">specified_port</span>
915
- 793: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
916
- 794: <span class="ruby-identifier">joined_query</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
917
- 795: <span class="ruby-keyword kw">else</span>
918
- 796: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">authority</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
919
- 797: <span class="ruby-identifier">joined_user</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">user</span>
920
- 798: <span class="ruby-identifier">joined_password</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">password</span>
921
- 799: <span class="ruby-identifier">joined_host</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>
922
- 800: <span class="ruby-identifier">joined_port</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">specified_port</span>
923
- 801: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
924
- 802: <span class="ruby-identifier">joined_query</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
925
- 803: <span class="ruby-keyword kw">else</span>
926
- 804: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
927
- 805: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>
928
- 806: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
929
- 807: <span class="ruby-identifier">joined_query</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
930
- 808: <span class="ruby-keyword kw">else</span>
931
- 809: <span class="ruby-identifier">joined_query</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>
932
- 810: <span class="ruby-keyword kw">end</span>
933
- 811: <span class="ruby-keyword kw">else</span>
934
- 812: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;/&quot;</span>
935
- 813: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
936
- 814: <span class="ruby-keyword kw">else</span>
937
- 815: <span class="ruby-identifier">base_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">dup</span>
938
- 816: <span class="ruby-identifier">base_path</span> = <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_path</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
939
- 817: <span class="ruby-identifier">base_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">base_path</span>)
940
- 818:
941
- 819: <span class="ruby-comment cmt"># Section 5.2.3 of RFC 3986</span>
942
- 820: <span class="ruby-comment cmt">#</span>
943
- 821: <span class="ruby-comment cmt"># Removes the right-most path segment from the base path.</span>
944
- 822: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_path</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\//</span>
945
- 823: <span class="ruby-identifier">base_path</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\/[^\/]+$/</span>, <span class="ruby-value str">&quot;/&quot;</span>)
946
- 824: <span class="ruby-keyword kw">else</span>
947
- 825: <span class="ruby-identifier">base_path</span> = <span class="ruby-value str">&quot;&quot;</span>
948
- 826: <span class="ruby-keyword kw">end</span>
949
- 827:
950
- 828: <span class="ruby-comment cmt"># If the base path is empty and an authority segment has been</span>
951
- 829: <span class="ruby-comment cmt"># defined, use a base path of &quot;/&quot;</span>
952
- 830: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">authority</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
953
- 831: <span class="ruby-identifier">base_path</span> = <span class="ruby-value str">&quot;/&quot;</span>
954
- 832: <span class="ruby-keyword kw">end</span>
955
- 833:
956
- 834: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">base_path</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
957
- 835: <span class="ruby-keyword kw">end</span>
958
- 836: <span class="ruby-identifier">joined_query</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
959
- 837: <span class="ruby-keyword kw">end</span>
960
- 838: <span class="ruby-identifier">joined_user</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>
961
- 839: <span class="ruby-identifier">joined_password</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>
962
- 840: <span class="ruby-identifier">joined_host</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>
963
- 841: <span class="ruby-identifier">joined_port</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">specified_port</span>
964
- 842: <span class="ruby-keyword kw">end</span>
965
- 843: <span class="ruby-identifier">joined_scheme</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>
966
- 844: <span class="ruby-keyword kw">end</span>
967
- 845: <span class="ruby-identifier">joined_fragment</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">fragment</span>
968
- 846:
969
- 847: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
970
- 848: <span class="ruby-identifier">joined_scheme</span>,
971
- 849: <span class="ruby-identifier">joined_user</span>,
972
- 850: <span class="ruby-identifier">joined_password</span>,
973
- 851: <span class="ruby-identifier">joined_host</span>,
974
- 852: <span class="ruby-identifier">joined_port</span>,
975
- 853: <span class="ruby-identifier">joined_path</span>,
976
- 854: <span class="ruby-identifier">joined_query</span>,
977
- 855: <span class="ruby-identifier">joined_fragment</span>
978
- 856: )
979
- 857: <span class="ruby-keyword kw">end</span>
895
+ 776: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
896
+ 777: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">dup</span>
897
+ 778: <span class="ruby-keyword kw">end</span>
898
+ 779:
899
+ 780: <span class="ruby-identifier">joined_scheme</span> = <span class="ruby-keyword kw">nil</span>
900
+ 781: <span class="ruby-identifier">joined_user</span> = <span class="ruby-keyword kw">nil</span>
901
+ 782: <span class="ruby-identifier">joined_password</span> = <span class="ruby-keyword kw">nil</span>
902
+ 783: <span class="ruby-identifier">joined_host</span> = <span class="ruby-keyword kw">nil</span>
903
+ 784: <span class="ruby-identifier">joined_port</span> = <span class="ruby-keyword kw">nil</span>
904
+ 785: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">nil</span>
905
+ 786: <span class="ruby-identifier">joined_query</span> = <span class="ruby-keyword kw">nil</span>
906
+ 787: <span class="ruby-identifier">joined_fragment</span> = <span class="ruby-keyword kw">nil</span>
907
+ 788:
908
+ 789: <span class="ruby-comment cmt"># Section 5.2.2 of RFC 3986</span>
909
+ 790: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
910
+ 791: <span class="ruby-identifier">joined_scheme</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span>
911
+ 792: <span class="ruby-identifier">joined_user</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">user</span>
912
+ 793: <span class="ruby-identifier">joined_password</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">password</span>
913
+ 794: <span class="ruby-identifier">joined_host</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>
914
+ 795: <span class="ruby-identifier">joined_port</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">specified_port</span>
915
+ 796: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
916
+ 797: <span class="ruby-identifier">joined_query</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
917
+ 798: <span class="ruby-keyword kw">else</span>
918
+ 799: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">authority</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
919
+ 800: <span class="ruby-identifier">joined_user</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">user</span>
920
+ 801: <span class="ruby-identifier">joined_password</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">password</span>
921
+ 802: <span class="ruby-identifier">joined_host</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>
922
+ 803: <span class="ruby-identifier">joined_port</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">specified_port</span>
923
+ 804: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
924
+ 805: <span class="ruby-identifier">joined_query</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
925
+ 806: <span class="ruby-keyword kw">else</span>
926
+ 807: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
927
+ 808: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>
928
+ 809: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
929
+ 810: <span class="ruby-identifier">joined_query</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
930
+ 811: <span class="ruby-keyword kw">else</span>
931
+ 812: <span class="ruby-identifier">joined_query</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>
932
+ 813: <span class="ruby-keyword kw">end</span>
933
+ 814: <span class="ruby-keyword kw">else</span>
934
+ 815: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;/&quot;</span>
935
+ 816: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
936
+ 817: <span class="ruby-keyword kw">else</span>
937
+ 818: <span class="ruby-identifier">base_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">dup</span>
938
+ 819: <span class="ruby-identifier">base_path</span> = <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_path</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
939
+ 820: <span class="ruby-identifier">base_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">base_path</span>)
940
+ 821:
941
+ 822: <span class="ruby-comment cmt"># Section 5.2.3 of RFC 3986</span>
942
+ 823: <span class="ruby-comment cmt">#</span>
943
+ 824: <span class="ruby-comment cmt"># Removes the right-most path segment from the base path.</span>
944
+ 825: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_path</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\//</span>
945
+ 826: <span class="ruby-identifier">base_path</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/\/[^\/]+$/</span>, <span class="ruby-value str">&quot;/&quot;</span>)
946
+ 827: <span class="ruby-keyword kw">else</span>
947
+ 828: <span class="ruby-identifier">base_path</span> = <span class="ruby-value str">&quot;&quot;</span>
948
+ 829: <span class="ruby-keyword kw">end</span>
949
+ 830:
950
+ 831: <span class="ruby-comment cmt"># If the base path is empty and an authority segment has been</span>
951
+ 832: <span class="ruby-comment cmt"># defined, use a base path of &quot;/&quot;</span>
952
+ 833: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">base_path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">authority</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
953
+ 834: <span class="ruby-identifier">base_path</span> = <span class="ruby-value str">&quot;/&quot;</span>
954
+ 835: <span class="ruby-keyword kw">end</span>
955
+ 836:
956
+ 837: <span class="ruby-identifier">joined_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">base_path</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)
957
+ 838: <span class="ruby-keyword kw">end</span>
958
+ 839: <span class="ruby-identifier">joined_query</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
959
+ 840: <span class="ruby-keyword kw">end</span>
960
+ 841: <span class="ruby-identifier">joined_user</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>
961
+ 842: <span class="ruby-identifier">joined_password</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>
962
+ 843: <span class="ruby-identifier">joined_host</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>
963
+ 844: <span class="ruby-identifier">joined_port</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">specified_port</span>
964
+ 845: <span class="ruby-keyword kw">end</span>
965
+ 846: <span class="ruby-identifier">joined_scheme</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>
966
+ 847: <span class="ruby-keyword kw">end</span>
967
+ 848: <span class="ruby-identifier">joined_fragment</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">fragment</span>
968
+ 849:
969
+ 850: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
970
+ 851: <span class="ruby-identifier">joined_scheme</span>,
971
+ 852: <span class="ruby-identifier">joined_user</span>,
972
+ 853: <span class="ruby-identifier">joined_password</span>,
973
+ 854: <span class="ruby-identifier">joined_host</span>,
974
+ 855: <span class="ruby-identifier">joined_port</span>,
975
+ 856: <span class="ruby-identifier">joined_path</span>,
976
+ 857: <span class="ruby-identifier">joined_query</span>,
977
+ 858: <span class="ruby-identifier">joined_fragment</span>
978
+ 859: )
979
+ 860: <span class="ruby-keyword kw">end</span>
980
980
  </pre>
981
981
  </div>
982
982
  </div>
@@ -1000,11 +1000,11 @@ method normalizes both URIs before doing the comparison.
1000
1000
  onclick="toggleCode('M000052-source');return false;">[Source]</a></p>
1001
1001
  <div class="method-source-code" id="M000052-source">
1002
1002
  <pre>
1003
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1043</span>
1004
- 1043: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">uri</span>)
1005
- 1044: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
1006
- 1045: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span>
1007
- 1046: <span class="ruby-keyword kw">end</span>
1003
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1046</span>
1004
+ 1046: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">==</span>(<span class="ruby-identifier">uri</span>)
1005
+ 1047: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
1006
+ 1048: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span>
1007
+ 1049: <span class="ruby-keyword kw">end</span>
1008
1008
  </pre>
1009
1009
  </div>
1010
1010
  </div>
@@ -1029,19 +1029,19 @@ comparison against strings.
1029
1029
  onclick="toggleCode('M000051-source');return false;">[Source]</a></p>
1030
1030
  <div class="method-source-code" id="M000051-source">
1031
1031
  <pre>
1032
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1028</span>
1033
- 1028: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">===</span>(<span class="ruby-identifier">uri</span>)
1034
- 1029: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:normalize</span>)
1035
- 1030: <span class="ruby-identifier">uri_string</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span>
1036
- 1031: <span class="ruby-keyword kw">else</span>
1037
- 1032: <span class="ruby-keyword kw">begin</span>
1038
- 1033: <span class="ruby-identifier">uri_string</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span>
1039
- 1034: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">InvalidURIError</span>
1040
- 1035: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
1041
- 1036: <span class="ruby-keyword kw">end</span>
1042
- 1037: <span class="ruby-keyword kw">end</span>
1043
- 1038: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri_string</span>
1044
- 1039: <span class="ruby-keyword kw">end</span>
1032
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1031</span>
1033
+ 1031: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">===</span>(<span class="ruby-identifier">uri</span>)
1034
+ 1032: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:normalize</span>)
1035
+ 1033: <span class="ruby-identifier">uri_string</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span>
1036
+ 1034: <span class="ruby-keyword kw">else</span>
1037
+ 1035: <span class="ruby-keyword kw">begin</span>
1038
+ 1036: <span class="ruby-identifier">uri_string</span> = <span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>).<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span>
1039
+ 1037: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">InvalidURIError</span>
1040
+ 1038: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
1041
+ 1039: <span class="ruby-keyword kw">end</span>
1042
+ 1040: <span class="ruby-keyword kw">end</span>
1043
+ 1041: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri_string</span>
1044
+ 1042: <span class="ruby-keyword kw">end</span>
1045
1045
  </pre>
1046
1046
  </div>
1047
1047
  </div>
@@ -1064,10 +1064,10 @@ Returns true if this <a href="URI.html">URI</a> is known to be absolute.
1064
1064
  onclick="toggleCode('M000040-source');return false;">[Source]</a></p>
1065
1065
  <div class="method-source-code" id="M000040-source">
1066
1066
  <pre>
1067
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 764</span>
1068
- 764: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">absolute?</span>
1069
- 765: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-identifier">relative?</span>
1070
- 766: <span class="ruby-keyword kw">end</span>
1067
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 767</span>
1068
+ 767: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">absolute?</span>
1069
+ 768: <span class="ruby-keyword kw">return</span> <span class="ruby-operator">!</span><span class="ruby-identifier">relative?</span>
1070
+ 769: <span class="ruby-keyword kw">end</span>
1071
1071
  </pre>
1072
1072
  </div>
1073
1073
  </div>
@@ -1091,21 +1091,21 @@ href="URI.html">URI</a>.
1091
1091
  onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
1092
1092
  <div class="method-source-code" id="M000023-source">
1093
1093
  <pre>
1094
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 598</span>
1095
- 598: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authority</span>
1096
- 599: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@authority</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@authority</span>.<span class="ruby-identifier">nil?</span>
1097
- 600: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>.<span class="ruby-identifier">nil?</span>
1098
- 601: <span class="ruby-ivar">@authority</span> = <span class="ruby-value str">&quot;&quot;</span>
1099
- 602: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">userinfo</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1100
- 603: <span class="ruby-ivar">@authority</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{self.userinfo}@&quot;</span>
1101
- 604: <span class="ruby-keyword kw">end</span>
1102
- 605: <span class="ruby-ivar">@authority</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>
1103
- 606: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">specified_port</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1104
- 607: <span class="ruby-ivar">@authority</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;:#{self.specified_port}&quot;</span>
1105
- 608: <span class="ruby-keyword kw">end</span>
1106
- 609: <span class="ruby-keyword kw">end</span>
1107
- 610: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@authority</span>
1108
- 611: <span class="ruby-keyword kw">end</span>
1094
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 601</span>
1095
+ 601: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authority</span>
1096
+ 602: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@authority</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@authority</span>.<span class="ruby-identifier">nil?</span>
1097
+ 603: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>.<span class="ruby-identifier">nil?</span>
1098
+ 604: <span class="ruby-ivar">@authority</span> = <span class="ruby-value str">&quot;&quot;</span>
1099
+ 605: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">userinfo</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1100
+ 606: <span class="ruby-ivar">@authority</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{self.userinfo}@&quot;</span>
1101
+ 607: <span class="ruby-keyword kw">end</span>
1102
+ 608: <span class="ruby-ivar">@authority</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>
1103
+ 609: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">specified_port</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1104
+ 610: <span class="ruby-ivar">@authority</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;:#{self.specified_port}&quot;</span>
1105
+ 611: <span class="ruby-keyword kw">end</span>
1106
+ 612: <span class="ruby-keyword kw">end</span>
1107
+ 613: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@authority</span>
1108
+ 614: <span class="ruby-keyword kw">end</span>
1109
1109
  </pre>
1110
1110
  </div>
1111
1111
  </div>
@@ -1129,32 +1129,32 @@ href="URI.html">URI</a>.
1129
1129
  onclick="toggleCode('M000024-source');return false;">[Source]</a></p>
1130
1130
  <div class="method-source-code" id="M000024-source">
1131
1131
  <pre>
1132
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 614</span>
1133
- 614: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authority=</span>(<span class="ruby-identifier">new_authority</span>)
1134
- 615: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_authority</span>
1135
- 616: <span class="ruby-identifier">new_userinfo</span> = <span class="ruby-identifier">new_authority</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^([^\[\]]*)@/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
1136
- 617: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_userinfo</span>
1137
- 618: <span class="ruby-identifier">new_user</span> = <span class="ruby-identifier">new_userinfo</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^([^:]*):?/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
1138
- 619: <span class="ruby-identifier">new_password</span> = <span class="ruby-identifier">new_userinfo</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/:(.*)$/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
1139
- 620: <span class="ruby-keyword kw">end</span>
1140
- 621: <span class="ruby-identifier">new_host</span> =
1141
- 622: <span class="ruby-identifier">new_authority</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^([^\[\]]*)@/</span>, <span class="ruby-value str">&quot;&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/:([^:@\[\]]*?)$/</span>, <span class="ruby-value str">&quot;&quot;</span>)
1142
- 623: <span class="ruby-identifier">new_port</span> =
1143
- 624: <span class="ruby-identifier">new_authority</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/:([^:@\[\]]*?)$/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
1144
- 625: <span class="ruby-keyword kw">end</span>
1145
- 626:
1146
- 627: <span class="ruby-comment cmt"># Password assigned first to ensure validity in case of nil</span>
1147
- 628: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span> = <span class="ruby-identifier">new_password</span>
1148
- 629: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span> = <span class="ruby-identifier">new_user</span>
1149
- 630: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span> = <span class="ruby-identifier">new_host</span>
1150
- 631:
1151
- 632: <span class="ruby-comment cmt"># Port reset to allow port normalization</span>
1152
- 633: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">nil</span>
1153
- 634: <span class="ruby-ivar">@specified_port</span> = <span class="ruby-identifier">new_port</span>
1154
- 635:
1155
- 636: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
1156
- 637: <span class="ruby-identifier">validate</span>()
1157
- 638: <span class="ruby-keyword kw">end</span>
1132
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 617</span>
1133
+ 617: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">authority=</span>(<span class="ruby-identifier">new_authority</span>)
1134
+ 618: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_authority</span>
1135
+ 619: <span class="ruby-identifier">new_userinfo</span> = <span class="ruby-identifier">new_authority</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^([^\[\]]*)@/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
1136
+ 620: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">new_userinfo</span>
1137
+ 621: <span class="ruby-identifier">new_user</span> = <span class="ruby-identifier">new_userinfo</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^([^:]*):?/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
1138
+ 622: <span class="ruby-identifier">new_password</span> = <span class="ruby-identifier">new_userinfo</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/:(.*)$/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
1139
+ 623: <span class="ruby-keyword kw">end</span>
1140
+ 624: <span class="ruby-identifier">new_host</span> =
1141
+ 625: <span class="ruby-identifier">new_authority</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/^([^\[\]]*)@/</span>, <span class="ruby-value str">&quot;&quot;</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/:([^:@\[\]]*?)$/</span>, <span class="ruby-value str">&quot;&quot;</span>)
1142
+ 626: <span class="ruby-identifier">new_port</span> =
1143
+ 627: <span class="ruby-identifier">new_authority</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/:([^:@\[\]]*?)$/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
1144
+ 628: <span class="ruby-keyword kw">end</span>
1145
+ 629:
1146
+ 630: <span class="ruby-comment cmt"># Password assigned first to ensure validity in case of nil</span>
1147
+ 631: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span> = <span class="ruby-identifier">new_password</span>
1148
+ 632: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span> = <span class="ruby-identifier">new_user</span>
1149
+ 633: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span> = <span class="ruby-identifier">new_host</span>
1150
+ 634:
1151
+ 635: <span class="ruby-comment cmt"># Port reset to allow port normalization</span>
1152
+ 636: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">nil</span>
1153
+ 637: <span class="ruby-ivar">@specified_port</span> = <span class="ruby-identifier">new_port</span>
1154
+ 638:
1155
+ 639: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
1156
+ 640: <span class="ruby-identifier">validate</span>()
1157
+ 641: <span class="ruby-keyword kw">end</span>
1158
1158
  </pre>
1159
1159
  </div>
1160
1160
  </div>
@@ -1179,11 +1179,11 @@ there is no <a href="URI.html#M000030">path</a> component.
1179
1179
  onclick="toggleCode('M000032-source');return false;">[Source]</a></p>
1180
1180
  <div class="method-source-code" id="M000032-source">
1181
1181
  <pre>
1182
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 716</span>
1183
- 716: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">basename</span>
1184
- 717: <span class="ruby-comment cmt"># Path cannot be nil</span>
1185
- 718: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/;[^\/]*$/</span>, <span class="ruby-value str">&quot;&quot;</span>)
1186
- 719: <span class="ruby-keyword kw">end</span>
1182
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 719</span>
1183
+ 719: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">basename</span>
1184
+ 720: <span class="ruby-comment cmt"># Path cannot be nil</span>
1185
+ 721: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/;[^\/]*$/</span>, <span class="ruby-value str">&quot;&quot;</span>)
1186
+ 722: <span class="ruby-keyword kw">end</span>
1187
1187
  </pre>
1188
1188
  </div>
1189
1189
  </div>
@@ -1209,17 +1209,17 @@ more information.
1209
1209
  onclick="toggleCode('M000050-source');return false;">[Source]</a></p>
1210
1210
  <div class="method-source-code" id="M000050-source">
1211
1211
  <pre>
1212
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1014</span>
1213
- 1014: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">display_uri</span>
1214
- 1015: <span class="ruby-identifier">display_uri</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>
1215
- 1016: <span class="ruby-keyword kw">begin</span>
1216
- 1017: <span class="ruby-identifier">display_uri</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value str">&quot;@host&quot;</span>,
1217
- 1018: <span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">IDNA</span>.<span class="ruby-identifier">to_unicode</span>(<span class="ruby-identifier">display_uri</span>.<span class="ruby-identifier">host</span>))
1218
- 1019: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
1219
- 1020: <span class="ruby-keyword kw">nil</span>
1220
- 1021: <span class="ruby-keyword kw">end</span>
1221
- 1022: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">display_uri</span>
1222
- 1023: <span class="ruby-keyword kw">end</span>
1212
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1017</span>
1213
+ 1017: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">display_uri</span>
1214
+ 1018: <span class="ruby-identifier">display_uri</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>
1215
+ 1019: <span class="ruby-keyword kw">begin</span>
1216
+ 1020: <span class="ruby-identifier">display_uri</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value str">&quot;@host&quot;</span>,
1217
+ 1021: <span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">IDNA</span>.<span class="ruby-identifier">to_unicode</span>(<span class="ruby-identifier">display_uri</span>.<span class="ruby-identifier">host</span>))
1218
+ 1022: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
1219
+ 1023: <span class="ruby-keyword kw">nil</span>
1220
+ 1024: <span class="ruby-keyword kw">end</span>
1221
+ 1025: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">display_uri</span>
1222
+ 1026: <span class="ruby-keyword kw">end</span>
1223
1223
  </pre>
1224
1224
  </div>
1225
1225
  </div>
@@ -1242,28 +1242,28 @@ Clones the <a href="URI.html">URI</a> object.
1242
1242
  onclick="toggleCode('M000054-source');return false;">[Source]</a></p>
1243
1243
  <div class="method-source-code" id="M000054-source">
1244
1244
  <pre>
1245
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1056</span>
1246
- 1056: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dup</span>
1247
- 1057: <span class="ruby-identifier">duplicated_scheme</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1248
- 1058: <span class="ruby-identifier">duplicated_user</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1249
- 1059: <span class="ruby-identifier">duplicated_password</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1250
- 1060: <span class="ruby-identifier">duplicated_host</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1251
- 1061: <span class="ruby-identifier">duplicated_port</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">specified_port</span>
1252
- 1062: <span class="ruby-identifier">duplicated_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1253
- 1063: <span class="ruby-identifier">duplicated_query</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1254
- 1064: <span class="ruby-identifier">duplicated_fragment</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1255
- 1065: <span class="ruby-identifier">duplicated_uri</span> = <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
1256
- 1066: <span class="ruby-identifier">duplicated_scheme</span>,
1257
- 1067: <span class="ruby-identifier">duplicated_user</span>,
1258
- 1068: <span class="ruby-identifier">duplicated_password</span>,
1259
- 1069: <span class="ruby-identifier">duplicated_host</span>,
1260
- 1070: <span class="ruby-identifier">duplicated_port</span>,
1261
- 1071: <span class="ruby-identifier">duplicated_path</span>,
1262
- 1072: <span class="ruby-identifier">duplicated_query</span>,
1263
- 1073: <span class="ruby-identifier">duplicated_fragment</span>
1264
- 1074: )
1265
- 1075: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">duplicated_uri</span>
1266
- 1076: <span class="ruby-keyword kw">end</span>
1245
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1059</span>
1246
+ 1059: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">dup</span>
1247
+ 1060: <span class="ruby-identifier">duplicated_scheme</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1248
+ 1061: <span class="ruby-identifier">duplicated_user</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1249
+ 1062: <span class="ruby-identifier">duplicated_password</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1250
+ 1063: <span class="ruby-identifier">duplicated_host</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1251
+ 1064: <span class="ruby-identifier">duplicated_port</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">specified_port</span>
1252
+ 1065: <span class="ruby-identifier">duplicated_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1253
+ 1066: <span class="ruby-identifier">duplicated_query</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1254
+ 1067: <span class="ruby-identifier">duplicated_fragment</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span> <span class="ruby-value">? </span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">dup</span> <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
1255
+ 1068: <span class="ruby-identifier">duplicated_uri</span> = <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
1256
+ 1069: <span class="ruby-identifier">duplicated_scheme</span>,
1257
+ 1070: <span class="ruby-identifier">duplicated_user</span>,
1258
+ 1071: <span class="ruby-identifier">duplicated_password</span>,
1259
+ 1072: <span class="ruby-identifier">duplicated_host</span>,
1260
+ 1073: <span class="ruby-identifier">duplicated_port</span>,
1261
+ 1074: <span class="ruby-identifier">duplicated_path</span>,
1262
+ 1075: <span class="ruby-identifier">duplicated_query</span>,
1263
+ 1076: <span class="ruby-identifier">duplicated_fragment</span>
1264
+ 1077: )
1265
+ 1078: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">duplicated_uri</span>
1266
+ 1079: <span class="ruby-keyword kw">end</span>
1267
1267
  </pre>
1268
1268
  </div>
1269
1269
  </div>
@@ -1288,11 +1288,11 @@ href="URI.html">URI</a> before doing the comparison.
1288
1288
  onclick="toggleCode('M000053-source');return false;">[Source]</a></p>
1289
1289
  <div class="method-source-code" id="M000053-source">
1290
1290
  <pre>
1291
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1050</span>
1292
- 1050: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">uri</span>)
1293
- 1051: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
1294
- 1052: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>
1295
- 1053: <span class="ruby-keyword kw">end</span>
1291
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1053</span>
1292
+ 1053: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">eql?</span>(<span class="ruby-identifier">uri</span>)
1293
+ 1054: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>)
1294
+ 1055: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>
1295
+ 1056: <span class="ruby-keyword kw">end</span>
1296
1296
  </pre>
1297
1297
  </div>
1298
1298
  </div>
@@ -1318,11 +1318,11 @@ href="URI.html#M000030">path</a> component.
1318
1318
  onclick="toggleCode('M000033-source');return false;">[Source]</a></p>
1319
1319
  <div class="method-source-code" id="M000033-source">
1320
1320
  <pre>
1321
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 724</span>
1322
- 724: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extname</span>
1323
- 725: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>
1324
- 726: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">basename</span>)
1325
- 727: <span class="ruby-keyword kw">end</span>
1321
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 727</span>
1322
+ 727: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">extname</span>
1323
+ 728: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>
1324
+ 729: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">extname</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">basename</span>)
1325
+ 730: <span class="ruby-keyword kw">end</span>
1326
1326
  </pre>
1327
1327
  </div>
1328
1328
  </div>
@@ -1407,25 +1407,28 @@ An example:
1407
1407
  285: <span class="ruby-identifier">capture_group</span>
1408
1408
  286: <span class="ruby-keyword kw">end</span>)
1409
1409
  287: <span class="ruby-identifier">values</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">regexp</span>).<span class="ruby-identifier">flatten</span>
1410
- 288: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">variables</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">size</span>
1411
- 289: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">variables</span>.<span class="ruby-identifier">size</span>
1412
- 290: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">variables</span>[<span class="ruby-identifier">i</span>]
1413
- 291: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">values</span>[<span class="ruby-identifier">i</span>]
1414
- 292:
1415
- 293: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">processor</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1416
- 294: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">processor</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:restore</span>)
1417
- 295: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">processor</span>.<span class="ruby-identifier">restore</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>)
1418
- 296: <span class="ruby-keyword kw">end</span>
1419
- 297: <span class="ruby-keyword kw">end</span>
1420
- 298:
1421
- 299: <span class="ruby-identifier">mapping</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span>
1422
- 300: <span class="ruby-keyword kw">end</span>
1423
- 301: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mapping</span>
1424
- 302: <span class="ruby-keyword kw">else</span>
1425
- 303: <span class="ruby-comment cmt"># Pattern failed to match URI.</span>
1426
- 304: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1427
- 305: <span class="ruby-keyword kw">end</span>
1428
- 306: <span class="ruby-keyword kw">end</span>
1410
+ 288:
1411
+ 289: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">variables</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">values</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">variables</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
1412
+ 290: <span class="ruby-keyword kw">for</span> <span class="ruby-identifier">i</span> <span class="ruby-keyword kw">in</span> <span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-identifier">variables</span>.<span class="ruby-identifier">size</span>
1413
+ 291: <span class="ruby-identifier">name</span> = <span class="ruby-identifier">variables</span>[<span class="ruby-identifier">i</span>]
1414
+ 292: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">values</span>[<span class="ruby-identifier">i</span>]
1415
+ 293:
1416
+ 294: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">processor</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1417
+ 295: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">processor</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:restore</span>)
1418
+ 296: <span class="ruby-identifier">value</span> = <span class="ruby-identifier">processor</span>.<span class="ruby-identifier">restore</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span>)
1419
+ 297: <span class="ruby-keyword kw">end</span>
1420
+ 298: <span class="ruby-keyword kw">end</span>
1421
+ 299:
1422
+ 300: <span class="ruby-identifier">mapping</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">value</span>
1423
+ 301: <span class="ruby-keyword kw">end</span>
1424
+ 302: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">mapping</span>
1425
+ 303: <span class="ruby-keyword kw">elsif</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">pattern</span>
1426
+ 304: <span class="ruby-keyword kw">return</span> {}
1427
+ 305: <span class="ruby-keyword kw">else</span>
1428
+ 306: <span class="ruby-comment cmt"># Pattern failed to match URI.</span>
1429
+ 307: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
1430
+ 308: <span class="ruby-keyword kw">end</span>
1431
+ 309: <span class="ruby-keyword kw">end</span>
1429
1432
  </pre>
1430
1433
  </div>
1431
1434
  </div>
@@ -1449,10 +1452,10 @@ href="URI.html">URI</a>.
1449
1452
  onclick="toggleCode('M000036-source');return false;">[Source]</a></p>
1450
1453
  <div class="method-source-code" id="M000036-source">
1451
1454
  <pre>
1452
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 740</span>
1453
- 740: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fragment</span>
1454
- 741: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@fragment</span>
1455
- 742: <span class="ruby-keyword kw">end</span>
1455
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 743</span>
1456
+ 743: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fragment</span>
1457
+ 744: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@fragment</span>
1458
+ 745: <span class="ruby-keyword kw">end</span>
1456
1459
  </pre>
1457
1460
  </div>
1458
1461
  </div>
@@ -1476,10 +1479,10 @@ href="URI.html">URI</a>.
1476
1479
  onclick="toggleCode('M000037-source');return false;">[Source]</a></p>
1477
1480
  <div class="method-source-code" id="M000037-source">
1478
1481
  <pre>
1479
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 745</span>
1480
- 745: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fragment=</span>(<span class="ruby-identifier">new_fragment</span>)
1481
- 746: <span class="ruby-ivar">@fragment</span> = <span class="ruby-identifier">new_fragment</span>
1482
- 747: <span class="ruby-keyword kw">end</span>
1482
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 748</span>
1483
+ 748: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">fragment=</span>(<span class="ruby-identifier">new_fragment</span>)
1484
+ 749: <span class="ruby-ivar">@fragment</span> = <span class="ruby-identifier">new_fragment</span>
1485
+ 750: <span class="ruby-keyword kw">end</span>
1483
1486
  </pre>
1484
1487
  </div>
1485
1488
  </div>
@@ -1503,10 +1506,10 @@ href="URI.html">URI</a>.
1503
1506
  onclick="toggleCode('M000021-source');return false;">[Source]</a></p>
1504
1507
  <div class="method-source-code" id="M000021-source">
1505
1508
  <pre>
1506
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 582</span>
1507
- 582: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host</span>
1508
- 583: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@host</span>
1509
- 584: <span class="ruby-keyword kw">end</span>
1509
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 585</span>
1510
+ 585: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host</span>
1511
+ 586: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@host</span>
1512
+ 587: <span class="ruby-keyword kw">end</span>
1510
1513
  </pre>
1511
1514
  </div>
1512
1515
  </div>
@@ -1530,16 +1533,16 @@ href="URI.html">URI</a>.
1530
1533
  onclick="toggleCode('M000022-source');return false;">[Source]</a></p>
1531
1534
  <div class="method-source-code" id="M000022-source">
1532
1535
  <pre>
1533
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 587</span>
1534
- 587: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host=</span>(<span class="ruby-identifier">new_host</span>)
1535
- 588: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">new_host</span>
1536
- 589:
1537
- 590: <span class="ruby-comment cmt"># Reset dependant values</span>
1538
- 591: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
1536
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 590</span>
1537
+ 590: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">host=</span>(<span class="ruby-identifier">new_host</span>)
1538
+ 591: <span class="ruby-ivar">@host</span> = <span class="ruby-identifier">new_host</span>
1539
1539
  592:
1540
- 593: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
1541
- 594: <span class="ruby-identifier">validate</span>()
1542
- 595: <span class="ruby-keyword kw">end</span>
1540
+ 593: <span class="ruby-comment cmt"># Reset dependant values</span>
1541
+ 594: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
1542
+ 595:
1543
+ 596: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
1544
+ 597: <span class="ruby-identifier">validate</span>()
1545
+ 598: <span class="ruby-keyword kw">end</span>
1543
1546
  </pre>
1544
1547
  </div>
1545
1548
  </div>
@@ -1563,10 +1566,10 @@ object&#8216;s state.
1563
1566
  onclick="toggleCode('M000057-source');return false;">[Source]</a></p>
1564
1567
  <div class="method-source-code" id="M000057-source">
1565
1568
  <pre>
1566
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1104</span>
1567
- 1104: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
1568
- 1105: <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;#&lt;%s:%#0x URI:%s&gt;&quot;</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">object_id</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>)
1569
- 1106: <span class="ruby-keyword kw">end</span>
1569
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1107</span>
1570
+ 1107: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">inspect</span>
1571
+ 1108: <span class="ruby-identifier">sprintf</span>(<span class="ruby-value str">&quot;#&lt;%s:%#0x URI:%s&gt;&quot;</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">object_id</span>, <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>)
1572
+ 1109: <span class="ruby-keyword kw">end</span>
1570
1573
  </pre>
1571
1574
  </div>
1572
1575
  </div>
@@ -1589,14 +1592,14 @@ Returns true if the <a href="URI.html">URI</a> uses an IP-based protocol.
1589
1592
  onclick="toggleCode('M000038-source');return false;">[Source]</a></p>
1590
1593
  <div class="method-source-code" id="M000038-source">
1591
1594
  <pre>
1592
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 750</span>
1593
- 750: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ip_based?</span>
1594
- 751: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>
1595
- 752: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ip_based_schemes</span>.<span class="ruby-identifier">include?</span>(
1596
- 753: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>)
1597
- 754: <span class="ruby-keyword kw">end</span>
1598
- 755: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
1599
- 756: <span class="ruby-keyword kw">end</span>
1595
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 753</span>
1596
+ 753: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">ip_based?</span>
1597
+ 754: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>
1598
+ 755: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">ip_based_schemes</span>.<span class="ruby-identifier">include?</span>(
1599
+ 756: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>)
1600
+ 757: <span class="ruby-keyword kw">end</span>
1601
+ 758: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">false</span>
1602
+ 759: <span class="ruby-keyword kw">end</span>
1600
1603
  </pre>
1601
1604
  </div>
1602
1605
  </div>
@@ -1647,10 +1650,10 @@ Merges two URIs together.
1647
1650
  onclick="toggleCode('M000042-source');return false;">[Source]</a></p>
1648
1651
  <div class="method-source-code" id="M000042-source">
1649
1652
  <pre>
1650
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 860</span>
1651
- 860: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge</span>(<span class="ruby-identifier">uri</span>)
1652
- 861: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>
1653
- 862: <span class="ruby-keyword kw">end</span>
1653
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 863</span>
1654
+ 863: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge</span>(<span class="ruby-identifier">uri</span>)
1655
+ 864: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">uri</span>
1656
+ 865: <span class="ruby-keyword kw">end</span>
1654
1657
  </pre>
1655
1658
  </div>
1656
1659
  </div>
@@ -1673,10 +1676,10 @@ Destructive form of <a href="URI.html#M000042">merge</a>.
1673
1676
  onclick="toggleCode('M000044-source');return false;">[Source]</a></p>
1674
1677
  <div class="method-source-code" id="M000044-source">
1675
1678
  <pre>
1676
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 866</span>
1677
- 866: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">uri</span>)
1678
- 867: <span class="ruby-identifier">replace_self</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">uri</span>))
1679
- 868: <span class="ruby-keyword kw">end</span>
1679
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 869</span>
1680
+ 869: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">merge!</span>(<span class="ruby-identifier">uri</span>)
1681
+ 870: <span class="ruby-identifier">replace_self</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">merge</span>(<span class="ruby-identifier">uri</span>))
1682
+ 871: <span class="ruby-keyword kw">end</span>
1680
1683
  </pre>
1681
1684
  </div>
1682
1685
  </div>
@@ -1706,75 +1709,75 @@ multiple times.
1706
1709
  onclick="toggleCode('M000048-source');return false;">[Source]</a></p>
1707
1710
  <div class="method-source-code" id="M000048-source">
1708
1711
  <pre>
1709
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 937</span>
1710
- 937: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">normalize</span>
1711
- 938: <span class="ruby-identifier">normalized_scheme</span> = <span class="ruby-keyword kw">nil</span>
1712
- 939: <span class="ruby-identifier">normalized_scheme</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1713
- 940: <span class="ruby-identifier">normalized_scheme</span> = <span class="ruby-value str">&quot;svn+ssh&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;ssh+svn&quot;</span>
1714
- 941: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;feed&quot;</span>
1715
- 942: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^feed:\/*http:\/*/</span>
1716
- 943: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">parse</span>(
1717
- 944: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^feed:\/*(http:\/*.*)/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]).<span class="ruby-identifier">normalize</span>
1718
- 945: <span class="ruby-keyword kw">end</span>
1719
- 946: <span class="ruby-keyword kw">end</span>
1720
- 947: <span class="ruby-identifier">normalized_user</span> = <span class="ruby-keyword kw">nil</span>
1721
- 948: <span class="ruby-identifier">normalized_user</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1722
- 949: <span class="ruby-identifier">normalized_password</span> = <span class="ruby-keyword kw">nil</span>
1723
- 950: <span class="ruby-identifier">normalized_password</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1724
- 951:
1725
- 952: <span class="ruby-comment cmt"># If we are using http or https and user/password are blank,</span>
1726
- 953: <span class="ruby-comment cmt"># then we remove them</span>
1727
- 954: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_scheme</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/https?/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">normalized_user</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-operator">&amp;&amp;</span>
1728
- 955: (<span class="ruby-operator">!</span><span class="ruby-identifier">normalized_password</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">normalized_password</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>)
1729
- 956: <span class="ruby-identifier">normalized_user</span> = <span class="ruby-keyword kw">nil</span>
1730
- 957: <span class="ruby-identifier">normalized_password</span> = <span class="ruby-keyword kw">nil</span>
1731
- 958: <span class="ruby-keyword kw">end</span>
1732
- 959:
1733
- 960: <span class="ruby-identifier">normalized_host</span> = <span class="ruby-keyword kw">nil</span>
1734
- 961: <span class="ruby-identifier">normalized_host</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1735
- 962: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_host</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1736
- 963: <span class="ruby-keyword kw">begin</span>
1737
- 964: <span class="ruby-identifier">normalized_host</span> = <span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">IDNA</span>.<span class="ruby-identifier">to_ascii</span>(<span class="ruby-identifier">normalized_host</span>)
1738
- 965: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
1739
- 966: <span class="ruby-keyword kw">nil</span>
1740
- 967: <span class="ruby-keyword kw">end</span>
1741
- 968: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_host</span>[<span class="ruby-value">-1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;.&quot;</span>
1742
- 969: <span class="ruby-identifier">normalized_host</span> = <span class="ruby-identifier">normalized_host</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-value">-1</span>]
1712
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 940</span>
1713
+ 940: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">normalize</span>
1714
+ 941: <span class="ruby-identifier">normalized_scheme</span> = <span class="ruby-keyword kw">nil</span>
1715
+ 942: <span class="ruby-identifier">normalized_scheme</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1716
+ 943: <span class="ruby-identifier">normalized_scheme</span> = <span class="ruby-value str">&quot;svn+ssh&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;ssh+svn&quot;</span>
1717
+ 944: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_scheme</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;feed&quot;</span>
1718
+ 945: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^feed:\/*http:\/*/</span>
1719
+ 946: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">parse</span>(
1720
+ 947: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^feed:\/*(http:\/*.*)/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]).<span class="ruby-identifier">normalize</span>
1721
+ 948: <span class="ruby-keyword kw">end</span>
1722
+ 949: <span class="ruby-keyword kw">end</span>
1723
+ 950: <span class="ruby-identifier">normalized_user</span> = <span class="ruby-keyword kw">nil</span>
1724
+ 951: <span class="ruby-identifier">normalized_user</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1725
+ 952: <span class="ruby-identifier">normalized_password</span> = <span class="ruby-keyword kw">nil</span>
1726
+ 953: <span class="ruby-identifier">normalized_password</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1727
+ 954:
1728
+ 955: <span class="ruby-comment cmt"># If we are using http or https and user/password are blank,</span>
1729
+ 956: <span class="ruby-comment cmt"># then we remove them</span>
1730
+ 957: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_scheme</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/https?/</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">normalized_user</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-operator">&amp;&amp;</span>
1731
+ 958: (<span class="ruby-operator">!</span><span class="ruby-identifier">normalized_password</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">normalized_password</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>)
1732
+ 959: <span class="ruby-identifier">normalized_user</span> = <span class="ruby-keyword kw">nil</span>
1733
+ 960: <span class="ruby-identifier">normalized_password</span> = <span class="ruby-keyword kw">nil</span>
1734
+ 961: <span class="ruby-keyword kw">end</span>
1735
+ 962:
1736
+ 963: <span class="ruby-identifier">normalized_host</span> = <span class="ruby-keyword kw">nil</span>
1737
+ 964: <span class="ruby-identifier">normalized_host</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1738
+ 965: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_host</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1739
+ 966: <span class="ruby-keyword kw">begin</span>
1740
+ 967: <span class="ruby-identifier">normalized_host</span> = <span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-constant">IDNA</span>.<span class="ruby-identifier">to_ascii</span>(<span class="ruby-identifier">normalized_host</span>)
1741
+ 968: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Exception</span>
1742
+ 969: <span class="ruby-keyword kw">nil</span>
1743
1743
  970: <span class="ruby-keyword kw">end</span>
1744
- 971: <span class="ruby-keyword kw">end</span>
1745
- 972:
1746
- 973: <span class="ruby-identifier">normalized_port</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">port</span>
1747
- 974: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">scheme_mapping</span>[<span class="ruby-identifier">normalized_scheme</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">normalized_port</span>
1748
- 975: <span class="ruby-identifier">normalized_port</span> = <span class="ruby-keyword kw">nil</span>
1749
- 976: <span class="ruby-keyword kw">end</span>
1750
- 977: <span class="ruby-identifier">normalized_path</span> = <span class="ruby-keyword kw">nil</span>
1751
- 978: <span class="ruby-identifier">normalized_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1752
- 979: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_path</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1753
- 980: <span class="ruby-identifier">normalized_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">normalized_path</span>)
1754
- 981: <span class="ruby-keyword kw">end</span>
1755
- 982: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
1756
- 983: <span class="ruby-keyword kw">if</span> [<span class="ruby-value str">&quot;http&quot;</span>, <span class="ruby-value str">&quot;https&quot;</span>, <span class="ruby-value str">&quot;ftp&quot;</span>, <span class="ruby-value str">&quot;tftp&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">normalized_scheme</span>)
1757
- 984: <span class="ruby-identifier">normalized_path</span> = <span class="ruby-value str">&quot;/&quot;</span>
1758
- 985: <span class="ruby-keyword kw">end</span>
1759
- 986: <span class="ruby-keyword kw">end</span>
1760
- 987:
1761
- 988: <span class="ruby-identifier">normalized_query</span> = <span class="ruby-keyword kw">nil</span>
1762
- 989: <span class="ruby-identifier">normalized_query</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1744
+ 971: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_host</span>[<span class="ruby-value">-1</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;.&quot;</span>
1745
+ 972: <span class="ruby-identifier">normalized_host</span> = <span class="ruby-identifier">normalized_host</span>[<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-value">-1</span>]
1746
+ 973: <span class="ruby-keyword kw">end</span>
1747
+ 974: <span class="ruby-keyword kw">end</span>
1748
+ 975:
1749
+ 976: <span class="ruby-identifier">normalized_port</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">port</span>
1750
+ 977: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">scheme_mapping</span>[<span class="ruby-identifier">normalized_scheme</span>] <span class="ruby-operator">==</span> <span class="ruby-identifier">normalized_port</span>
1751
+ 978: <span class="ruby-identifier">normalized_port</span> = <span class="ruby-keyword kw">nil</span>
1752
+ 979: <span class="ruby-keyword kw">end</span>
1753
+ 980: <span class="ruby-identifier">normalized_path</span> = <span class="ruby-keyword kw">nil</span>
1754
+ 981: <span class="ruby-identifier">normalized_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1755
+ 982: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_path</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1756
+ 983: <span class="ruby-identifier">normalized_path</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">normalize_path</span>(<span class="ruby-identifier">normalized_path</span>)
1757
+ 984: <span class="ruby-keyword kw">end</span>
1758
+ 985: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_path</span> <span class="ruby-operator">==</span> <span class="ruby-value str">&quot;&quot;</span>
1759
+ 986: <span class="ruby-keyword kw">if</span> [<span class="ruby-value str">&quot;http&quot;</span>, <span class="ruby-value str">&quot;https&quot;</span>, <span class="ruby-value str">&quot;ftp&quot;</span>, <span class="ruby-value str">&quot;tftp&quot;</span>].<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">normalized_scheme</span>)
1760
+ 987: <span class="ruby-identifier">normalized_path</span> = <span class="ruby-value str">&quot;/&quot;</span>
1761
+ 988: <span class="ruby-keyword kw">end</span>
1762
+ 989: <span class="ruby-keyword kw">end</span>
1763
1763
  990:
1764
- 991: <span class="ruby-identifier">normalized_fragment</span> = <span class="ruby-keyword kw">nil</span>
1765
- 992: <span class="ruby-identifier">normalized_fragment</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1766
- 993: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(
1767
- 994: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">normalized_encode</span>(<span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
1768
- 995: <span class="ruby-identifier">normalized_scheme</span>,
1769
- 996: <span class="ruby-identifier">normalized_user</span>,
1770
- 997: <span class="ruby-identifier">normalized_password</span>,
1771
- 998: <span class="ruby-identifier">normalized_host</span>,
1772
- 999: <span class="ruby-identifier">normalized_port</span>,
1773
- 1000: <span class="ruby-identifier">normalized_path</span>,
1774
- 1001: <span class="ruby-identifier">normalized_query</span>,
1775
- 1002: <span class="ruby-identifier">normalized_fragment</span>
1776
- 1003: )))
1777
- 1004: <span class="ruby-keyword kw">end</span>
1764
+ 991: <span class="ruby-identifier">normalized_query</span> = <span class="ruby-keyword kw">nil</span>
1765
+ 992: <span class="ruby-identifier">normalized_query</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1766
+ 993:
1767
+ 994: <span class="ruby-identifier">normalized_fragment</span> = <span class="ruby-keyword kw">nil</span>
1768
+ 995: <span class="ruby-identifier">normalized_fragment</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">strip</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1769
+ 996: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(
1770
+ 997: <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">normalized_encode</span>(<span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
1771
+ 998: <span class="ruby-identifier">normalized_scheme</span>,
1772
+ 999: <span class="ruby-identifier">normalized_user</span>,
1773
+ 1000: <span class="ruby-identifier">normalized_password</span>,
1774
+ 1001: <span class="ruby-identifier">normalized_host</span>,
1775
+ 1002: <span class="ruby-identifier">normalized_port</span>,
1776
+ 1003: <span class="ruby-identifier">normalized_path</span>,
1777
+ 1004: <span class="ruby-identifier">normalized_query</span>,
1778
+ 1005: <span class="ruby-identifier">normalized_fragment</span>
1779
+ 1006: )))
1780
+ 1007: <span class="ruby-keyword kw">end</span>
1778
1781
  </pre>
1779
1782
  </div>
1780
1783
  </div>
@@ -1797,10 +1800,10 @@ Destructively normalizes this <a href="URI.html">URI</a> object.
1797
1800
  onclick="toggleCode('M000049-source');return false;">[Source]</a></p>
1798
1801
  <div class="method-source-code" id="M000049-source">
1799
1802
  <pre>
1800
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1007</span>
1801
- 1007: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">normalize!</span>
1802
- 1008: <span class="ruby-identifier">replace_self</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>)
1803
- 1009: <span class="ruby-keyword kw">end</span>
1803
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1010</span>
1804
+ 1010: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">normalize!</span>
1805
+ 1011: <span class="ruby-identifier">replace_self</span>(<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>)
1806
+ 1012: <span class="ruby-keyword kw">end</span>
1804
1807
  </pre>
1805
1808
  </div>
1806
1809
  </div>
@@ -1824,10 +1827,10 @@ href="URI.html">URI</a>.
1824
1827
  onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
1825
1828
  <div class="method-source-code" id="M000017-source">
1826
1829
  <pre>
1827
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 528</span>
1828
- 528: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">password</span>
1829
- 529: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@password</span>
1830
- 530: <span class="ruby-keyword kw">end</span>
1830
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 531</span>
1831
+ 531: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">password</span>
1832
+ 532: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@password</span>
1833
+ 533: <span class="ruby-keyword kw">end</span>
1831
1834
  </pre>
1832
1835
  </div>
1833
1836
  </div>
@@ -1851,22 +1854,22 @@ href="URI.html">URI</a>.
1851
1854
  onclick="toggleCode('M000018-source');return false;">[Source]</a></p>
1852
1855
  <div class="method-source-code" id="M000018-source">
1853
1856
  <pre>
1854
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 533</span>
1855
- 533: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">password=</span>(<span class="ruby-identifier">new_password</span>)
1856
- 534: <span class="ruby-ivar">@password</span> = <span class="ruby-identifier">new_password</span>
1857
- 535:
1858
- 536: <span class="ruby-comment cmt"># You can't have a nil user with a non-nil password</span>
1859
- 537: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@password</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1860
- 538: <span class="ruby-ivar">@user</span> = <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@user</span>.<span class="ruby-identifier">nil?</span>
1861
- 539: <span class="ruby-keyword kw">end</span>
1862
- 540:
1863
- 541: <span class="ruby-comment cmt"># Reset dependant values</span>
1864
- 542: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-keyword kw">nil</span>
1865
- 543: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
1866
- 544:
1867
- 545: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
1868
- 546: <span class="ruby-identifier">validate</span>()
1869
- 547: <span class="ruby-keyword kw">end</span>
1857
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 536</span>
1858
+ 536: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">password=</span>(<span class="ruby-identifier">new_password</span>)
1859
+ 537: <span class="ruby-ivar">@password</span> = <span class="ruby-identifier">new_password</span>
1860
+ 538:
1861
+ 539: <span class="ruby-comment cmt"># You can't have a nil user with a non-nil password</span>
1862
+ 540: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@password</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
1863
+ 541: <span class="ruby-ivar">@user</span> = <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@user</span>.<span class="ruby-identifier">nil?</span>
1864
+ 542: <span class="ruby-keyword kw">end</span>
1865
+ 543:
1866
+ 544: <span class="ruby-comment cmt"># Reset dependant values</span>
1867
+ 545: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-keyword kw">nil</span>
1868
+ 546: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
1869
+ 547:
1870
+ 548: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
1871
+ 549: <span class="ruby-identifier">validate</span>()
1872
+ 550: <span class="ruby-keyword kw">end</span>
1870
1873
  </pre>
1871
1874
  </div>
1872
1875
  </div>
@@ -1890,10 +1893,10 @@ href="URI.html">URI</a>.
1890
1893
  onclick="toggleCode('M000030-source');return false;">[Source]</a></p>
1891
1894
  <div class="method-source-code" id="M000030-source">
1892
1895
  <pre>
1893
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 705</span>
1894
- 705: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>
1895
- 706: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@path</span>
1896
- 707: <span class="ruby-keyword kw">end</span>
1896
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 708</span>
1897
+ 708: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path</span>
1898
+ 709: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@path</span>
1899
+ 710: <span class="ruby-keyword kw">end</span>
1897
1900
  </pre>
1898
1901
  </div>
1899
1902
  </div>
@@ -1917,10 +1920,10 @@ href="URI.html">URI</a>.
1917
1920
  onclick="toggleCode('M000031-source');return false;">[Source]</a></p>
1918
1921
  <div class="method-source-code" id="M000031-source">
1919
1922
  <pre>
1920
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 710</span>
1921
- 710: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path=</span>(<span class="ruby-identifier">new_path</span>)
1922
- 711: <span class="ruby-ivar">@path</span> = (<span class="ruby-identifier">new_path</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>)
1923
- 712: <span class="ruby-keyword kw">end</span>
1923
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 713</span>
1924
+ 713: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">path=</span>(<span class="ruby-identifier">new_path</span>)
1925
+ 714: <span class="ruby-ivar">@path</span> = (<span class="ruby-identifier">new_path</span> <span class="ruby-operator">||</span> <span class="ruby-value str">&quot;&quot;</span>)
1926
+ 715: <span class="ruby-keyword kw">end</span>
1924
1927
  </pre>
1925
1928
  </div>
1926
1929
  </div>
@@ -1949,20 +1952,20 @@ href="URI.html">URI</a>.
1949
1952
  onclick="toggleCode('M000027-source');return false;">[Source]</a></p>
1950
1953
  <div class="method-source-code" id="M000027-source">
1951
1954
  <pre>
1952
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 673</span>
1953
- 673: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">port</span>
1954
- 674: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@port</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
1955
- 675: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>
1956
- 676: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">scheme_mapping</span>[<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>]
1957
- 677: <span class="ruby-keyword kw">else</span>
1958
- 678: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">nil</span>
1959
- 679: <span class="ruby-keyword kw">end</span>
1960
- 680: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@port</span>
1961
- 681: <span class="ruby-keyword kw">else</span>
1962
- 682: <span class="ruby-ivar">@port</span> = <span class="ruby-ivar">@port</span>.<span class="ruby-identifier">to_i</span>
1955
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 676</span>
1956
+ 676: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">port</span>
1957
+ 677: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@port</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
1958
+ 678: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>
1959
+ 679: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">scheme_mapping</span>[<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">downcase</span>]
1960
+ 680: <span class="ruby-keyword kw">else</span>
1961
+ 681: <span class="ruby-ivar">@port</span> = <span class="ruby-keyword kw">nil</span>
1962
+ 682: <span class="ruby-keyword kw">end</span>
1963
1963
  683: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@port</span>
1964
- 684: <span class="ruby-keyword kw">end</span>
1965
- 685: <span class="ruby-keyword kw">end</span>
1964
+ 684: <span class="ruby-keyword kw">else</span>
1965
+ 685: <span class="ruby-ivar">@port</span> = <span class="ruby-ivar">@port</span>.<span class="ruby-identifier">to_i</span>
1966
+ 686: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@port</span>
1967
+ 687: <span class="ruby-keyword kw">end</span>
1968
+ 688: <span class="ruby-keyword kw">end</span>
1966
1969
  </pre>
1967
1970
  </div>
1968
1971
  </div>
@@ -1986,12 +1989,12 @@ href="URI.html">URI</a>.
1986
1989
  onclick="toggleCode('M000028-source');return false;">[Source]</a></p>
1987
1990
  <div class="method-source-code" id="M000028-source">
1988
1991
  <pre>
1989
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 688</span>
1990
- 688: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">port=</span>(<span class="ruby-identifier">new_port</span>)
1991
- 689: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">new_port</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_i</span>
1992
- 690: <span class="ruby-ivar">@specified_port</span> = <span class="ruby-ivar">@port</span>
1993
- 691: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
1994
- 692: <span class="ruby-keyword kw">end</span>
1992
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 691</span>
1993
+ 691: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">port=</span>(<span class="ruby-identifier">new_port</span>)
1994
+ 692: <span class="ruby-ivar">@port</span> = <span class="ruby-identifier">new_port</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_i</span>
1995
+ 693: <span class="ruby-ivar">@specified_port</span> = <span class="ruby-ivar">@port</span>
1996
+ 694: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
1997
+ 695: <span class="ruby-keyword kw">end</span>
1995
1998
  </pre>
1996
1999
  </div>
1997
2000
  </div>
@@ -2015,10 +2018,10 @@ href="URI.html">URI</a>.
2015
2018
  onclick="toggleCode('M000034-source');return false;">[Source]</a></p>
2016
2019
  <div class="method-source-code" id="M000034-source">
2017
2020
  <pre>
2018
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 730</span>
2019
- 730: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query</span>
2020
- 731: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@query</span>
2021
- 732: <span class="ruby-keyword kw">end</span>
2021
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 733</span>
2022
+ 733: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query</span>
2023
+ 734: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@query</span>
2024
+ 735: <span class="ruby-keyword kw">end</span>
2022
2025
  </pre>
2023
2026
  </div>
2024
2027
  </div>
@@ -2042,10 +2045,10 @@ href="URI.html">URI</a>.
2042
2045
  onclick="toggleCode('M000035-source');return false;">[Source]</a></p>
2043
2046
  <div class="method-source-code" id="M000035-source">
2044
2047
  <pre>
2045
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 735</span>
2046
- 735: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query=</span>(<span class="ruby-identifier">new_query</span>)
2047
- 736: <span class="ruby-ivar">@query</span> = <span class="ruby-identifier">new_query</span>
2048
- 737: <span class="ruby-keyword kw">end</span>
2048
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 738</span>
2049
+ 738: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">query=</span>(<span class="ruby-identifier">new_query</span>)
2050
+ 739: <span class="ruby-ivar">@query</span> = <span class="ruby-identifier">new_query</span>
2051
+ 740: <span class="ruby-keyword kw">end</span>
2049
2052
  </pre>
2050
2053
  </div>
2051
2054
  </div>
@@ -2068,10 +2071,10 @@ Returns true if this <a href="URI.html">URI</a> is known to be relative.
2068
2071
  onclick="toggleCode('M000039-source');return false;">[Source]</a></p>
2069
2072
  <div class="method-source-code" id="M000039-source">
2070
2073
  <pre>
2071
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 759</span>
2072
- 759: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">relative?</span>
2073
- 760: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">nil?</span>
2074
- 761: <span class="ruby-keyword kw">end</span>
2074
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 762</span>
2075
+ 762: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">relative?</span>
2076
+ 763: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">nil?</span>
2077
+ 764: <span class="ruby-keyword kw">end</span>
2075
2078
  </pre>
2076
2079
  </div>
2077
2080
  </div>
@@ -2097,55 +2100,55 @@ necessary.
2097
2100
  onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
2098
2101
  <div class="method-source-code" id="M000046-source">
2099
2102
  <pre>
2100
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 874</span>
2101
- 874: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">route_from</span>(<span class="ruby-identifier">uri</span>)
2102
- 875: <span class="ruby-identifier">uri</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>).<span class="ruby-identifier">normalize</span>
2103
- 876: <span class="ruby-identifier">normalized_self</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>
2104
- 877: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">relative?</span>
2105
- 878: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Expected absolute URI, got: #{self.to_s}&quot;</span>
2106
- 879: <span class="ruby-keyword kw">end</span>
2107
- 880: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">relative?</span>
2108
- 881: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Expected absolute URI, got: #{uri.to_s}&quot;</span>
2103
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 877</span>
2104
+ 877: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">route_from</span>(<span class="ruby-identifier">uri</span>)
2105
+ 878: <span class="ruby-identifier">uri</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>).<span class="ruby-identifier">normalize</span>
2106
+ 879: <span class="ruby-identifier">normalized_self</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">normalize</span>
2107
+ 880: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">relative?</span>
2108
+ 881: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Expected absolute URI, got: #{self.to_s}&quot;</span>
2109
2109
  882: <span class="ruby-keyword kw">end</span>
2110
- 883: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>
2111
- 884: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-node">&quot;##{normalized_self.fragment}&quot;</span>)
2110
+ 883: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">relative?</span>
2111
+ 884: <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;Expected absolute URI, got: #{uri.to_s}&quot;</span>
2112
2112
  885: <span class="ruby-keyword kw">end</span>
2113
- 886: <span class="ruby-identifier">segments</span> = <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">to_hash</span>
2114
- 887: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span>
2115
- 888: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:scheme</span>] = <span class="ruby-keyword kw">nil</span>
2116
- 889: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">authority</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">authority</span>
2117
- 890: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:user</span>] = <span class="ruby-keyword kw">nil</span>
2118
- 891: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:password</span>] = <span class="ruby-keyword kw">nil</span>
2119
- 892: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:host</span>] = <span class="ruby-keyword kw">nil</span>
2120
- 893: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:port</span>] = <span class="ruby-keyword kw">nil</span>
2121
- 894: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>
2122
- 895: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:path</span>] = <span class="ruby-keyword kw">nil</span>
2123
- 896: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">query</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
2124
- 897: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:query</span>] = <span class="ruby-keyword kw">nil</span>
2125
- 898: <span class="ruby-keyword kw">end</span>
2126
- 899: <span class="ruby-keyword kw">else</span>
2127
- 900: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;/&quot;</span>
2128
- 901: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:path</span>].<span class="ruby-identifier">gsub!</span>(
2129
- 902: <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;^&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)), <span class="ruby-value str">&quot;&quot;</span>)
2130
- 903: <span class="ruby-keyword kw">end</span>
2131
- 904: <span class="ruby-keyword kw">end</span>
2132
- 905: <span class="ruby-keyword kw">end</span>
2133
- 906: <span class="ruby-keyword kw">end</span>
2134
- 907: <span class="ruby-comment cmt"># Avoid network-path references.</span>
2135
- 908: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:host</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2136
- 909: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:scheme</span>] = <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">scheme</span>
2137
- 910: <span class="ruby-keyword kw">end</span>
2138
- 911: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
2139
- 912: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:scheme</span>],
2140
- 913: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:user</span>],
2141
- 914: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:password</span>],
2142
- 915: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:host</span>],
2143
- 916: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:port</span>],
2144
- 917: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:path</span>],
2145
- 918: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:query</span>],
2146
- 919: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:fragment</span>]
2147
- 920: )
2148
- 921: <span class="ruby-keyword kw">end</span>
2113
+ 886: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>
2114
+ 887: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-node">&quot;##{normalized_self.fragment}&quot;</span>)
2115
+ 888: <span class="ruby-keyword kw">end</span>
2116
+ 889: <span class="ruby-identifier">segments</span> = <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">to_hash</span>
2117
+ 890: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span>
2118
+ 891: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:scheme</span>] = <span class="ruby-keyword kw">nil</span>
2119
+ 892: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">authority</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">authority</span>
2120
+ 893: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:user</span>] = <span class="ruby-keyword kw">nil</span>
2121
+ 894: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:password</span>] = <span class="ruby-keyword kw">nil</span>
2122
+ 895: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:host</span>] = <span class="ruby-keyword kw">nil</span>
2123
+ 896: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:port</span>] = <span class="ruby-keyword kw">nil</span>
2124
+ 897: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>
2125
+ 898: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:path</span>] = <span class="ruby-keyword kw">nil</span>
2126
+ 899: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">query</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>
2127
+ 900: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:query</span>] = <span class="ruby-keyword kw">nil</span>
2128
+ 901: <span class="ruby-keyword kw">end</span>
2129
+ 902: <span class="ruby-keyword kw">else</span>
2130
+ 903: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span> <span class="ruby-operator">!=</span> <span class="ruby-value str">&quot;/&quot;</span>
2131
+ 904: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:path</span>].<span class="ruby-identifier">gsub!</span>(
2132
+ 905: <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">&quot;^&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">escape</span>(<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>)), <span class="ruby-value str">&quot;&quot;</span>)
2133
+ 906: <span class="ruby-keyword kw">end</span>
2134
+ 907: <span class="ruby-keyword kw">end</span>
2135
+ 908: <span class="ruby-keyword kw">end</span>
2136
+ 909: <span class="ruby-keyword kw">end</span>
2137
+ 910: <span class="ruby-comment cmt"># Avoid network-path references.</span>
2138
+ 911: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:host</span>] <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2139
+ 912: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:scheme</span>] = <span class="ruby-identifier">normalized_self</span>.<span class="ruby-identifier">scheme</span>
2140
+ 913: <span class="ruby-keyword kw">end</span>
2141
+ 914: <span class="ruby-keyword kw">return</span> <span class="ruby-constant">Addressable</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">new</span>(
2142
+ 915: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:scheme</span>],
2143
+ 916: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:user</span>],
2144
+ 917: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:password</span>],
2145
+ 918: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:host</span>],
2146
+ 919: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:port</span>],
2147
+ 920: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:path</span>],
2148
+ 921: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:query</span>],
2149
+ 922: <span class="ruby-identifier">segments</span>[<span class="ruby-identifier">:fragment</span>]
2150
+ 923: )
2151
+ 924: <span class="ruby-keyword kw">end</span>
2149
2152
  </pre>
2150
2153
  </div>
2151
2154
  </div>
@@ -2171,10 +2174,10 @@ necessary.
2171
2174
  onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
2172
2175
  <div class="method-source-code" id="M000047-source">
2173
2176
  <pre>
2174
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 926</span>
2175
- 926: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">route_to</span>(<span class="ruby-identifier">uri</span>)
2176
- 927: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>).<span class="ruby-identifier">route_from</span>(<span class="ruby-keyword kw">self</span>)
2177
- 928: <span class="ruby-keyword kw">end</span>
2177
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 929</span>
2178
+ 929: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">route_to</span>(<span class="ruby-identifier">uri</span>)
2179
+ 930: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">class</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>).<span class="ruby-identifier">route_from</span>(<span class="ruby-keyword kw">self</span>)
2180
+ 931: <span class="ruby-keyword kw">end</span>
2178
2181
  </pre>
2179
2182
  </div>
2180
2183
  </div>
@@ -2198,10 +2201,10 @@ href="URI.html">URI</a>.
2198
2201
  onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
2199
2202
  <div class="method-source-code" id="M000013-source">
2200
2203
  <pre>
2201
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 496</span>
2202
- 496: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scheme</span>
2203
- 497: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@scheme</span>
2204
- 498: <span class="ruby-keyword kw">end</span>
2204
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 499</span>
2205
+ 499: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scheme</span>
2206
+ 500: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@scheme</span>
2207
+ 501: <span class="ruby-keyword kw">end</span>
2205
2208
  </pre>
2206
2209
  </div>
2207
2210
  </div>
@@ -2225,10 +2228,10 @@ href="URI.html">URI</a>.)
2225
2228
  onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
2226
2229
  <div class="method-source-code" id="M000014-source">
2227
2230
  <pre>
2228
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 501</span>
2229
- 501: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scheme=</span>(<span class="ruby-identifier">new_scheme</span>)
2230
- 502: <span class="ruby-ivar">@scheme</span> = <span class="ruby-identifier">new_scheme</span>
2231
- 503: <span class="ruby-keyword kw">end</span>
2231
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 504</span>
2232
+ 504: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">scheme=</span>(<span class="ruby-identifier">new_scheme</span>)
2233
+ 505: <span class="ruby-ivar">@scheme</span> = <span class="ruby-identifier">new_scheme</span>
2234
+ 506: <span class="ruby-keyword kw">end</span>
2232
2235
  </pre>
2233
2236
  </div>
2234
2237
  </div>
@@ -2252,15 +2255,15 @@ specified in the <a href="URI.html">URI</a> string.
2252
2255
  onclick="toggleCode('M000029-source');return false;">[Source]</a></p>
2253
2256
  <div class="method-source-code" id="M000029-source">
2254
2257
  <pre>
2255
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 695</span>
2256
- 695: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">specified_port</span>
2257
- 696: <span class="ruby-identifier">port</span> = <span class="ruby-ivar">@specified_port</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_i</span>
2258
- 697: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">port</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
2259
- 698: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
2260
- 699: <span class="ruby-keyword kw">else</span>
2261
- 700: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">port</span>
2262
- 701: <span class="ruby-keyword kw">end</span>
2263
- 702: <span class="ruby-keyword kw">end</span>
2258
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 698</span>
2259
+ 698: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">specified_port</span>
2260
+ 699: <span class="ruby-identifier">port</span> = <span class="ruby-ivar">@specified_port</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">to_i</span>
2261
+ 700: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">port</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
2262
+ 701: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span>
2263
+ 702: <span class="ruby-keyword kw">else</span>
2264
+ 703: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">port</span>
2265
+ 704: <span class="ruby-keyword kw">end</span>
2266
+ 705: <span class="ruby-keyword kw">end</span>
2264
2267
  </pre>
2265
2268
  </div>
2266
2269
  </div>
@@ -2283,19 +2286,19 @@ Returns a Hash of the <a href="URI.html">URI</a> segments.
2283
2286
  onclick="toggleCode('M000056-source');return false;">[Source]</a></p>
2284
2287
  <div class="method-source-code" id="M000056-source">
2285
2288
  <pre>
2286
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1090</span>
2287
- 1090: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
2288
- 1091: <span class="ruby-keyword kw">return</span> {
2289
- 1092: <span class="ruby-identifier">:scheme</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>,
2290
- 1093: <span class="ruby-identifier">:user</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>,
2291
- 1094: <span class="ruby-identifier">:password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>,
2292
- 1095: <span class="ruby-identifier">:host</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>,
2293
- 1096: <span class="ruby-identifier">:port</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">specified_port</span>,
2294
- 1097: <span class="ruby-identifier">:path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>,
2295
- 1098: <span class="ruby-identifier">:query</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>,
2296
- 1099: <span class="ruby-identifier">:fragment</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span>
2297
- 1100: }
2298
- 1101: <span class="ruby-keyword kw">end</span>
2289
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1093</span>
2290
+ 1093: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_hash</span>
2291
+ 1094: <span class="ruby-keyword kw">return</span> {
2292
+ 1095: <span class="ruby-identifier">:scheme</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span>,
2293
+ 1096: <span class="ruby-identifier">:user</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>,
2294
+ 1097: <span class="ruby-identifier">:password</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>,
2295
+ 1098: <span class="ruby-identifier">:host</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">host</span>,
2296
+ 1099: <span class="ruby-identifier">:port</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">specified_port</span>,
2297
+ 1100: <span class="ruby-identifier">:path</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>,
2298
+ 1101: <span class="ruby-identifier">:query</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span>,
2299
+ 1102: <span class="ruby-identifier">:fragment</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span>
2300
+ 1103: }
2301
+ 1104: <span class="ruby-keyword kw">end</span>
2299
2302
  </pre>
2300
2303
  </div>
2301
2304
  </div>
@@ -2318,16 +2321,16 @@ Returns the assembled <a href="URI.html">URI</a> as a string.
2318
2321
  onclick="toggleCode('M000055-source');return false;">[Source]</a></p>
2319
2322
  <div class="method-source-code" id="M000055-source">
2320
2323
  <pre>
2321
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1079</span>
2322
- 1079: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
2323
- 1080: <span class="ruby-identifier">uri_string</span> = <span class="ruby-value str">&quot;&quot;</span>
2324
- 1081: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{self.scheme}:&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2325
- 1082: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;//#{self.authority}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">authority</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2326
- 1083: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">to_s</span>
2327
- 1084: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;?#{self.query}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2328
- 1085: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;##{self.fragment}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2329
- 1086: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">uri_string</span>
2330
- 1087: <span class="ruby-keyword kw">end</span>
2324
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 1082</span>
2325
+ 1082: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
2326
+ 1083: <span class="ruby-identifier">uri_string</span> = <span class="ruby-value str">&quot;&quot;</span>
2327
+ 1084: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;#{self.scheme}:&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">scheme</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2328
+ 1085: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;//#{self.authority}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">authority</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2329
+ 1086: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">to_s</span>
2330
+ 1087: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;?#{self.query}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">query</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2331
+ 1088: <span class="ruby-identifier">uri_string</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-node">&quot;##{self.fragment}&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">fragment</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2332
+ 1089: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">uri_string</span>
2333
+ 1090: <span class="ruby-keyword kw">end</span>
2331
2334
  </pre>
2332
2335
  </div>
2333
2336
  </div>
@@ -2351,10 +2354,10 @@ href="URI.html">URI</a>.
2351
2354
  onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
2352
2355
  <div class="method-source-code" id="M000015-source">
2353
2356
  <pre>
2354
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 506</span>
2355
- 506: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">user</span>
2356
- 507: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@user</span>
2357
- 508: <span class="ruby-keyword kw">end</span>
2357
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 509</span>
2358
+ 509: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">user</span>
2359
+ 510: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@user</span>
2360
+ 511: <span class="ruby-keyword kw">end</span>
2358
2361
  </pre>
2359
2362
  </div>
2360
2363
  </div>
@@ -2378,22 +2381,22 @@ href="URI.html">URI</a>.
2378
2381
  onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
2379
2382
  <div class="method-source-code" id="M000016-source">
2380
2383
  <pre>
2381
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 511</span>
2382
- 511: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">user=</span>(<span class="ruby-identifier">new_user</span>)
2383
- 512: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">new_user</span>
2384
- 513:
2385
- 514: <span class="ruby-comment cmt"># You can't have a nil user with a non-nil password</span>
2386
- 515: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@password</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2387
- 516: <span class="ruby-ivar">@user</span> = <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@user</span>.<span class="ruby-identifier">nil?</span>
2388
- 517: <span class="ruby-keyword kw">end</span>
2389
- 518:
2390
- 519: <span class="ruby-comment cmt"># Reset dependant values</span>
2391
- 520: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-keyword kw">nil</span>
2392
- 521: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
2393
- 522:
2394
- 523: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
2395
- 524: <span class="ruby-identifier">validate</span>()
2396
- 525: <span class="ruby-keyword kw">end</span>
2384
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 514</span>
2385
+ 514: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">user=</span>(<span class="ruby-identifier">new_user</span>)
2386
+ 515: <span class="ruby-ivar">@user</span> = <span class="ruby-identifier">new_user</span>
2387
+ 516:
2388
+ 517: <span class="ruby-comment cmt"># You can't have a nil user with a non-nil password</span>
2389
+ 518: <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@password</span> <span class="ruby-operator">!=</span> <span class="ruby-keyword kw">nil</span>
2390
+ 519: <span class="ruby-ivar">@user</span> = <span class="ruby-value str">&quot;&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@user</span>.<span class="ruby-identifier">nil?</span>
2391
+ 520: <span class="ruby-keyword kw">end</span>
2392
+ 521:
2393
+ 522: <span class="ruby-comment cmt"># Reset dependant values</span>
2394
+ 523: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-keyword kw">nil</span>
2395
+ 524: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
2396
+ 525:
2397
+ 526: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
2398
+ 527: <span class="ruby-identifier">validate</span>()
2399
+ 528: <span class="ruby-keyword kw">end</span>
2397
2400
  </pre>
2398
2401
  </div>
2399
2402
  </div>
@@ -2417,21 +2420,21 @@ this <a href="URI.html">URI</a>.
2417
2420
  onclick="toggleCode('M000019-source');return false;">[Source]</a></p>
2418
2421
  <div class="method-source-code" id="M000019-source">
2419
2422
  <pre>
2420
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 550</span>
2421
- 550: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">userinfo</span>
2422
- 551: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@userinfo</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@userinfo</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
2423
- 552: <span class="ruby-identifier">current_user</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>
2424
- 553: <span class="ruby-identifier">current_password</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>
2425
- 554: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">current_user</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">current_password</span>
2426
- 555: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-keyword kw">nil</span>
2427
- 556: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">current_user</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">current_password</span>
2428
- 557: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-node">&quot;#{current_user}:#{current_password}&quot;</span>
2429
- 558: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">current_user</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">current_password</span>
2430
- 559: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-node">&quot;#{current_user}&quot;</span>
2431
- 560: <span class="ruby-keyword kw">end</span>
2432
- 561: <span class="ruby-keyword kw">end</span>
2433
- 562: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@userinfo</span>
2434
- 563: <span class="ruby-keyword kw">end</span>
2423
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 553</span>
2424
+ 553: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">userinfo</span>
2425
+ 554: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-keyword kw">defined?</span>(<span class="ruby-ivar">@userinfo</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@userinfo</span> <span class="ruby-operator">==</span> <span class="ruby-keyword kw">nil</span>
2426
+ 555: <span class="ruby-identifier">current_user</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span>
2427
+ 556: <span class="ruby-identifier">current_password</span> = <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span>
2428
+ 557: <span class="ruby-keyword kw">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">current_user</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">current_password</span>
2429
+ 558: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-keyword kw">nil</span>
2430
+ 559: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">current_user</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">current_password</span>
2431
+ 560: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-node">&quot;#{current_user}:#{current_password}&quot;</span>
2432
+ 561: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">current_user</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">current_password</span>
2433
+ 562: <span class="ruby-ivar">@userinfo</span> = <span class="ruby-node">&quot;#{current_user}&quot;</span>
2434
+ 563: <span class="ruby-keyword kw">end</span>
2435
+ 564: <span class="ruby-keyword kw">end</span>
2436
+ 565: <span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@userinfo</span>
2437
+ 566: <span class="ruby-keyword kw">end</span>
2435
2438
  </pre>
2436
2439
  </div>
2437
2440
  </div>
@@ -2455,21 +2458,21 @@ this <a href="URI.html">URI</a>.
2455
2458
  onclick="toggleCode('M000020-source');return false;">[Source]</a></p>
2456
2459
  <div class="method-source-code" id="M000020-source">
2457
2460
  <pre>
2458
- <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 566</span>
2459
- 566: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">userinfo=</span>(<span class="ruby-identifier">new_userinfo</span>)
2460
- 567: <span class="ruby-identifier">new_user</span> = <span class="ruby-identifier">new_userinfo</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^(.*):/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
2461
- 568: <span class="ruby-identifier">new_password</span> = <span class="ruby-identifier">new_userinfo</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/:(.*)$/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
2462
- 569:
2463
- 570: <span class="ruby-comment cmt"># Password assigned first to ensure validity in case of nil</span>
2464
- 571: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span> = <span class="ruby-identifier">new_password</span>
2465
- 572: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span> = <span class="ruby-identifier">new_user</span>
2466
- 573:
2467
- 574: <span class="ruby-comment cmt"># Reset dependant values</span>
2468
- 575: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
2461
+ <span class="ruby-comment cmt"># File lib/addressable/uri.rb, line 569</span>
2462
+ 569: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">userinfo=</span>(<span class="ruby-identifier">new_userinfo</span>)
2463
+ 570: <span class="ruby-identifier">new_user</span> = <span class="ruby-identifier">new_userinfo</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/^(.*):/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
2464
+ 571: <span class="ruby-identifier">new_password</span> = <span class="ruby-identifier">new_userinfo</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp re">/:(.*)$/</span>).<span class="ruby-identifier">flatten</span>[<span class="ruby-value">0</span>]
2465
+ 572:
2466
+ 573: <span class="ruby-comment cmt"># Password assigned first to ensure validity in case of nil</span>
2467
+ 574: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">password</span> = <span class="ruby-identifier">new_password</span>
2468
+ 575: <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">user</span> = <span class="ruby-identifier">new_user</span>
2469
2469
  576:
2470
- 577: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
2471
- 578: <span class="ruby-identifier">validate</span>()
2472
- 579: <span class="ruby-keyword kw">end</span>
2470
+ 577: <span class="ruby-comment cmt"># Reset dependant values</span>
2471
+ 578: <span class="ruby-ivar">@authority</span> = <span class="ruby-keyword kw">nil</span>
2472
+ 579:
2473
+ 580: <span class="ruby-comment cmt"># Ensure we haven't created an invalid URI</span>
2474
+ 581: <span class="ruby-identifier">validate</span>()
2475
+ 582: <span class="ruby-keyword kw">end</span>
2473
2476
  </pre>
2474
2477
  </div>
2475
2478
  </div>