gandirb 1.0 → 1.1.1
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/CHANGELOG +14 -1
- data/Gemfile +3 -0
- data/README.rdoc +36 -0
- data/Rakefile +8 -17
- data/gandirb.gemspec +23 -24
- data/lib/gandi/base.rb +28 -28
- data/lib/gandi/domain.rb +7 -8
- data/lib/gandi/domain_modules/contact.rb +1 -1
- data/lib/gandi/domain_modules/operations.rb +1 -1
- data/lib/gandi/domain_modules/redirection.rb +2 -2
- data/lib/gandi/version.rb +3 -0
- data/lib/gandi.rb +3 -4
- data/test/gandi/domain_test.rb +7 -8
- metadata +98 -89
- data/README +0 -35
- data/rdoc/classes/Gandi/Base.html +0 -397
- data/rdoc/classes/Gandi/DataError.html +0 -111
- data/rdoc/classes/Gandi/Domain.html +0 -623
- data/rdoc/classes/Gandi/DomainModules/Contact.html +0 -246
- data/rdoc/classes/Gandi/DomainModules/Host.html +0 -227
- data/rdoc/classes/Gandi/DomainModules/NameServers.html +0 -226
- data/rdoc/classes/Gandi/DomainModules/Operations.html +0 -229
- data/rdoc/classes/Gandi/DomainModules/Redirection.html +0 -215
- data/rdoc/classes/Gandi/DomainModules.html +0 -136
- data/rdoc/classes/Gandi/ServerError.html +0 -111
- data/rdoc/classes/Gandi.html +0 -153
- data/rdoc/created.rid +0 -1
- data/rdoc/files/README.html +0 -162
- data/rdoc/files/lib/gandi/base_rb.html +0 -109
- data/rdoc/files/lib/gandi/domain_modules/contact_rb.html +0 -101
- data/rdoc/files/lib/gandi/domain_modules/host_rb.html +0 -101
- data/rdoc/files/lib/gandi/domain_modules/name_servers_rb.html +0 -101
- data/rdoc/files/lib/gandi/domain_modules/operations_rb.html +0 -101
- data/rdoc/files/lib/gandi/domain_modules/redirection_rb.html +0 -101
- data/rdoc/files/lib/gandi/domain_rb.html +0 -101
- data/rdoc/files/lib/gandi_rb.html +0 -101
- data/rdoc/fr_class_index.html +0 -38
- data/rdoc/fr_file_index.html +0 -36
- data/rdoc/fr_method_index.html +0 -83
- data/rdoc/index.html +0 -24
- data/rdoc/rdoc-style.css +0 -208
data/CHANGELOG
CHANGED
@@ -1 +1,14 @@
|
|
1
|
-
|
1
|
+
== 1.1.1
|
2
|
+
|
3
|
+
* Missing gemfile in gem
|
4
|
+
|
5
|
+
== 1.1.0
|
6
|
+
|
7
|
+
* Fix method Domain#domain_web_redir_add
|
8
|
+
* Add ruby 1.9 compatibility
|
9
|
+
* Do not use the production URL when none is provided
|
10
|
+
* Use bundler for testing and release tasks
|
11
|
+
|
12
|
+
== 1.0
|
13
|
+
|
14
|
+
* Gem creation
|
data/Gemfile
ADDED
data/README.rdoc
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
= Gandirb - Ruby library for using the Gandi XML-RPC API
|
2
|
+
|
3
|
+
This is a ruby library for using the Gandi XML-RPC API.
|
4
|
+
It currently only provides methods for using the domain and mail API, but is extensible enough to add hosting in the future.
|
5
|
+
|
6
|
+
== Howto
|
7
|
+
|
8
|
+
See http://wiki.gandi.net/fr/api-xml/docs/domain for the full documentation on the API.
|
9
|
+
Note the session_id doesn't have to be explicitly provided when calling a method.
|
10
|
+
|
11
|
+
It should also be noted that the ruby xml-rpc lib seems to have a bug with the ssl support, resulting in a timeout of about 15 seconds.
|
12
|
+
After this time the current connection won't work and result in various exception.
|
13
|
+
This lib takes this issue into account and provides a workaround by restarting the connection. See the comments for Gandi::Base#raw_call for more details.
|
14
|
+
|
15
|
+
Quick example :
|
16
|
+
|
17
|
+
require 'gandi'
|
18
|
+
gandi_session = Gandi::Domain.login 'XXYYY-Gandi', 'mypasswd', Gandi::Domain::TEST_URL #or use Gandi::Domain::URL in production mode
|
19
|
+
gandi_session.account_currency # => "EUR"
|
20
|
+
gandi_session.domain_available ["mycoolwebsite.com"] # => {"mycoolwebsite.com"=>true}
|
21
|
+
gandi_session.domain_available "mycoolwebsite.com" # => true #additional syntax
|
22
|
+
gandi_session.domain_list # => ["mypersonalwebsite.com"]
|
23
|
+
|
24
|
+
Detailed RDoc documentation for each method is available using rake rdoc.
|
25
|
+
|
26
|
+
== TODO
|
27
|
+
|
28
|
+
* More tests
|
29
|
+
* Finish adding and cleaning up domain and mail methods
|
30
|
+
* Better handling of failures and server exceptions, and stricter params checking
|
31
|
+
* Refactor Domain and Base class and add a Session class to separate XML-RPC code and prepare adding hosting methods
|
32
|
+
|
33
|
+
== Copyright
|
34
|
+
|
35
|
+
Copyright (c) 2009 Pickabee. Released under the MIT licence, see LICENSE for details.
|
36
|
+
Some parts inspired by http://github.com/jerome/gandi/tree
|
data/Rakefile
CHANGED
@@ -1,5 +1,6 @@
|
|
1
|
-
require '
|
1
|
+
require 'bundler/setup'
|
2
2
|
require 'rake'
|
3
|
+
require 'bundler/gem_tasks'
|
3
4
|
|
4
5
|
require 'rake/testtask'
|
5
6
|
Rake::TestTask.new(:test) do |test|
|
@@ -7,26 +8,16 @@ Rake::TestTask.new(:test) do |test|
|
|
7
8
|
test.pattern = 'test/**/*_test.rb'
|
8
9
|
test.verbose = false
|
9
10
|
end
|
10
|
-
|
11
|
-
begin
|
12
|
-
require 'rcov/rcovtask'
|
13
|
-
Rcov::RcovTask.new do |test|
|
14
|
-
test.libs << 'test'
|
15
|
-
test.pattern = 'test/**/*_test.rb'
|
16
|
-
test.verbose = true
|
17
|
-
end
|
18
|
-
rescue LoadError
|
19
|
-
task :rcov do
|
20
|
-
abort "RCov is not available. In order to run rcov, you must: sudo gem install spicycode-rcov"
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
11
|
+
|
24
12
|
task :default => :test
|
25
13
|
|
26
|
-
require '
|
14
|
+
require 'rdoc/task'
|
27
15
|
Rake::RDocTask.new do |rdoc|
|
28
16
|
rdoc.rdoc_dir = 'rdoc'
|
29
17
|
rdoc.title = "Gandirb"
|
30
|
-
rdoc.
|
18
|
+
rdoc.main = 'README.rdoc'
|
19
|
+
rdoc.rdoc_files.include('README*', 'CHANGELOG', 'LICENSE')
|
31
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
21
|
+
rdoc.options << "--line-numbers"
|
22
|
+
rdoc.options << "--charset=UTF-8"
|
32
23
|
end
|
data/gandirb.gemspec
CHANGED
@@ -1,34 +1,33 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require 'gandi/version'
|
2
4
|
|
3
5
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version =
|
6
|
+
s.name = "gandirb"
|
7
|
+
s.version = Gandi::VERSION
|
8
|
+
s.platform = Gem::Platform::RUBY
|
6
9
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
10
|
s.authors = ["Pickabee"]
|
9
|
-
s.
|
11
|
+
s.email = ""
|
12
|
+
s.homepage = "http://github.com/pickabee/gandirb"
|
13
|
+
s.summary = %q{Ruby library for using the Gandi XML-RPC API}
|
10
14
|
s.description = <<-EOL
|
11
|
-
This is a ruby library for using Gandi XML-RPC API.
|
12
|
-
It
|
15
|
+
This is a ruby library for using the Gandi XML-RPC API.
|
16
|
+
It currently only provides methods for using the domain and mail API, but is extensible enough to add hosting in the future.
|
13
17
|
EOL
|
14
|
-
s.
|
15
|
-
|
16
|
-
s.
|
17
|
-
s.files = ["CHANGELOG", "LICENSE", "README", "Rakefile", "lib/gandi.rb", "lib/gandi/base.rb", "lib/gandi/domain.rb", "lib/gandi/domain_modules/contact.rb", "lib/gandi/domain_modules/host.rb", "lib/gandi/domain_modules/mail.rb", "lib/gandi/domain_modules/name_servers.rb", "lib/gandi/domain_modules/operations.rb", "lib/gandi/domain_modules/redirection.rb", "rdoc/classes/Gandi.html", "rdoc/classes/Gandi/Base.html", "rdoc/classes/Gandi/DataError.html", "rdoc/classes/Gandi/Domain.html", "rdoc/classes/Gandi/DomainModules.html", "rdoc/classes/Gandi/DomainModules/Contact.html", "rdoc/classes/Gandi/DomainModules/Host.html", "rdoc/classes/Gandi/DomainModules/NameServers.html", "rdoc/classes/Gandi/DomainModules/Operations.html", "rdoc/classes/Gandi/DomainModules/Redirection.html", "rdoc/classes/Gandi/ServerError.html", "rdoc/created.rid", "rdoc/files/README.html", "rdoc/files/lib/gandi/base_rb.html", "rdoc/files/lib/gandi/domain_modules/contact_rb.html", "rdoc/files/lib/gandi/domain_modules/host_rb.html", "rdoc/files/lib/gandi/domain_modules/name_servers_rb.html", "rdoc/files/lib/gandi/domain_modules/operations_rb.html", "rdoc/files/lib/gandi/domain_modules/redirection_rb.html", "rdoc/files/lib/gandi/domain_rb.html", "rdoc/files/lib/gandi_rb.html", "rdoc/fr_class_index.html", "rdoc/fr_file_index.html", "rdoc/fr_method_index.html", "rdoc/index.html", "rdoc/rdoc-style.css", "test/gandi/base_test.rb", "test/gandi/domain_test.rb", "test/gandi_test.rb", "test/test_helper.rb", "gandirb.gemspec"]
|
18
|
-
s.homepage = %q{http://github.com/pickabee/gandirb}
|
19
|
-
s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Gandirb", "--main", "README"]
|
20
|
-
s.require_paths = ["lib"]
|
21
|
-
s.rubyforge_project = %q{gandirb}
|
22
|
-
s.rubygems_version = %q{1.3.6}
|
23
|
-
s.test_files = ["test/gandi/domain_test.rb", "test/gandi/base_test.rb", "test/gandi_test.rb", "test/test_helper.rb"]
|
18
|
+
s.rubyforge_project = "gandirb"
|
19
|
+
|
20
|
+
s.date = Date.today.strftime('%Y-%m-%d')
|
24
21
|
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
s.files = Dir["CHANGELOG", "LICENSE", "README.rdoc", "Gemfile", "Rakefile", "gandirb.gemspec", "{lib}/**/*.rb"]
|
23
|
+
s.test_files = Dir["{test}/**/*.rb"]
|
24
|
+
s.rdoc_options = ["--line-numbers", "--charset=UTF-8", "--title", "Gandirb", "--main", "README.rdoc"]
|
25
|
+
s.extra_rdoc_files = %w[CHANGELOG LICENSE]
|
26
|
+
s.require_paths = ["lib"]
|
28
27
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
28
|
+
s.add_dependency 'activesupport', '>= 2.0'
|
29
|
+
s.add_development_dependency 'rake'
|
30
|
+
s.add_development_dependency 'rdoc'
|
31
|
+
s.add_development_dependency 'shoulda', '< 3'
|
32
|
+
s.add_development_dependency 'mocha'
|
34
33
|
end
|
data/lib/gandi/base.rb
CHANGED
@@ -4,83 +4,83 @@ require 'openssl'
|
|
4
4
|
#Common session, account and call methods
|
5
5
|
module Gandi
|
6
6
|
class Base
|
7
|
-
|
8
7
|
TIMEOUT_EXCEPTIONS = [EOFError, Errno::EPIPE, OpenSSL::SSL::SSLError]
|
9
8
|
|
10
9
|
URL = "https://api.gandi.net/xmlrpc/"
|
11
10
|
TEST_URL = "https://api.ote.gandi.net/xmlrpc/"
|
12
|
-
|
11
|
+
|
12
|
+
SSL_VERIFY_MODE = OpenSSL::SSL::VERIFY_NONE
|
13
|
+
|
13
14
|
attr_reader :session_id, :handler
|
14
|
-
|
15
|
+
|
15
16
|
public
|
16
|
-
|
17
|
+
|
17
18
|
def initialize(login, password, uri = nil)
|
18
19
|
@login = login
|
19
20
|
@password = password
|
20
21
|
@uri = uri
|
21
|
-
|
22
|
-
begin
|
23
|
-
self.class.const_get(:URL)
|
24
|
-
rescue NameError
|
25
|
-
raise ArgumentError.new "You must provide an URL when using Gandi::Base directly"
|
26
|
-
end
|
27
|
-
end
|
22
|
+
raise ArgumentError.new("You must provide an URL when using Gandi::Base directly") unless @uri
|
28
23
|
end
|
29
|
-
|
24
|
+
|
30
25
|
#Calls a RPC method, transparently providing the session id
|
31
26
|
def call(method, *arguments)
|
32
27
|
raise "You have to log in before using methods requiring a session id" unless logged_in?
|
33
28
|
raw_call(method.to_s, @session_id, *arguments)
|
34
29
|
end
|
35
|
-
|
36
|
-
#Instanciates a rpc handler and log in to the interface to retrieve a session id
|
30
|
+
|
31
|
+
#Instanciates a rpc handler and log in to the interface to retrieve a session id
|
37
32
|
def login
|
38
33
|
@handler = XMLRPC::Client.new_from_uri(@uri)
|
39
34
|
#Get rid of SSL warnings "peer certificate won't be verified in this SSL session"
|
40
35
|
#See http://developer.amazonwebservices.com/connect/thread.jspa?threadID=37139
|
41
36
|
#and http://blog.chmouel.com/2008/03/21/ruby-xmlrpc-over-a-self-certified-ssl-with-a-warning/
|
37
|
+
#and http://stackoverflow.com/questions/4748633/how-can-i-make-rubys-xmlrpc-client-ignore-ssl-certificate-errors for ruby 1.9 (which does not set @ssl_context before a request)
|
42
38
|
if @handler.instance_variable_get('@http').use_ssl?
|
43
|
-
@handler.instance_variable_get('@http').instance_variable_get("@ssl_context")
|
39
|
+
if @handler.instance_variable_get('@http').instance_variable_get("@ssl_context") #Ruby 1.8.7
|
40
|
+
@handler.instance_variable_get('@http').instance_variable_get("@ssl_context").verify_mode = SSL_VERIFY_MODE
|
41
|
+
else
|
42
|
+
@handler.instance_variable_get('@http').instance_variable_set(:@verify_mode, SSL_VERIFY_MODE) #Ruby 1.9
|
43
|
+
end
|
44
44
|
end
|
45
45
|
@session_id = raw_call("login", @login, @password, false)
|
46
46
|
end
|
47
|
-
|
47
|
+
|
48
48
|
#Gets a new session id by switching to another handle
|
49
49
|
def su(handle)
|
50
50
|
@session_id = call("su", handle)
|
51
51
|
end
|
52
|
-
|
52
|
+
|
53
53
|
#Changes password
|
54
54
|
def password(password)
|
55
55
|
@password = password
|
56
56
|
call("password", password)
|
57
57
|
end
|
58
|
-
|
59
|
-
#Current prepaid account balance
|
58
|
+
|
59
|
+
#Current prepaid account balance
|
60
60
|
def account_balance
|
61
61
|
call('account_balance')
|
62
62
|
end
|
63
|
-
|
63
|
+
|
64
64
|
#Currency name used with the prepaid account
|
65
65
|
def account_currency
|
66
66
|
call('account_currency')
|
67
67
|
end
|
68
|
-
|
68
|
+
|
69
69
|
def self.login(login, password, uri = nil)
|
70
70
|
client = self.new(login, password, uri)
|
71
71
|
client.login
|
72
72
|
return client
|
73
73
|
end
|
74
|
-
|
74
|
+
|
75
75
|
private
|
76
|
-
|
76
|
+
|
77
77
|
#Handle RPC calls and exceptions
|
78
78
|
#A reconnection system is used to work around what seems to be a ruby bug :
|
79
79
|
#When waiting during 15 seconds between calls, a timeout is reached and the RPC handler starts throwing various exceptions
|
80
80
|
#EOFError, Errno::EPIPE, then OpenSSL::SSL::SSLError.
|
81
81
|
#When this happens, another handler and another session are created
|
82
82
|
#Exceptions are not handled if happening two times consecutively, or during a login call
|
83
|
-
#TODO: This method may be optimized by only creating another handler and keeping the session id.
|
83
|
+
#TODO: This method may be optimized by only creating another handler and keeping the session id.
|
84
84
|
#In this case a server timeout of 12 hours (see the Gandi documentation) may be reached more easily and should be handled.
|
85
85
|
def raw_call(*args)
|
86
86
|
begin
|
@@ -106,16 +106,16 @@ module Gandi
|
|
106
106
|
end
|
107
107
|
end
|
108
108
|
end
|
109
|
-
|
109
|
+
|
110
110
|
def logged_in?
|
111
111
|
@session_id.is_a? String
|
112
112
|
end
|
113
|
-
|
113
|
+
|
114
114
|
#Raises a NoMethodError exception.
|
115
115
|
#Used for methods that are presents in the API but not yet available
|
116
116
|
def not_supported
|
117
|
-
raise NoMethodError.new
|
117
|
+
raise NoMethodError.new("This method is not supported and will be available in v1.10 of the API")
|
118
118
|
end
|
119
|
-
|
119
|
+
|
120
120
|
end
|
121
121
|
end
|
data/lib/gandi/domain.rb
CHANGED
@@ -1,10 +1,9 @@
|
|
1
|
-
|
2
|
-
require
|
3
|
-
require
|
4
|
-
require
|
5
|
-
require
|
6
|
-
require
|
7
|
-
require File.join(modules_directory, 'domain_modules/mail')
|
1
|
+
require 'gandi/domain_modules/name_servers'
|
2
|
+
require 'gandi/domain_modules/host'
|
3
|
+
require 'gandi/domain_modules/redirection'
|
4
|
+
require 'gandi/domain_modules/contact'
|
5
|
+
require 'gandi/domain_modules/operations'
|
6
|
+
require 'gandi/domain_modules/mail'
|
8
7
|
|
9
8
|
module Gandi
|
10
9
|
class Domain < Gandi::Base
|
@@ -18,7 +17,7 @@ module Gandi
|
|
18
17
|
#This implementation does not respect the original API specifications and allow for a single domain to be checked.
|
19
18
|
#In this case the domain can be provided as a string and a boolean will be returned.
|
20
19
|
def domain_available(domains)
|
21
|
-
available_domains = call('domain_available', domains.
|
20
|
+
available_domains = call('domain_available', [domains].flatten)
|
22
21
|
return (domains.is_a?(String)) ? available_domains.values.first : available_domains
|
23
22
|
end
|
24
23
|
|
@@ -5,9 +5,9 @@ module Gandi
|
|
5
5
|
|
6
6
|
#Create a Gandi contact of a given type. See glossary, Account.
|
7
7
|
#Return the Gandi handle of the created contact
|
8
|
+
#Note: contact_class argument is used instead of class (due to a ruby keyword conflict)
|
8
9
|
#TODO check contact class
|
9
10
|
def contact_create(contact_class, firstname, lastname, address, zipcode, city, country, phone, email, params = {})
|
10
|
-
#Note: contact_class argument is used instead of class (due to a ruby keyword conflict)
|
11
11
|
args = [contact_class, firstname, lastname, address, zipcode, city, country, phone, email, params]
|
12
12
|
args.pop if params.empty?
|
13
13
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module Gandi
|
2
2
|
module DomainModules
|
3
3
|
module Operations
|
4
|
-
#
|
4
|
+
#Retrieve an array of the last 300 operation IDs matching the optional criterias
|
5
5
|
def operation_list(filter = {})
|
6
6
|
unless filter.empty?
|
7
7
|
call('operation_list', filter)
|
@@ -10,9 +10,9 @@ module Gandi
|
|
10
10
|
|
11
11
|
#Add a web redirection to a domain. All HTTP requests to http://fqdn/ will be redirected to 'destination_url' with a HTTP redirection 'type'
|
12
12
|
#Return the operation attributed ID
|
13
|
-
def domain_web_redir_add(
|
13
|
+
def domain_web_redir_add(fqdn, destination_url, type)
|
14
14
|
raise ArgumentError.new("Redirection type is invalid") unless DOMAIN_WEB_REDIR_REDIRECTION_TYPES.include?(type)
|
15
|
-
call('domain_web_redir_add',
|
15
|
+
call('domain_web_redir_add', fqdn, destination_url, type)
|
16
16
|
end
|
17
17
|
|
18
18
|
#Delete the web redirection of the fully qualified domain name fqdn
|
data/lib/gandi.rb
CHANGED
@@ -3,7 +3,6 @@ module Gandi
|
|
3
3
|
class ServerError < RuntimeError ; end
|
4
4
|
end
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
require
|
9
|
-
require File.join(directory, 'gandi/domain')
|
6
|
+
require 'gandi/base'
|
7
|
+
require 'gandi/domain'
|
8
|
+
require 'gandi/version'
|
data/test/gandi/domain_test.rb
CHANGED
@@ -28,11 +28,11 @@ class DomainTest < ActiveSupport::TestCase
|
|
28
28
|
end
|
29
29
|
|
30
30
|
should "return a hash when providing an array" do
|
31
|
-
assert_equal false, @gandi_domain.domain_available('testdomain.com')
|
31
|
+
assert_equal({"testdomain.com" => false}, @gandi_domain.domain_available(['testdomain.com']))
|
32
32
|
end
|
33
33
|
|
34
34
|
should "return a boolean when providing a single domain" do
|
35
|
-
assert_equal
|
35
|
+
assert_equal false, @gandi_domain.domain_available('testdomain.com')
|
36
36
|
end
|
37
37
|
end
|
38
38
|
|
@@ -206,20 +206,19 @@ class DomainTest < ActiveSupport::TestCase
|
|
206
206
|
end
|
207
207
|
|
208
208
|
should "check redirection type when adding a redirection for a domain" do
|
209
|
-
fqdn = "w3.example.net"
|
210
209
|
destination_url = "http://www.example.net"
|
211
210
|
|
212
211
|
calls = states('calls').starts_as('none')
|
213
|
-
@gandi_domain.handler.expects(:call).with("domain_web_redir_add", @session_id, @sample_domain_name,
|
214
|
-
@gandi_domain.handler.expects(:call).with("domain_web_redir_add", @session_id, @sample_domain_name,
|
215
|
-
@gandi_domain.handler.expects(:call).with("domain_web_redir_add", @session_id, @sample_domain_name,
|
212
|
+
@gandi_domain.handler.expects(:call).with("domain_web_redir_add", @session_id, @sample_domain_name, destination_url, 'http302').returns(rand(9000)).when(calls.is('none')).then(calls.is('first'))
|
213
|
+
@gandi_domain.handler.expects(:call).with("domain_web_redir_add", @session_id, @sample_domain_name, destination_url, 'http301').returns(rand(9000)).when(calls.is('first')).then(calls.is('second'))
|
214
|
+
@gandi_domain.handler.expects(:call).with("domain_web_redir_add", @session_id, @sample_domain_name, destination_url, 'cloak').returns(rand(9000)).when(calls.is('second'))
|
216
215
|
|
217
216
|
Gandi::DomainModules::Redirection::DOMAIN_WEB_REDIR_REDIRECTION_TYPES.each do |type|
|
218
|
-
assert @gandi_domain.domain_web_redir_add(@sample_domain_name,
|
217
|
+
assert @gandi_domain.domain_web_redir_add(@sample_domain_name, destination_url, type).is_a? Integer
|
219
218
|
end
|
220
219
|
|
221
220
|
assert_raise ArgumentError do
|
222
|
-
@gandi_domain.domain_web_redir_add(@sample_domain_name,
|
221
|
+
@gandi_domain.domain_web_redir_add(@sample_domain_name, destination_url, 'bad')
|
223
222
|
end
|
224
223
|
end
|
225
224
|
|
metadata
CHANGED
@@ -1,123 +1,132 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: gandirb
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
version: "1.0"
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.1
|
5
|
+
prerelease:
|
9
6
|
platform: ruby
|
10
|
-
authors:
|
7
|
+
authors:
|
11
8
|
- Pickabee
|
12
9
|
autorequire:
|
13
10
|
bindir: bin
|
14
11
|
cert_chain: []
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
12
|
+
date: 2011-12-03 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: activesupport
|
16
|
+
requirement: &71303820 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '2.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *71303820
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
requirement: &71303600 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *71303600
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rdoc
|
38
|
+
requirement: &71303310 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *71303310
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: shoulda
|
49
|
+
requirement: &71302990 !ruby/object:Gem::Requirement
|
50
|
+
none: false
|
51
|
+
requirements:
|
52
|
+
- - <
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: *71302990
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: mocha
|
60
|
+
requirement: &71302680 !ruby/object:Gem::Requirement
|
61
|
+
none: false
|
62
|
+
requirements:
|
63
|
+
- - ! '>='
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '0'
|
66
|
+
type: :development
|
67
|
+
prerelease: false
|
68
|
+
version_requirements: *71302680
|
69
|
+
description: ! " This is a ruby library for using the Gandi XML-RPC API.\n It currently
|
70
|
+
only provides methods for using the domain and mail API, but is extensible enough
|
71
|
+
to add hosting in the future.\n"
|
72
|
+
email: ''
|
22
73
|
executables: []
|
23
|
-
|
24
74
|
extensions: []
|
25
|
-
|
26
|
-
extra_rdoc_files:
|
75
|
+
extra_rdoc_files:
|
27
76
|
- CHANGELOG
|
28
77
|
- LICENSE
|
29
|
-
|
30
|
-
- lib/gandi.rb
|
31
|
-
- lib/gandi/base.rb
|
32
|
-
- lib/gandi/domain.rb
|
33
|
-
- lib/gandi/domain_modules/contact.rb
|
34
|
-
- lib/gandi/domain_modules/host.rb
|
35
|
-
- lib/gandi/domain_modules/mail.rb
|
36
|
-
- lib/gandi/domain_modules/name_servers.rb
|
37
|
-
- lib/gandi/domain_modules/operations.rb
|
38
|
-
- lib/gandi/domain_modules/redirection.rb
|
39
|
-
files:
|
78
|
+
files:
|
40
79
|
- CHANGELOG
|
41
80
|
- LICENSE
|
42
|
-
- README
|
81
|
+
- README.rdoc
|
82
|
+
- Gemfile
|
43
83
|
- Rakefile
|
44
|
-
-
|
45
|
-
- lib/gandi/base.rb
|
46
|
-
- lib/gandi/domain.rb
|
47
|
-
- lib/gandi/domain_modules/contact.rb
|
48
|
-
- lib/gandi/domain_modules/host.rb
|
84
|
+
- gandirb.gemspec
|
49
85
|
- lib/gandi/domain_modules/mail.rb
|
86
|
+
- lib/gandi/domain_modules/redirection.rb
|
87
|
+
- lib/gandi/domain_modules/contact.rb
|
50
88
|
- lib/gandi/domain_modules/name_servers.rb
|
89
|
+
- lib/gandi/domain_modules/host.rb
|
51
90
|
- lib/gandi/domain_modules/operations.rb
|
52
|
-
- lib/gandi/
|
53
|
-
-
|
54
|
-
-
|
55
|
-
-
|
56
|
-
- rdoc/classes/Gandi/Domain.html
|
57
|
-
- rdoc/classes/Gandi/DomainModules.html
|
58
|
-
- rdoc/classes/Gandi/DomainModules/Contact.html
|
59
|
-
- rdoc/classes/Gandi/DomainModules/Host.html
|
60
|
-
- rdoc/classes/Gandi/DomainModules/NameServers.html
|
61
|
-
- rdoc/classes/Gandi/DomainModules/Operations.html
|
62
|
-
- rdoc/classes/Gandi/DomainModules/Redirection.html
|
63
|
-
- rdoc/classes/Gandi/ServerError.html
|
64
|
-
- rdoc/created.rid
|
65
|
-
- rdoc/files/README.html
|
66
|
-
- rdoc/files/lib/gandi/base_rb.html
|
67
|
-
- rdoc/files/lib/gandi/domain_modules/contact_rb.html
|
68
|
-
- rdoc/files/lib/gandi/domain_modules/host_rb.html
|
69
|
-
- rdoc/files/lib/gandi/domain_modules/name_servers_rb.html
|
70
|
-
- rdoc/files/lib/gandi/domain_modules/operations_rb.html
|
71
|
-
- rdoc/files/lib/gandi/domain_modules/redirection_rb.html
|
72
|
-
- rdoc/files/lib/gandi/domain_rb.html
|
73
|
-
- rdoc/files/lib/gandi_rb.html
|
74
|
-
- rdoc/fr_class_index.html
|
75
|
-
- rdoc/fr_file_index.html
|
76
|
-
- rdoc/fr_method_index.html
|
77
|
-
- rdoc/index.html
|
78
|
-
- rdoc/rdoc-style.css
|
79
|
-
- test/gandi/base_test.rb
|
91
|
+
- lib/gandi/domain.rb
|
92
|
+
- lib/gandi/base.rb
|
93
|
+
- lib/gandi/version.rb
|
94
|
+
- lib/gandi.rb
|
80
95
|
- test/gandi/domain_test.rb
|
96
|
+
- test/gandi/base_test.rb
|
81
97
|
- test/gandi_test.rb
|
82
98
|
- test/test_helper.rb
|
83
|
-
- gandirb.gemspec
|
84
|
-
has_rdoc: true
|
85
99
|
homepage: http://github.com/pickabee/gandirb
|
86
100
|
licenses: []
|
87
|
-
|
88
101
|
post_install_message:
|
89
|
-
rdoc_options:
|
102
|
+
rdoc_options:
|
90
103
|
- --line-numbers
|
91
|
-
- --
|
104
|
+
- --charset=UTF-8
|
92
105
|
- --title
|
93
106
|
- Gandirb
|
94
107
|
- --main
|
95
|
-
- README
|
96
|
-
require_paths:
|
108
|
+
- README.rdoc
|
109
|
+
require_paths:
|
97
110
|
- lib
|
98
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
requirements:
|
107
|
-
- -
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
|
110
|
-
- 1
|
111
|
-
- 2
|
112
|
-
version: "1.2"
|
111
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
112
|
+
none: false
|
113
|
+
requirements:
|
114
|
+
- - ! '>='
|
115
|
+
- !ruby/object:Gem::Version
|
116
|
+
version: '0'
|
117
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
118
|
+
none: false
|
119
|
+
requirements:
|
120
|
+
- - ! '>='
|
121
|
+
- !ruby/object:Gem::Version
|
122
|
+
version: '0'
|
113
123
|
requirements: []
|
114
|
-
|
115
124
|
rubyforge_project: gandirb
|
116
|
-
rubygems_version: 1.
|
125
|
+
rubygems_version: 1.8.10
|
117
126
|
signing_key:
|
118
127
|
specification_version: 3
|
119
|
-
summary: Ruby library for using Gandi XML-RPC API
|
120
|
-
test_files:
|
128
|
+
summary: Ruby library for using the Gandi XML-RPC API
|
129
|
+
test_files:
|
121
130
|
- test/gandi/domain_test.rb
|
122
131
|
- test/gandi/base_test.rb
|
123
132
|
- test/gandi_test.rb
|