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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: edb69eeb3e77bf457c4fac9616cdd613ce402dc8
4
- data.tar.gz: faabe2797103f0f6dd7f83bfe53216a27a3b4589
3
+ metadata.gz: 7b94c57d6ea72b04ee98820691f8bc15c203232a
4
+ data.tar.gz: 3db6a0e7ef0533d89688b044f73b3b457e926ce3
5
5
  SHA512:
6
- metadata.gz: 086f2186ff128357e49c7de71d22e15d65abb74862a85a889a717d9ac4d947721cb12bd9911f42493f413ea6d2165c429c3cb2f5c096cdce6f5a8648f55cb7ae
7
- data.tar.gz: 41c035970b4b595e9e11b68352b0878a0dddfd94985b71373fda41b11fcfbb92de53ff93a6d1759ad73e9f1533964b87dcf46f5c521287eecb64a3dbeb2be482
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
@@ -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, _headers = {}, status_code = 200)
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
@@ -1,3 +1,3 @@
1
1
  module Linkey
2
- VERSION = "1.1.1"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -21,4 +21,5 @@ Gem::Specification.new do |spec|
21
21
  spec.add_runtime_dependency "parallel"
22
22
  spec.add_runtime_dependency "typhoeus"
23
23
  spec.add_runtime_dependency "faraday"
24
+ spec.add_runtime_dependency "faraday_middleware"
24
25
  end
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.1.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-09 00:00:00.000000000 Z
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