domain_check 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/domain_check +8 -2
- data/lib/domain_check/console_formatter.rb +4 -1
- data/lib/domain_check/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: 37606086478bca85e19c1e32271662485277a1c5
|
4
|
+
data.tar.gz: e44ac17e1620f5b81f1ffc2101d471093ed6fc6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6eafd8106b11e1f9e10fa0662b3034807e6a3bae3fbac5b2c652c7bf4d6f8cdb9b97d13d2ab5943fa33c184d88a56b221f724ed793a7a6f21b0354603c02673
|
7
|
+
data.tar.gz: 3f04889a95edd27f2b1097b64213e0a481f882892265f1b1a702c38e62feeb352e85dc81d1ca8c8ab34d2f6ac491bfd77960ec1424dc00895b56d621b420b91d
|
data/Gemfile.lock
CHANGED
data/bin/domain_check
CHANGED
@@ -4,7 +4,9 @@ require 'domain_check'
|
|
4
4
|
require 'date'
|
5
5
|
require 'optparse'
|
6
6
|
|
7
|
-
options
|
7
|
+
options = { }
|
8
|
+
format_options = { }
|
9
|
+
|
8
10
|
opt_parser = OptionParser.new do |opts|
|
9
11
|
opts.banner = "Usage: domain_check [options]"
|
10
12
|
|
@@ -35,6 +37,10 @@ opt_parser = OptionParser.new do |opts|
|
|
35
37
|
options[:tlds] = tlds.split(/,/)
|
36
38
|
end
|
37
39
|
|
40
|
+
opts.on("-a", "--available-only", "Only show available domains") do |available|
|
41
|
+
format_options[:available_only] = available
|
42
|
+
end
|
43
|
+
|
38
44
|
opts.on_tail("-?", "--help", "Show this message") do
|
39
45
|
puts opts
|
40
46
|
exit
|
@@ -44,6 +50,6 @@ end
|
|
44
50
|
opt_parser.parse!(ARGV)
|
45
51
|
|
46
52
|
DomainCheck.new(**options).check do |result|
|
47
|
-
formatter = DomainCheck::ConsoleFormatter.new(result)
|
53
|
+
formatter = DomainCheck::ConsoleFormatter.new(result, format_options[:available_only])
|
48
54
|
formatter.format
|
49
55
|
end
|
@@ -2,12 +2,15 @@ require "ansi"
|
|
2
2
|
require "date"
|
3
3
|
|
4
4
|
class DomainCheck::ConsoleFormatter
|
5
|
-
def initialize(result)
|
5
|
+
def initialize(result, available_only = false)
|
6
6
|
@result = result
|
7
|
+
@available_only = available_only
|
7
8
|
end
|
8
9
|
|
9
10
|
def format
|
10
11
|
if @result
|
12
|
+
return if @available_only && @result[:status] != :available
|
13
|
+
|
11
14
|
domain = @result[:domain].ljust(24).ansi.bold.blue
|
12
15
|
|
13
16
|
if @result[:status] == :available
|
data/lib/domain_check/version.rb
CHANGED