resolver_replace 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/resolver_replace/replace.rb +4 -3
- data/resolver_replace.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0849e908711ecb60b26aa4b5212155377e1f743e
|
4
|
+
data.tar.gz: bfa98c83be0cb27851a1be0d2ff1d4103022fbba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7a8202dc08419c4c028a1b6cbee3b867a5e180346e20feb9f65722c3ec85c684e9ffb040eefadd2cf8ae1c6f77f00eda96e5d57e7f9da2b32ae0bbfa9534703f
|
7
|
+
data.tar.gz: 04d48f800cf4b2cdb57d5bdc9283e66bd3b446a785480b187c942d54b65025c7ed077a78fb77e94c564f11c865a4865550762faf00ea45513be34589d4fe05e8
|
data/CHANGELOG.md
CHANGED
@@ -8,7 +8,8 @@ class << IPSocket
|
|
8
8
|
# :startdoc:
|
9
9
|
def getaddress(host)
|
10
10
|
begin
|
11
|
-
|
11
|
+
host = ResolverReplace.getaddress(host).to_s if host and host != ""
|
12
|
+
return host
|
12
13
|
rescue ResolverReplace.error_class => e
|
13
14
|
raise SocketError, "#{e.class} #{e.message}"
|
14
15
|
end
|
@@ -20,7 +21,7 @@ class TCPSocket < IPSocket
|
|
20
21
|
alias original_resolver_initialize initialize
|
21
22
|
# :startdoc:
|
22
23
|
def initialize(host, serv, *rest)
|
23
|
-
rest[0] = IPSocket.getaddress(rest[0])
|
24
|
+
rest[0] = IPSocket.getaddress(rest[0]) if !rest.empty? and rest[0]
|
24
25
|
original_resolver_initialize(IPSocket.getaddress(host), serv, *rest)
|
25
26
|
end
|
26
27
|
end
|
@@ -48,7 +49,7 @@ class UDPSocket < IPSocket
|
|
48
49
|
if rest.length == 2
|
49
50
|
host, port = rest
|
50
51
|
begin
|
51
|
-
addrs = ResolverReplace.getaddresses(host)
|
52
|
+
addrs = (host and host != "") ? ResolverReplace.getaddresses(host) : []
|
52
53
|
rescue ResolverReplace.error_class => e
|
53
54
|
raise SocketError, "#{e.class} #{e.message}"
|
54
55
|
end
|
data/resolver_replace.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "resolver_replace"
|
7
|
-
spec.version = "0.0
|
7
|
+
spec.version = "0.1.0"
|
8
8
|
spec.authors = ["Naotoshi Seo"]
|
9
9
|
spec.email = ["sonots@gmail.com"]
|
10
10
|
spec.summary = %q{Replace the DNS resolver}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resolver_replace
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|