Module: Roadie::Utils
- Defined in:
- lib/roadie/utils.rb
Class Method Summary collapse
- .path_is_absolute?(path) ⇒ Boolean private
- .warn(message) ⇒ Object private
Class Method Details
.path_is_absolute?(path) ⇒ Boolean
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/roadie/utils.rb', line 6 def path_is_absolute?(path) # Ruby's URI is pretty unforgiving, but roadie aims to be. Don't involve # URI for URLs that's easy to determine to be absolute. # URLs starting with a scheme (http:, data:) are absolute. # # URLs that start with double slashes (//css/app.css) are also absolute # in modern browsers, but most email clients do not understand them. return true if %r{^(\w+:|//)}.match?(path) begin !URI.parse(path).relative? rescue URI::InvalidURIError => error raise InvalidUrlPath.new(path, error) end end |
.warn(message) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
25 26 27 |
# File 'lib/roadie/utils.rb', line 25 def warn() Kernel.warn("Roadie: #{}") end |