domr 0.1.8 → 0.1.9
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.
- data/bin/domr +4 -5
- data/ext/mkrf_conf.rb +3 -3
- data/lib/domr.rb +4 -4
- metadata +3 -5
data/bin/domr
CHANGED
@@ -3,13 +3,12 @@ require 'domr'
|
|
3
3
|
|
4
4
|
# Check for empty query
|
5
5
|
if !ARGV[0]
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
exit 1
|
6
|
+
arg = ''
|
7
|
+
else
|
8
|
+
arg = ARGV[0]
|
10
9
|
end
|
11
10
|
|
12
11
|
# Perform the search
|
13
|
-
if Domr.search(
|
12
|
+
if !Domr.search(arg)
|
14
13
|
exit 1
|
15
14
|
end
|
data/ext/mkrf_conf.rb
CHANGED
@@ -9,13 +9,13 @@ end
|
|
9
9
|
inst = Gem::DependencyInstaller.new
|
10
10
|
begin
|
11
11
|
if RUBY_PLATFORM =~ /mswin32/ || RUBY_PLATFORM =~ /mingw/ || RUBY_PLATFORM =~ /cygwin/
|
12
|
-
inst.install
|
13
|
-
inst.install "windows-pr",
|
12
|
+
inst.install 'win32console', '~> 1.3.2'
|
13
|
+
inst.install "windows-pr", '~> 1.2.1'
|
14
14
|
end
|
15
15
|
rescue
|
16
16
|
exit(1)
|
17
17
|
end
|
18
18
|
|
19
|
-
f = File.open(File.join(File.dirname(__FILE__),
|
19
|
+
f = File.open(File.join(File.dirname(__FILE__), 'Rakefile'), 'w') # create dummy rakefile to indicate success
|
20
20
|
f.write("task :default\n")
|
21
21
|
f.close
|
data/lib/domr.rb
CHANGED
@@ -19,15 +19,15 @@ class Domr
|
|
19
19
|
def self.search query
|
20
20
|
|
21
21
|
# Form the request string
|
22
|
-
request = Net::HTTP::Get.new(
|
22
|
+
request = Net::HTTP::Get.new('/api/json/search?q=' << URI.escape(query))
|
23
23
|
|
24
24
|
# Perform the actual query
|
25
|
-
response = Net::HTTP.start(
|
25
|
+
response = Net::HTTP.start('domai.nr') do |http|
|
26
26
|
http.request request
|
27
27
|
end
|
28
28
|
|
29
29
|
# Check for errors
|
30
|
-
if response.code !=
|
30
|
+
if response.code != '200'
|
31
31
|
puts "HTTP error".color(:red).bright
|
32
32
|
return false
|
33
33
|
end
|
@@ -48,7 +48,7 @@ class Domr
|
|
48
48
|
end
|
49
49
|
|
50
50
|
# Construct final output string
|
51
|
-
string =
|
51
|
+
string = ' ' << result['domain'] << ' ' << result['availability']
|
52
52
|
|
53
53
|
# Output colorized string
|
54
54
|
puts string.color(color).bright
|
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.1.
|
4
|
+
version: 0.1.9
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-07-
|
12
|
+
date: 2012-07-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -43,9 +43,7 @@ dependencies:
|
|
43
43
|
- - ! '>='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: '0'
|
46
|
-
description:
|
47
|
-
|
48
|
-
'
|
46
|
+
description: Quickly search for available domain names from command line.
|
49
47
|
email: shveloo@gmail.com
|
50
48
|
executables:
|
51
49
|
- domr
|