domr 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (2) hide show
  1. data/bin/domr +10 -1
  2. metadata +3 -3
data/bin/domr CHANGED
@@ -2,11 +2,13 @@
2
2
  require 'domainr'
3
3
  require 'rainbow'
4
4
 
5
+ # check for empty query
5
6
  if !ARGV[0]
6
7
  puts "Please enter a name".color(:red)
7
8
  exit
8
9
  end
9
10
 
11
+ # perform a query
10
12
  search = Domainr.search(ARGV[0])
11
13
 
12
14
  puts "\n"
@@ -15,16 +17,23 @@ puts "Your query: " << search.query
15
17
 
16
18
  puts "\n"
17
19
 
20
+ # output results
18
21
  search.results.each do |result|
22
+
23
+ # determine color to show
19
24
  if result.availability == 'available'
20
25
  color = :green
21
26
  elsif result.availability == 'taken' || result.availability == 'unavailable'
22
27
  color = :red
23
- elsif result.availability == 'tld'
28
+ elsif result.availability == 'maybe'
24
29
  color = :yellow
25
30
  else
26
31
  color = :white
27
32
  end
33
+
34
+ # final output string
28
35
  string = " " << result.domain << " " << result.availability
36
+
37
+ # output colorized string
29
38
  puts string.color(color)
30
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: domr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -60,14 +60,14 @@ dependencies:
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  description: Quickly search for available domains
63
- email: nick@nicksh.com
63
+ email: shveloo@gmail.com
64
64
  executables:
65
65
  - domr
66
66
  extensions: []
67
67
  extra_rdoc_files: []
68
68
  files:
69
69
  - bin/domr
70
- homepage: http://rubygems.org/gems/domr
70
+ homepage: http://github.com/shvelo/domr
71
71
  licenses: []
72
72
  post_install_message:
73
73
  rdoc_options: []