docheck 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -14,7 +14,6 @@
14
14
 
15
15
 
16
16
  == Usage
17
- w = Whois::Client.new
18
17
  From the command line:
19
18
 
20
19
  docheck google
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1
data/docheck.gemspec CHANGED
@@ -2,8 +2,7 @@ Gem::Specification.new do |spec|
2
2
  spec.authors = 'Kunto Aji Kristianto'
3
3
  spec.add_dependency('whois', '~> 1.3.8')
4
4
  spec.description = <<-EOF
5
- Docheck is a tool to check domain name availability.
6
- By default, It will return all available and registered domains.
5
+ Docheck is domain name availability checker.
7
6
  EOF
8
7
  spec.email = 'kunto.aji.kr@gmail.com'
9
8
  spec.executables << 'docheck'
@@ -19,5 +18,5 @@ Gem::Specification.new do |spec|
19
18
  spec.requirements << 'ruby-whois, v1.3.8 or greater'
20
19
  spec.summary = 'Domain name availability checker.'
21
20
  spec.test_files = ['test/docheck_test.rb', 'test/helper.rb']
22
- spec.version = '1.0.0'
21
+ spec.version = '1.0.1'
23
22
  end
data/lib/docheck.rb CHANGED
@@ -12,10 +12,14 @@ class Docheck
12
12
  TLD = %w{aero asia biz cat com coop edu gov info
13
13
  int jobs mil mobi museum name net org pro tel travel}
14
14
 
15
+ # Public instance method to return available domains or
16
+ # registered domains
17
+ attr_reader :available_domains, :registered_domains
18
+
15
19
  # base_name is sld (Second Level Domain) and
16
20
  # converted to lower case.
17
21
  def initialize(base_name)
18
- @base_name = base_name
22
+ @base_name = base_name.downcase
19
23
  @available_domains = []
20
24
  @registered_domains = []
21
25
  end
data/test/docheck_test.rb CHANGED
@@ -1,16 +1,33 @@
1
1
  require File.expand_path('../helper.rb', __FILE__)
2
2
 
3
3
  class TestDocheck < Test::Unit::TestCase
4
+ context "Docheck gem" do
5
+ should "require Whois" do
6
+ assert defined?(Whois)
7
+ end
8
+ end
9
+
4
10
  context "A Docheck instance" do
5
11
  setup do
6
12
  @docheck = Docheck.new('railsmine')
7
13
  end
8
14
 
15
+ should "respond to all its public instance method" do
16
+ assert @docheck.respond_to?(:fetch)
17
+ assert @docheck.respond_to?(:print)
18
+ assert @docheck.respond_to?(:available_domains)
19
+ assert @docheck.respond_to?(:registered_domains)
20
+ end
21
+
9
22
  should "return all availability and registered domain" do
10
23
  result = @docheck.fetch
11
24
  assert result.is_a?(Array)
12
25
  assert result.first.is_a?(Array)
26
+ assert @docheck.available_domains.is_a?(Array)
27
+ assert_equal result.first, @docheck.available_domains
13
28
  assert result.last.is_a?(Array)
29
+ assert @docheck.registered_domains.is_a?(Array)
30
+ assert_equal result.last, @docheck.registered_domains
14
31
  assert_not_nil result
15
32
  end
16
33
 
data/test/helper.rb CHANGED
@@ -5,6 +5,3 @@ require 'shoulda'
5
5
  $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
6
6
  $LOAD_PATH.unshift(File.dirname(__FILE__))
7
7
  require 'docheck'
8
-
9
- #class Test::Unit::TestCase
10
- #end
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ hash: 21
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 1
10
+ version: 1.0.1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Kunto Aji Kristianto
@@ -9,20 +15,26 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-10-08 00:00:00 +07:00
18
+ date: 2010-10-14 00:00:00 +07:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: whois
17
- type: :runtime
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ~>
22
28
  - !ruby/object:Gem::Version
29
+ hash: 11
30
+ segments:
31
+ - 1
32
+ - 3
33
+ - 8
23
34
  version: 1.3.8
24
- version:
25
- description: " Docheck is a tool to check domain name availability.\n By default, It will return all available and registered domains.\n"
35
+ type: :runtime
36
+ version_requirements: *id001
37
+ description: " Docheck is domain name availability checker.\n"
26
38
  email: kunto.aji.kr@gmail.com
27
39
  executables:
28
40
  - docheck
@@ -53,21 +65,29 @@ rdoc_options:
53
65
  require_paths:
54
66
  - lib
55
67
  required_ruby_version: !ruby/object:Gem::Requirement
68
+ none: false
56
69
  requirements:
57
70
  - - ">="
58
71
  - !ruby/object:Gem::Version
72
+ hash: 57
73
+ segments:
74
+ - 1
75
+ - 8
76
+ - 7
59
77
  version: 1.8.7
60
- version:
61
78
  required_rubygems_version: !ruby/object:Gem::Requirement
79
+ none: false
62
80
  requirements:
63
81
  - - ">="
64
82
  - !ruby/object:Gem::Version
83
+ hash: 3
84
+ segments:
85
+ - 0
65
86
  version: "0"
66
- version:
67
87
  requirements:
68
88
  - ruby-whois, v1.3.8 or greater
69
89
  rubyforge_project:
70
- rubygems_version: 1.3.5
90
+ rubygems_version: 1.3.7
71
91
  signing_key:
72
92
  specification_version: 3
73
93
  summary: Domain name availability checker.