Introducing the Embiggen gem

require 'embiggen'

# Basic usage
r = Embiggen::URI('https://youtu.be/dQw4w9WgXcQ').expand
#=> #<URI:HTTPS https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be>
r.to_s
#=> "https://www.youtube.com/watch?v=dQw4w9WgXcQ&feature=youtu.be"

Resources