domain_expiry 0.1.1 → 1.0.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 +30 -6
- data/lib/domain_expiry.rb +2 -2
- data/lib/domain_expiry/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6d74446ead3ce9287bc4ae5c0944f37be58e2a81
|
4
|
+
data.tar.gz: 3220dc30b8fd33478d75bad97a67d5c14bb6b265
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b3ceef9ed6aa70f8b6b154644322ff5472d3317d80da70d22623f77198532c77ad995365193ae134be7ea11c192d2f8cc8794d7b93a3ba10aa038022dc8b445
|
7
|
+
data.tar.gz: 5e97ef03262086b685c208cb8be906d9887ffc6dd48ac916277e2599a2c6948bae6bf43cca3296558f9272ffc7487ab9d1370ab7a09954bab1c4e18d497bd45e
|
data/README.md
CHANGED
@@ -28,24 +28,48 @@ Or install it yourself as:
|
|
28
28
|
|
29
29
|
## Usage
|
30
30
|
|
31
|
+
### Simple Usage
|
31
32
|
```ruby
|
32
33
|
require 'domain_expiry'
|
33
34
|
|
34
35
|
DomainExpiry::DomainExpiry.domain_details('antiphoton.com')
|
36
|
+
|
37
|
+
Results:
|
38
|
+
{"antiphoton.com"=>{"status"=>200, "expires_on"=>"11 Oct 2020", "expires_in"=>598}}
|
35
39
|
```
|
36
40
|
|
41
|
+
### Displaying the output
|
42
|
+
|
37
43
|
```ruby
|
38
44
|
require 'domain_expiry'
|
39
45
|
|
40
46
|
results = DomainExpiry::DomainExpiry.domain_details(['antiphoton.com','wolfsoftware.com'])
|
41
47
|
DomainExpiry::DomainExpiry.display_results(results)
|
48
|
+
```
|
49
|
+
|
50
|
+
This would give the following output
|
51
|
+
|
52
|
+
```shell
|
53
|
+
--------------------------------------------------------------------------------
|
54
|
+
Domain | Status
|
55
|
+
--------------------------------------------------------------------------------
|
56
|
+
antiphoton.com | expires on 11 Oct 2020 (in 598 days)
|
57
|
+
wolfsoftware.com | expires on 24 Jan 2022 (in 1068 days)
|
58
|
+
--------------------------------------------------------------------------------
|
59
|
+
```
|
60
|
+
|
61
|
+
## Command Line Tools
|
62
|
+
|
63
|
+
There is a command line tool included with this gem.
|
64
|
+
|
65
|
+
```shell
|
66
|
+
check-domain -d antiphoton.com
|
42
67
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
------------------------------------------------------------------------------------------------------------------------
|
68
|
+
--------------------------------------------------------------------------------
|
69
|
+
Domain | Status
|
70
|
+
--------------------------------------------------------------------------------
|
71
|
+
antiphoton.com | expires on 11 Oct 2020 (in 598 days)
|
72
|
+
--------------------------------------------------------------------------------
|
49
73
|
```
|
50
74
|
|
51
75
|
## Development
|
data/lib/domain_expiry.rb
CHANGED
@@ -62,7 +62,7 @@ module DomainExpiry
|
|
62
62
|
delim = '-' * width
|
63
63
|
|
64
64
|
puts(delim)
|
65
|
-
printf(
|
65
|
+
printf(" %-30s | %s\n", 'Domain', 'Status')
|
66
66
|
puts(delim)
|
67
67
|
|
68
68
|
results.each do |domain, details|
|
@@ -71,7 +71,7 @@ module DomainExpiry
|
|
71
71
|
else
|
72
72
|
format('expires on %<expires_in>s (in %<expires_on>s days)', expires_in: details['expires_on'], expires_on: details['expires_in'])
|
73
73
|
end
|
74
|
-
printf(
|
74
|
+
printf(" %-30s | %s\n", domain, status)
|
75
75
|
end
|
76
76
|
puts(delim)
|
77
77
|
end
|