html-proofer 2.6.4 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,42 +0,0 @@
1
- require 'nokogiri'
2
-
3
- module HTML
4
- class Proofer
5
- module Utils
6
- STORAGE_DIR = File.join('tmp', '.htmlproofer')
7
-
8
- def pluralize(count, single, plural)
9
- "#{count} " << (count == 1 ? single : plural)
10
- end
11
-
12
- def create_nokogiri(path)
13
- if File.exist? path
14
- content = File.open(path).read
15
- else
16
- content = path
17
- end
18
-
19
- Nokogiri::HTML(clean_content(content))
20
- end
21
- module_function :create_nokogiri
22
-
23
- def swap(href, replacement)
24
- replacement.each do |link, replace|
25
- href = href.gsub(link, replace)
26
- end
27
- href
28
- end
29
- module_function :swap
30
-
31
- # address a problem with Nokogiri's parsing URL entities
32
- # problem from http://git.io/vBYU1
33
- # solution from http://git.io/vBYUi
34
- def clean_content(string)
35
- string.gsub(%r{https?://([^>]+)}i) do |url|
36
- url.gsub(/&(?!amp;)/, '&amp;')
37
- end
38
- end
39
- module_function :clean_content
40
- end
41
- end
42
- end
@@ -1,5 +0,0 @@
1
- module HTML
2
- class Proofer
3
- VERSION = '2.6.4'
4
- end
5
- end
@@ -1,9 +0,0 @@
1
- module HTML
2
- class Proofer
3
- class XpathFunctions
4
- def case_insensitive_equals(node_set, str_to_match)
5
- node_set.find_all { |node| node.to_s.downcase == str_to_match.to_s.downcase }
6
- end
7
- end
8
- end
9
- end