linkey 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lib/linkey.rb +4 -2
- data/lib/linkey/version.rb +1 -1
- data/linkey.gemspec +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b94c57d6ea72b04ee98820691f8bc15c203232a
|
4
|
+
data.tar.gz: 3db6a0e7ef0533d89688b044f73b3b457e926ce3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61ad15a2d2cc0b56ec2eb59b4762bec6c6b77d9c7815582dade5bfee497587f486db30560fe20824e5940a3648fedfbb69ef04c37a6b80b4df8a77d3460a7f8b
|
7
|
+
data.tar.gz: a3d66df5a6378ccd868567726c2c62a3876e262a3d978a3fef80c1991ac6904f9b47df628b757a8373f0986649142653c88b863b49bfe3dfb04510ff15580842
|
data/README.md
CHANGED
@@ -70,6 +70,10 @@ Example yaml file
|
|
70
70
|
```yaml
|
71
71
|
base: 'http://www.bbc.co.uk'
|
72
72
|
|
73
|
+
headers:
|
74
|
+
-
|
75
|
+
X-content-override: 'https://example.com'
|
76
|
+
|
73
77
|
status_code: 200
|
74
78
|
|
75
79
|
paths:
|
@@ -77,7 +81,6 @@ paths:
|
|
77
81
|
- /news/uk
|
78
82
|
```
|
79
83
|
|
80
|
-
|
81
84
|
Smoke test
|
82
85
|
|
83
86
|
```ruby
|
data/lib/linkey.rb
CHANGED
@@ -4,6 +4,7 @@ require "parallel"
|
|
4
4
|
require "typhoeus"
|
5
5
|
require "faraday"
|
6
6
|
require "typhoeus/adapters/faraday"
|
7
|
+
require 'faraday_middleware'
|
7
8
|
|
8
9
|
module Linkey
|
9
10
|
autoload :CLI, "linkey/cli"
|
@@ -71,12 +72,13 @@ module Linkey
|
|
71
72
|
end
|
72
73
|
|
73
74
|
class Getter
|
74
|
-
def self.status(urls, base,
|
75
|
+
def self.status(urls, base, headers = {}, status_code = 200)
|
75
76
|
@output = []
|
76
77
|
puts "Checking..."
|
77
78
|
|
78
79
|
Parallel.each(urls, :in_threads => 4) do |page_path|
|
79
|
-
request = Faraday.new(:url => base, :ssl => { :verify => false }) do |faraday|
|
80
|
+
request = Faraday.new(:url => base, :ssl => { :verify => false }, :headers => headers[:headers]) do |faraday|
|
81
|
+
faraday.use FaradayMiddleware::FollowRedirects
|
80
82
|
faraday.adapter :typhoeus
|
81
83
|
end
|
82
84
|
status = request.get(page_path).status
|
data/lib/linkey/version.rb
CHANGED
data/linkey.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linkey
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Blooman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - '>='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: faraday_middleware
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '>='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '>='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
description: Linkey
|
70
84
|
email:
|
71
85
|
- david.blooman@gmail.com
|