Class: RoRoSupport::Methods::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/roro_support/methods.rb

Class Method Summary collapse

Class Method Details

.url(url, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/roro_support/methods.rb', line 5

def url(url, options = {})
  return url if url[/http/]
  if options[:local]
    return "file://#{url}"
  else
    "http://#{url}" unless url[/http:\/\//]
  end
end

.utf8(html) ⇒ Object



14
15
16
17
# File 'lib/roro_support/methods.rb', line 14

def utf8(html)
  html.gsub! /charset='.+'/, "charset='utf-8'"
  html
end