Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 23rd, 2012  |  syntax: None  |  size: 0.44 KB  |  hits: 4  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. ruby-1.9.2-p136 > (0..10).inject({}) { |m, i| u = "s:#{ '/' * i }h"; m.update(u => URI.parse(u).to_s) }
  2. => {
  3.  "s:h"           => "s:h",
  4.  "s:/h"          => "s:/h",
  5.  "s://h"         => "s://h",
  6.  "s:///h"        => "s:/h",
  7.  "s:////h"       => "s://h",
  8.  "s://///h"      => "s:///h",
  9.  "s://////h"     => "s:////h",
  10.  "s:///////h"    => "s://///h",
  11.  "s:////////h"   => "s://////h",
  12.  "s://///////h"  => "s:///////h",
  13.  "s://////////h" => "s:////////h"
  14. }