You can also use URI.parse on local paths. If you pass that around instead of the raw path you can just query the scheme (nil for local paths).

uri = URI.parse('/tmp/foo')
['http','https','ftp'].include? uri.scheme