domain_check 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4d156cda2e77ffe708233ba3b33eaa4daef0db90
4
- data.tar.gz: 26c8e0aa8fe3968a1f19ff01625ae7087a9bbaec
3
+ metadata.gz: 37606086478bca85e19c1e32271662485277a1c5
4
+ data.tar.gz: e44ac17e1620f5b81f1ffc2101d471093ed6fc6c
5
5
  SHA512:
6
- metadata.gz: 9095b81086328053dcf02eb590a2faff37cfb763854c5d5ea94615a235e0b383a36f41514e596c60f52d8e1fc21e896e79b78dc96ba05e7325f301fa18caa09b
7
- data.tar.gz: 6be4fe35e5a276ded2b3aa6338860707af4cbc69f87ff0f7dbabf254febdc89149eee9e5e725253b5392c2c1ba9a467d641971cec33db68b16d27124acc37afe
6
+ metadata.gz: f6eafd8106b11e1f9e10fa0662b3034807e6a3bae3fbac5b2c652c7bf4d6f8cdb9b97d13d2ab5943fa33c184d88a56b221f724ed793a7a6f21b0354603c02673
7
+ data.tar.gz: 3f04889a95edd27f2b1097b64213e0a481f882892265f1b1a702c38e62feeb352e85dc81d1ca8c8ab34d2f6ac491bfd77960ec1424dc00895b56d621b420b91d
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- domain_check (0.0.1)
4
+ domain_check (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
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
@@ -1,3 +1,3 @@
1
1
  module DomainCheck
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domain_check
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Kottom