webinspector 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE +5 -6
- data/README.md +9 -0
- data/lib/web_inspector/page.rb +1 -3
- data/lib/web_inspector/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90677267a36bfa5bb128a1b1c6e173825353c1ea
|
4
|
+
data.tar.gz: 35030a7661c3973f450c18a41c994b116e9aaf52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eb8ba8906c2883202b7885c4cdb78e8e0b56a284a8dbba6eb57cb9298b124cb7ef24d0b7adc93ffc9c565dde1a1c2e2cd582758560f5b98bee08527b75e367d7
|
7
|
+
data.tar.gz: 6bd92e33ea85d76570527f68cd878f33f6a3dd43aa907a7180f7d813e89f28f4cc875929837927dbe8fefdc9d1f92b6e8e25be469a096c2cccb3afe57caa6822
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c) 2015 Davide Santangelo
|
3
|
+
Copyright (c) 2015 Davide Santangelo <davide.santangelo@gmail.com>
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -9,14 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
9
|
copies of the Software, and to permit persons to whom the Software is
|
10
10
|
furnished to do so, subject to the following conditions:
|
11
11
|
|
12
|
-
The above copyright notice and this permission notice shall be included in
|
13
|
-
copies or substantial portions of the Software.
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
14
|
|
15
15
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
16
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
17
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
18
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
19
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
-
SOFTWARE.
|
22
|
-
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
CHANGED
@@ -51,6 +51,15 @@ page.images # every image found
|
|
51
51
|
page.meta # metatags of the page
|
52
52
|
```
|
53
53
|
|
54
|
+
## Accessing meta tags
|
55
|
+
|
56
|
+
```ruby
|
57
|
+
page.meta # metatags of the page
|
58
|
+
page.meta['description'] # meta description
|
59
|
+
page.meta['keywors'] # meta keywords
|
60
|
+
```
|
61
|
+
|
62
|
+
|
54
63
|
## License
|
55
64
|
The restcountry GEM is released under the MIT License.
|
56
65
|
|
data/lib/web_inspector/page.rb
CHANGED
@@ -9,7 +9,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), 'request'))
|
|
9
9
|
|
10
10
|
module WebInspector
|
11
11
|
class Page
|
12
|
-
attr_reader :url, :scheme, :host, :port, :title, :description, :meta, :links, :images, :
|
12
|
+
attr_reader :url, :scheme, :host, :port, :title, :description, :meta, :links, :images, :response
|
13
13
|
|
14
14
|
def initialize(url, options = {})
|
15
15
|
@url = url
|
@@ -73,7 +73,6 @@ module WebInspector
|
|
73
73
|
def response
|
74
74
|
@response ||= fetch
|
75
75
|
rescue Faraday::TimeoutError, Faraday::Error::ConnectionFailed, RuntimeError, URI::InvalidURIError => e
|
76
|
-
@exception_log << e
|
77
76
|
nil
|
78
77
|
end
|
79
78
|
|
@@ -102,7 +101,6 @@ module WebInspector
|
|
102
101
|
response
|
103
102
|
end
|
104
103
|
|
105
|
-
|
106
104
|
def with_default_scheme(request)
|
107
105
|
request.url && request.scheme.nil? ? 'http://' + request.url : request.url
|
108
106
|
end
|