web_stat 0.3.11 → 0.3.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +4 -6
- data/lib/web_stat/configure.rb +1 -1
- data/lib/web_stat/fetch.rb +2 -2
- data/lib/web_stat/final_redirect_url.rb +1 -1
- data/lib/web_stat/version.rb +1 -1
- data/spec/spec_helper.rb +1 -6
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2af80415014e94830b1e323f44e2e71732196bdfc535627295f1f6b7b2f44285
|
4
|
+
data.tar.gz: 85fc9facafff40063c434824ebc64fcd847f347bdfa0c928ee8c35b2b3e0c8b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30870501431d61d5d90bdcfcf4f6ba339918b810fda48bd9a77abe183e341575bc9c7397aadb7494da1591d5d647fea7b17512ed24cea61471d4e112a0c17bd8
|
7
|
+
data.tar.gz: 8340739ddae12fd6a670d51e7fcd7e3987294bcb32219cde6e8dbcee2a067f064b2b632d102636471d0b7fd0ff27ca4f55c477eca94d88b7194a3cf17b1869c7
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -55,12 +55,10 @@ And then execute:
|
|
55
55
|
|
56
56
|
### spec
|
57
57
|
|
58
|
-
$
|
59
|
-
|
60
|
-
or
|
61
|
-
|
62
|
-
$ bundle exec rspec
|
58
|
+
$ docker/start -d
|
59
|
+
$ docker/exec ENV=development bundle exec rspec
|
63
60
|
|
64
61
|
Test a file
|
65
62
|
|
66
|
-
$
|
63
|
+
$ docker/start -d
|
64
|
+
$ docker/exec ENV=development bundle exec rspec spec/web_stat/fetch_spec.rb
|
data/lib/web_stat/configure.rb
CHANGED
data/lib/web_stat/fetch.rb
CHANGED
@@ -47,8 +47,8 @@ module WebStat
|
|
47
47
|
break
|
48
48
|
end
|
49
49
|
end
|
50
|
-
if path.nil? || path.empty?
|
51
|
-
path = @nokogiri.
|
50
|
+
if (path.nil? || path.empty?) && @nokogiri.xpath('//img')
|
51
|
+
path = @nokogiri.xpath('//img').attr('src')
|
52
52
|
end
|
53
53
|
if ! path.nil? && path.match(/^\//)
|
54
54
|
"#{URI.parse(@url).scheme}://#{URI.parse(@url).host}#{path}"
|
@@ -11,7 +11,7 @@ module WebStat
|
|
11
11
|
redirect_lookup_depth = options[:depth].to_i > 0 ? options[:depth].to_i : 10
|
12
12
|
response_uri = get_final_redirect_url(url, redirect_lookup_depth)
|
13
13
|
final_url = url_string_from_uri(response_uri)
|
14
|
-
rescue
|
14
|
+
rescue => e
|
15
15
|
# nothing
|
16
16
|
end
|
17
17
|
end
|
data/lib/web_stat/version.rb
CHANGED
data/spec/spec_helper.rb
CHANGED
@@ -7,12 +7,7 @@ require "web_stat"
|
|
7
7
|
require 'webmock'
|
8
8
|
include WebMock::API
|
9
9
|
WebMock.enable!
|
10
|
-
|
11
|
-
WebMock.disable_net_connect!({
|
12
|
-
allow_localhost: true,
|
13
|
-
allow: 'chromedriver.storage.googleapis.com'
|
14
|
-
})
|
15
|
-
|
10
|
+
|
16
11
|
RSpec.configure do |config|
|
17
12
|
# Enable flags like --only-failures and --next-failure
|
18
13
|
config.example_status_persistence_file_path = ".rspec_status"
|