find_identical 0.0.3 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/find_identical.rb +1 -3
- data/lib/find_identical/reader.rb +16 -14
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f38f5c18a38d3665a9c40478f437142e502d010
|
4
|
+
data.tar.gz: fbfe9373e92776845579a988a47af1b396aa4686
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b475d107a91e6710802fc2e1df8a1e7c3b59c5439fbd822cb7b521998de422d90fa9542886947c05e19d28c41cc4efad40665d26ee6f494e3384819b995a877f
|
7
|
+
data.tar.gz: 5b6136b3d16a5d15352c95216e3ae1a36e8143257d253ac4952842abfc9f5a38c6909c3fee8c77c3e90d283fda554061f7584a230bba4b0f407e247d1632648f
|
data/lib/find_identical.rb
CHANGED
@@ -1,23 +1,25 @@
|
|
1
1
|
require 'typhoeus'
|
2
2
|
|
3
3
|
module Reader
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
class << self
|
5
|
+
def html_document(source)
|
6
|
+
remote_file?(source) ? remote_html(source) : local_html(source)
|
7
|
+
end
|
7
8
|
|
8
|
-
|
9
|
+
private
|
9
10
|
|
10
|
-
|
11
|
-
|
12
|
-
|
11
|
+
def local_html(path)
|
12
|
+
File.read(path)
|
13
|
+
end
|
14
|
+
|
13
15
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
16
|
+
def remote_html(address)
|
17
|
+
Typhoeus.get(address).body
|
18
|
+
end
|
19
|
+
|
18
20
|
|
19
|
-
|
20
|
-
|
21
|
-
|
21
|
+
def remote_file?(source)
|
22
|
+
source.match(/^https?:\/\/.+$/)
|
23
|
+
end
|
22
24
|
end
|
23
25
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: find_identical
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedro Dutra
|
@@ -50,6 +50,20 @@ dependencies:
|
|
50
50
|
- - ">="
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: 5.11.3
|
53
|
+
- !ruby/object:Gem::Dependency
|
54
|
+
name: mocha
|
55
|
+
requirement: !ruby/object:Gem::Requirement
|
56
|
+
requirements:
|
57
|
+
- - "~>"
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '1.8'
|
60
|
+
type: :development
|
61
|
+
prerelease: false
|
62
|
+
version_requirements: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - "~>"
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '1.8'
|
53
67
|
description: According to https://www.w3.org/TR/WCAG20-TECHS/H93.html, we should avoid
|
54
68
|
duplicate id values on web pages, because there are "errors that are known to cause
|
55
69
|
problems for assistive technologies when they are trying to parse content that has
|