transip 0.3.5 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/README.rdoc +1 -0
- data/lib/transip.rb +16 -2
- data/lib/transip/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NjcxZDVlYWExZTQ0MjA2NGZmYWNjM2QzOTkwNjg0OTgzODgzNGRiNg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NzM0ZjJlMzBjNDExYmVmMzE1ZDA1MjA0NTk1NGVkZTIwNDZmOTBlNQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGNhMDg5ZjBiZTg2ZmZjZGUzZjZiYTkxZWI4MGMxMzYwZWFhNDM5OGIxZWVl
|
10
|
+
ZDY1ZmY0YWYxZjZhYWIzZGU4NzM1YTYyZGZlOTBjMGYxMWIzN2FiNWUxMjBl
|
11
|
+
NzA1OWE1Nzk4NTg0ZDBlNDM1MGFmZWQ2NzdjYzMyMTFiNTU3MzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NGFkYTQ4NWY5Y2U5ZDg4YTQ2ODdjYjY4ZGRiNzA0NmRiZGRiMWVlYzg2YjIx
|
14
|
+
YzRlNTNlODM3Yjg5NThlNzBkZTRjMmU0MWU1NDVjZDUyNDZhMzVmY2RjMThh
|
15
|
+
MmFkMGVmYWNhMmM1YWY1MzE4YjA4YWZiMDc4ZWNjODNlN2FhYzA=
|
data/README.rdoc
CHANGED
@@ -57,6 +57,7 @@ In development you can leave out the ip. To test request use :readonly mode.
|
|
57
57
|
transip.request(:get_whois, :domain_name => 'example.com')
|
58
58
|
transip.request(:set_dns_entries, :domain_name => 'example.com', :dns_entries => [Transip::DnsEntry.new('test', 5.inutes, 'A', '74.125.77.147')])
|
59
59
|
transip.request(:register, Transip::Domain.new('example.com', nil, nil, [Transip::DnsEntry.new('test', 5.minutes, 'A', '74.125.77.147')]))
|
60
|
+
transip.request(:set_contacts, :domain_name => 'example.com', :contacts => [Transip::WhoisContact.new('type', 'first', 'middle', 'last', 'company', 'kvk', 'companyType', 'street', 'number', 'postalCode', 'city', 'phoneNumber', 'faxNumber', 'email', 'country')])
|
60
61
|
|
61
62
|
Please feel free to contribute and send me a pull request via Github!
|
62
63
|
|
data/lib/transip.rb
CHANGED
@@ -22,6 +22,7 @@ require File.expand_path '../transip/version', __FILE__
|
|
22
22
|
# transip.request(:get_info, :domain_name => 'example.com')
|
23
23
|
# transip.request(:get_whois, :domain_name => 'example.com')
|
24
24
|
# transip.request(:set_dns_entries, :domain_name => 'example.com', :dns_entries => [Transip::DnsEntry.new('test', 5.minutes, 'A', '74.125.77.147')])
|
25
|
+
# transip.request(:set_contacts, :domain_name => 'example.com', :contacts => [Transip::WhoisContact.new('type', 'first', 'middle', 'last', 'company', 'kvk', 'companyType', 'street','number','postalCode','city','phoneNumber','faxNumber','email','country')])
|
25
26
|
# transip.request(:register, Transip::Domain.new('example.com', nil, nil, [Transip::DnsEntry.new('test', 5.minutes, 'A', '74.125.77.147')]))
|
26
27
|
#
|
27
28
|
class Transip
|
@@ -60,9 +61,16 @@ class Transip
|
|
60
61
|
Gyoku.xml(self.members_to_hash)
|
61
62
|
end
|
62
63
|
|
64
|
+
def member_name_to_camel(name)
|
65
|
+
parts = name.to_s.split("_")
|
66
|
+
parts.map{|p|p.capitalize!}
|
67
|
+
parts[0].downcase!
|
68
|
+
parts.join
|
69
|
+
end
|
70
|
+
|
63
71
|
# See what happens here: http://snippets.dzone.com/posts/show/302
|
64
72
|
def members_to_hash
|
65
|
-
Hash[*members.collect {|m| [m, self.send(m)]}.flatten]
|
73
|
+
Hash[*members.collect {|m| [member_name_to_camel(m), self.send(m)]}.flatten]
|
66
74
|
end
|
67
75
|
|
68
76
|
def to_hash
|
@@ -288,7 +296,13 @@ class Transip
|
|
288
296
|
|
289
297
|
digest = Digest::SHA512.new.digest(serialized_input)
|
290
298
|
asn_header = "\x30\x51\x30\x0d\x06\x09\x60\x86\x48\x01\x65\x03\x04\x02\x03\x05\x00\x04\x40"
|
291
|
-
|
299
|
+
|
300
|
+
# convert asn_header literal to ASCII-8BIT
|
301
|
+
if RUBY_VERSION.split('.')[0] == "2"
|
302
|
+
asn = asn_header.b + digest
|
303
|
+
else
|
304
|
+
asn = asn_header + digest
|
305
|
+
end
|
292
306
|
private_key = OpenSSL::PKey::RSA.new(@key)
|
293
307
|
encrypted_asn = private_key.private_encrypt(asn)
|
294
308
|
readable_encrypted_asn = Base64.encode64(encrypted_asn)
|
data/lib/transip/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: transip
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joost Hietbrink
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-12-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: savon
|