Yay regular expressions! I might consider abstracting these out into private methods, for example, instead of 
```ruby
@path = @contents.scan(/^http.+/).first.scan(/\/[a-z]+/).first
```
I might do
```ruby
@path = extract_path(@contents)
```
then later on in the file:
```ruby
private
def extract_path(string)
  string.scan(/^http.+/).first.scan(/\/[a-z]+/).first
end
```

The idea is that by putting the logic being a method with a name that reflects what it does, you make a part of the code that you'll be looking at the most more clear to the human reading it. The compound methods here are a little bit too heavy for a casual reader to parse.