nic_ar 0.0.5 → 0.1.0
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/{README.md → README.rdoc} +14 -28
- data/lib/nic_ar/client.rb +8 -1
- data/lib/nic_ar/version.rb +2 -1
- data/lib/nic_ar.rb +29 -11
- metadata +9 -9
data/{README.md → README.rdoc}
RENAMED
@@ -1,24 +1,10 @@
|
|
1
|
-
|
1
|
+
= NicAr::Client
|
2
2
|
|
3
|
-
The NicAr::Client
|
3
|
+
The NicAr::Client class allows to you programatically extract information about any ".ar" (Argentina) domain name.
|
4
4
|
|
5
|
-
It uses the public information as is made available at the
|
5
|
+
It uses the public information as is made available at the {Dirección Nacional del Registro de Dominios de Internet}[http://www.nic.ar] website using the third-party {nic!alert API}[http://api.nicalert.com.ar] webservice.
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
Add this line to your application's Gemfile:
|
10
|
-
|
11
|
-
gem 'nic_ar'
|
12
|
-
|
13
|
-
And then execute:
|
14
|
-
|
15
|
-
$ bundle
|
16
|
-
|
17
|
-
Or install it yourself as:
|
18
|
-
|
19
|
-
$ gem install nic_ar
|
20
|
-
|
21
|
-
## Usage
|
7
|
+
== Usage
|
22
8
|
|
23
9
|
The NicAr::Client class supports lookups for domain names, domain transactions, entities, people, DNS servers.
|
24
10
|
|
@@ -141,21 +127,21 @@ Transactions can also be queried by it's unique identifier:
|
|
141
127
|
"notes"=>"Se envio acuse de recibo al solicitante"
|
142
128
|
}
|
143
129
|
|
144
|
-
|
130
|
+
== Hacking
|
145
131
|
|
146
|
-
The full documentation of the
|
132
|
+
The full documentation of the <b>nic!alert API</b> is available at {api.nicalert.com.ar}[http://api.nicalert.com.ar] if you want to write your own client, use any other language, or just use CURL in a RESTful way.
|
147
133
|
|
148
|
-
|
134
|
+
== Live examples
|
149
135
|
|
150
|
-
|
136
|
+
=== nic!alert
|
151
137
|
|
152
|
-
A live test application is set up at the
|
138
|
+
A live test application is set up at the {nic!alert}[http://www.nicalert.com.ar] website that allows for the automatic renewal of ".ar" domain names within their 30-day expiring period. The application also has the added feature of resolving the CAPTCHA challenge for the submission of the renewal request.
|
153
139
|
|
154
|
-
|
140
|
+
=== Nic.ar Whois domain
|
155
141
|
|
156
|
-
A very nice Node.js application that provides "typeahead" domain searching capabilities. The wesite is
|
142
|
+
A very nice Node.js application that provides "typeahead" domain searching capabilities. The wesite is {hosted at Heroku}[http://nicar.herokuapp.com/] and it's {code at GitHub}[https://github.com/danzajdband/nicar-whois]. Credits to Dan Zajdband.
|
157
143
|
|
158
|
-
|
144
|
+
== Contributing
|
159
145
|
|
160
146
|
1. Fork it
|
161
147
|
2. Create your feature branch (`git checkout -b my-new-feature`)
|
@@ -163,6 +149,6 @@ A very nice Node.js application that provides "typeahead" domain searching capab
|
|
163
149
|
4. Push to the branch (`git push origin my-new-feature`)
|
164
150
|
5. Create new Pull Request
|
165
151
|
|
166
|
-
|
152
|
+
== Copyright
|
167
153
|
|
168
|
-
Copyright (c)2012
|
154
|
+
Copyright (c)2012 {Cristian R. Arroyo}[mailto:cristian.arroyo@vivasserver.com]
|
data/lib/nic_ar/client.rb
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
module NicAr
|
2
|
+
|
3
|
+
# Simple HTTP client for accessing the public {nic!alert API}[http://api.nicalert.com.ar].
|
4
|
+
#
|
5
|
+
# Full API spec. available at {api.nicalert.com.ar}[http://api.nicalert.com.ar]
|
6
|
+
#
|
2
7
|
class Client
|
3
8
|
class << self
|
9
|
+
# Maps class methods to API calls
|
4
10
|
def method_missing(name, *args)
|
5
11
|
params = '/' + args.map { |p| CGI.escape(p) }.join('/') unless args.empty?
|
6
12
|
resource = name.to_s
|
@@ -48,6 +54,8 @@ module NicAr
|
|
48
54
|
#500: System Error
|
49
55
|
when 500
|
50
56
|
raise ServiceError, message
|
57
|
+
else
|
58
|
+
raise e
|
51
59
|
end
|
52
60
|
end
|
53
61
|
|
@@ -58,7 +66,6 @@ module NicAr
|
|
58
66
|
end
|
59
67
|
|
60
68
|
# override to support multiple API hosts
|
61
|
-
|
62
69
|
def api_host #:nodoc:
|
63
70
|
API_URI
|
64
71
|
end
|
data/lib/nic_ar/version.rb
CHANGED
data/lib/nic_ar.rb
CHANGED
@@ -4,20 +4,38 @@ require 'rubygems'
|
|
4
4
|
require 'bundler/setup'
|
5
5
|
require 'rest_client'
|
6
6
|
|
7
|
+
# NicAr is the _official_ Ruby gem for accessing the {nic!alert API}[http://api.nicalert.com.ar]. See the README.rdoc
|
8
|
+
|
7
9
|
module NicAr
|
10
|
+
# The base URI for the nic!alert API.
|
8
11
|
API_URI = 'http://api.nicalert.com.ar'
|
9
12
|
|
10
|
-
#
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
class
|
15
|
-
|
16
|
-
|
17
|
-
class
|
18
|
-
|
19
|
-
|
20
|
-
class
|
13
|
+
# Exception for status HTTP 424: Failed Dependency
|
14
|
+
class CaptchaError < StandardError; end
|
15
|
+
|
16
|
+
# Exception for status HTTP 406: Not Acceptable
|
17
|
+
class RequestError < StandardError; end
|
18
|
+
|
19
|
+
# Exception for status HTTP 417: Expectation Failed (available?, pending?)
|
20
|
+
class ExpectationError < StandardError; end
|
21
|
+
|
22
|
+
# Exception for status HTTP 204: No Content
|
23
|
+
class NoContent < StandardError; end
|
24
|
+
|
25
|
+
# Exception for status HTTP 404: Not Found
|
26
|
+
class NotFound < StandardError; end
|
27
|
+
|
28
|
+
# Exception for status HTTP 400: Bad Request
|
29
|
+
class ParameterError < StandardError; end
|
30
|
+
|
31
|
+
# Exception for status HTTP 412: Precondition Failed
|
32
|
+
class PreconditionError < StandardError; end
|
33
|
+
|
34
|
+
# Exception for status HTTP 500: System Error
|
35
|
+
class ServiceError < StandardError; end
|
36
|
+
|
37
|
+
# Exception for status HTTP 408: Request Timeout
|
38
|
+
class TimeoutError < StandardError; end
|
21
39
|
end
|
22
40
|
|
23
41
|
require "nic_ar/client"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nic_ar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-04 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rest-client
|
16
|
-
requirement: &
|
16
|
+
requirement: &70638290 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '1.6'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70638290
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: minitest
|
27
|
-
requirement: &
|
27
|
+
requirement: &70638020 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '3.3'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70638020
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: webmock
|
38
|
-
requirement: &
|
38
|
+
requirement: &70637730 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: '1.8'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70637730
|
47
47
|
description: A simple client for ".ar" (Argentina) domain names lookups
|
48
48
|
email:
|
49
49
|
- cristian.arroyo@vivaserver.com
|
@@ -54,7 +54,7 @@ files:
|
|
54
54
|
- .gitignore
|
55
55
|
- Gemfile
|
56
56
|
- LICENSE.txt
|
57
|
-
- README.
|
57
|
+
- README.rdoc
|
58
58
|
- Rakefile
|
59
59
|
- lib/nic_ar.rb
|
60
60
|
- lib/nic_ar/client.rb
|