linksta 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +12 -14
- data/lib/linksta/cli.rb +4 -4
- data/lib/linksta/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 230223e72900918ff23d59880aca64b535cdd654
|
4
|
+
data.tar.gz: 5fa4a766d9a78311a4adcda9d384b125ec0af290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d6485790d16b3a2c51939439218fbbc31596b821ff0c5255cd35d729b306b960d571f6a2dcbb6f361956b96fef2a1f82a4c7502cd20aa74e2a709f993621d7b
|
7
|
+
data.tar.gz: fc842115c48eac41100af223d7157a9512dfa82034d42e8a173201f922db81df9973d658bd8f37ebb081ac90af82b022203248e41f0062c340acd04e59aefb91
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
#
|
2
|
-
|
3
|
-
[](https://rubygems.org/gems/linkey) [](https://rubygems.org/gems/linkey) [](https://travis-ci.org/DaveBlooman/linkey) [](https://codeclimate.com/github/DaveBlooman/linkey)
|
1
|
+
# Linksta
|
4
2
|
|
5
3
|
**Link checker for BBC Radio & Music sites.**
|
6
4
|
|
@@ -15,24 +13,24 @@ There are 4 parts to this tool, the URL, the base URL, the regex and the filenam
|
|
15
13
|
|
16
14
|
## Installation
|
17
15
|
|
18
|
-
gem install
|
16
|
+
gem install linksta
|
19
17
|
|
20
18
|
## Usage
|
21
19
|
|
22
20
|
### Command Line
|
23
21
|
|
24
22
|
```
|
25
|
-
|
23
|
+
linksta check <url> <base_url> <regex> <filename>
|
26
24
|
```
|
27
25
|
|
28
26
|
**Examples**
|
29
27
|
|
30
28
|
```
|
31
|
-
|
29
|
+
linksta check http://www.bbc.co.uk/radio http://www.bbc.co.uk/radio radio.md
|
32
30
|
```
|
33
31
|
|
34
32
|
```
|
35
|
-
|
33
|
+
linksta check http://www.theguardian.com/technology/2014/feb/15/year-of-code-needs-reboot-teachers http://theguardian.com /technology news.md
|
36
34
|
```
|
37
35
|
**Output**
|
38
36
|
|
@@ -41,15 +39,15 @@ Once running, you'll see either a 200 with `Status is 200 for <URL>` or `Status
|
|
41
39
|
### Script It
|
42
40
|
|
43
41
|
```ruby
|
44
|
-
require '
|
42
|
+
require 'linksta'
|
45
43
|
|
46
44
|
url = 'http://www.live.bbc.co.uk/radio'
|
47
45
|
base = 'http://www.live.bbc.co.uk'
|
48
46
|
reg = '/radio'
|
49
|
-
filename = '
|
47
|
+
filename = 'radio.md'
|
50
48
|
|
51
|
-
page =
|
52
|
-
status =
|
49
|
+
page = Linksta::SaveLinks.new(url, filename)
|
50
|
+
status = Linksta::CheckResponse.new(url, base, reg, filename)
|
53
51
|
|
54
52
|
page.capture_links
|
55
53
|
status.check_links
|
@@ -60,7 +58,7 @@ status.check_links
|
|
60
58
|
If you have a lot of URLs that you want to check all the time using from a file is an alternative option. This will utilise the smoke option, then point to a YAML file with the extension. In some situations, we are deploying applications that we don't want public facing, so ensuring they 404 is essential. There is a status code option to allow a specific status code to be set against a group of URL's, ensuring builds fail if the right code conditions are met.
|
61
59
|
|
62
60
|
```
|
63
|
-
|
61
|
+
linksta smoke test.yaml
|
64
62
|
```
|
65
63
|
|
66
64
|
Example YAML Config:
|
@@ -84,8 +82,8 @@ paths:
|
|
84
82
|
Via a Ruby script:
|
85
83
|
|
86
84
|
```ruby
|
87
|
-
require '
|
85
|
+
require 'linksta'
|
88
86
|
|
89
|
-
tests =
|
87
|
+
tests = Linksta::Checker.new("path/to.yaml")
|
90
88
|
tests.smoke
|
91
89
|
```
|
data/lib/linksta/cli.rb
CHANGED
@@ -1,18 +1,18 @@
|
|
1
1
|
require "thor"
|
2
2
|
require "linksta"
|
3
3
|
|
4
|
-
class
|
4
|
+
class Linksta::CLI < Thor
|
5
5
|
include Thor::Actions
|
6
6
|
|
7
7
|
desc "scan", "Save some URL's"
|
8
8
|
def scan(url, filename)
|
9
|
-
html =
|
9
|
+
html = Linksta::SaveLinks.new(url, filename)
|
10
10
|
html.capture_links
|
11
11
|
end
|
12
12
|
|
13
13
|
desc "status", "checks links for errors"
|
14
14
|
def status(url, base, reg, filename)
|
15
|
-
status =
|
15
|
+
status = Linksta::CheckResponse.new(url, base, reg, filename)
|
16
16
|
status.check_links
|
17
17
|
end
|
18
18
|
|
@@ -24,7 +24,7 @@ class Linkey::CLI < Thor
|
|
24
24
|
|
25
25
|
desc "smoke [path/to/file]", "A linksta job using predetermined URL's"
|
26
26
|
def smoke(file)
|
27
|
-
check =
|
27
|
+
check = Linksta::Checker.new(file)
|
28
28
|
check.smoke
|
29
29
|
end
|
30
30
|
end
|
data/lib/linksta/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: linksta
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- CAP Testers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|