Module: HTML::Proofer::Utils
- Included in:
- HTML::Proofer, Checkable, UrlValidator, LinkCheck
- Defined in:
- lib/html/proofer/utils.rb
Class Method Summary collapse
Class Method Details
.create_nokogiri(path) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/html/proofer/utils.rb', line 6 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
17 18 19 20 21 22 |
# File 'lib/html/proofer/utils.rb', line 17 def swap(href, replacement) replacement.each do |link, replace| href = href.gsub(link, replace) end href end |