Module: HTML::Utils
- Included in:
- Proofer, Proofer::Checkable, Proofer::UrlValidator, LinkCheck
- Defined in:
- lib/html/proofer/utils.rb
Class Method Summary collapse
Class Method Details
.create_nokogiri(path) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/html/proofer/utils.rb', line 5 def create_nokogiri(path) if File.exist? path content = File.open(path).read else content = path end Nokogiri::HTML(content) end |
.swap(href, replacement) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/html/proofer/utils.rb', line 16 def swap(href, replacement) replacement.each do |link, replace| href = href.gsub(link, replace) end href end |