linkey 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/linkey.rb +6 -6
- data/lib/linkey/cli.rb +4 -4
- data/lib/linkey/version.rb +1 -1
- data/linkey.gemspec +9 -8
- metadata +16 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ddaf7abf726952442158a9cdee11371cec1a7f2
|
4
|
+
data.tar.gz: b12f32b17cda71b19d2a46a3d854528fe33ae376
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c11a6981001909f888f2790aa467082a1a06f19ed8913ad267ed93a1ae84fcffff09b9ada3d5d5ba5ebe2c9ee71fe24588031713244f4c0dd374d4591184d96d
|
7
|
+
data.tar.gz: 4fd8cd1b04ccd043920e2c3e6b74f3e1ca72b61af0d333826ba1323d0b6aa1ca5bdffaab2f93a077535c5e4656d71a46f97d176aea8f813cd3d03698d96045b9
|
data/lib/linkey.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
|
-
require
|
1
|
+
require 'linkey/version'
|
2
2
|
require 'open-uri'
|
3
3
|
require 'yaml'
|
4
|
+
require 'parallel'
|
4
5
|
|
5
6
|
module Linkey
|
6
7
|
autoload :CLI, 'linkey/cli'
|
@@ -35,8 +36,8 @@ module Linkey
|
|
35
36
|
|
36
37
|
def status(urls)
|
37
38
|
@output = []
|
38
|
-
puts
|
39
|
-
|
39
|
+
puts 'Checking...'
|
40
|
+
Parallel.each(urls, in_threads: 7) do |page_path|
|
40
41
|
begin
|
41
42
|
gets = open(base + page_path)
|
42
43
|
status = gets.status.first
|
@@ -52,7 +53,7 @@ module Linkey
|
|
52
53
|
end
|
53
54
|
|
54
55
|
def check_for_broken
|
55
|
-
puts
|
56
|
+
puts 'Checking'
|
56
57
|
if @output.empty?
|
57
58
|
puts 'URL\'s are good, All Done!'
|
58
59
|
exit 0
|
@@ -82,9 +83,8 @@ module Linkey
|
|
82
83
|
end
|
83
84
|
|
84
85
|
class Checker < CheckResponse
|
85
|
-
|
86
86
|
def initialize(config)
|
87
|
-
@smoke_urls = YAML
|
87
|
+
@smoke_urls = YAML.load(File.open("#{config}"))
|
88
88
|
end
|
89
89
|
|
90
90
|
def base
|
data/lib/linkey/cli.rb
CHANGED
@@ -4,25 +4,25 @@ require 'linkey'
|
|
4
4
|
class Linkey::CLI < Thor
|
5
5
|
include Thor::Actions
|
6
6
|
|
7
|
-
desc
|
7
|
+
desc 'scan', "Save some URL's"
|
8
8
|
def scan(url, filename)
|
9
9
|
html = Linkey::SaveLinks.new(url, filename)
|
10
10
|
html.capture_links
|
11
11
|
end
|
12
12
|
|
13
|
-
desc
|
13
|
+
desc 'status', 'checks links for errors'
|
14
14
|
def status(url, base, reg, filename)
|
15
15
|
status = Linkey::CheckResponse.new(url, base, reg, filename)
|
16
16
|
status.check_links
|
17
17
|
end
|
18
18
|
|
19
|
-
desc
|
19
|
+
desc 'check URL Base_URL Regex File', 'A full linkey job'
|
20
20
|
def check(url, base, reg, filename)
|
21
21
|
scan(url, filename)
|
22
22
|
status(url, base, reg, filename)
|
23
23
|
end
|
24
24
|
|
25
|
-
desc
|
25
|
+
desc 'smoke [path/to/file]', "A linkey job using predetermined URL's"
|
26
26
|
def smoke(file)
|
27
27
|
check = Linkey::Checker.new(file)
|
28
28
|
check.smoke
|
data/lib/linkey/version.rb
CHANGED
data/linkey.gemspec
CHANGED
@@ -4,18 +4,19 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'linkey/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'linkey'
|
8
8
|
spec.version = Linkey::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Dave Blooman']
|
10
|
+
spec.email = ['david.blooman@gmail.com']
|
11
11
|
spec.summary = 'Linkey'
|
12
12
|
spec.description = 'Linkey'
|
13
|
-
spec.homepage =
|
14
|
-
spec.license =
|
13
|
+
spec.homepage = 'http://responsivenews.co.uk'
|
14
|
+
spec.license = 'Apache 2'
|
15
15
|
|
16
|
-
spec.files = `git ls-files`.split(
|
16
|
+
spec.files = `git ls-files`.split($INPUT_RECORD_SEPARATOR)
|
17
17
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
-
spec.require_paths = [
|
18
|
+
spec.require_paths = ['lib']
|
19
19
|
|
20
|
-
spec.add_runtime_dependency
|
20
|
+
spec.add_runtime_dependency 'thor'
|
21
|
+
spec.add_runtime_dependency 'parallel'
|
21
22
|
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: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dave Blooman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: parallel
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description: Linkey
|
28
42
|
email:
|
29
43
|
- david.blooman@gmail.com
|
@@ -69,4 +83,3 @@ signing_key:
|
|
69
83
|
specification_version: 4
|
70
84
|
summary: Linkey
|
71
85
|
test_files: []
|
72
|
-
has_rdoc:
|