resolv 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/push_gem.yml +2 -2
- data/.github/workflows/test.yml +19 -1
- data/Gemfile +1 -0
- data/Rakefile +8 -0
- data/ext/win32/resolv/extconf.rb +1 -1
- data/lib/resolv.rb +21 -18
- metadata +6 -6
- /data/ext/win32/resolv/lib/{win32/resolv.rb → resolv.rb} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9229d4fa9f694c44c4442d65a94ee9cf0a0516cd642c34046ea1986eb3f14e47
|
4
|
+
data.tar.gz: 8d04dbe4055ac5ab5da6a71fad40235914b7931c4ef5245599f3b1cc4075c19a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 946a361ded12633ea767ffeb339c28b93bbb29efaaab1c1d6a26b30d151dea6bb10a8246f6b9fa21233f6fb6e0437e4e6a1fbab662bfe74443d24a1b3bffa0ca
|
7
|
+
data.tar.gz: 64da659522efac0f4cb19fa34c3824e86efa966c8424a90cba358b82a94738186ce51cc3c70d7d5d1a92e0212dc8b7eb6267df1603387457ab38355eec84ee8e
|
@@ -23,7 +23,7 @@ jobs:
|
|
23
23
|
|
24
24
|
steps:
|
25
25
|
- name: Harden Runner
|
26
|
-
uses: step-security/harden-runner@
|
26
|
+
uses: step-security/harden-runner@0080882f6c36860b6ba35c610c98ce87d4e2f26f # v2.10.2
|
27
27
|
with:
|
28
28
|
egress-policy: audit
|
29
29
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
36
36
|
ruby-version: ruby
|
37
37
|
|
38
38
|
- name: Publish to RubyGems
|
39
|
-
uses: rubygems/release-gem@
|
39
|
+
uses: rubygems/release-gem@9e85cb11501bebc2ae661c1500176316d3987059 # v1.1.0
|
40
40
|
|
41
41
|
- name: Create GitHub release
|
42
42
|
run: |
|
data/.github/workflows/test.yml
CHANGED
@@ -6,7 +6,7 @@ jobs:
|
|
6
6
|
ruby-versions:
|
7
7
|
uses: ruby/actions/.github/workflows/ruby_versions.yml@master
|
8
8
|
with:
|
9
|
-
engine: cruby
|
9
|
+
engine: cruby-jruby
|
10
10
|
min_version: 2.5
|
11
11
|
|
12
12
|
build:
|
@@ -32,3 +32,21 @@ jobs:
|
|
32
32
|
bundler-cache: true
|
33
33
|
- name: Run test
|
34
34
|
run: bundle exec rake test
|
35
|
+
timeout-minutes: 3
|
36
|
+
continue-on-error: ${{ startsWith(matrix.ruby, 'jruby') }}
|
37
|
+
- name: Build package
|
38
|
+
id: build
|
39
|
+
shell: bash
|
40
|
+
run: |
|
41
|
+
if ruby -e 'exit RUBY_VERSION>="3.0."'; then
|
42
|
+
bundle exec rake build
|
43
|
+
set pkg/*.gem
|
44
|
+
echo pkg=$1 >> $GITHUB_OUTPUT
|
45
|
+
fi
|
46
|
+
- name: Install gem
|
47
|
+
run: |
|
48
|
+
gem install ${{ steps.build.outputs.pkg }}
|
49
|
+
ruby -rresolv -e 'puts $LOADED_FEATURES.grep(/resolv/)'
|
50
|
+
ruby -rresolv -e 'puts Resolv::VERSION'
|
51
|
+
if: ${{ steps.build.outputs.pkg }}
|
52
|
+
continue-on-error: ${{ startsWith(matrix.ruby, 'jruby') }}
|
data/Gemfile
CHANGED
data/Rakefile
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rake/testtask"
|
3
3
|
|
4
|
+
if RUBY_ENGINE == "ruby"
|
5
|
+
require "ruby-core/extensiontask"
|
6
|
+
helper = Bundler::GemHelper.instance
|
7
|
+
extask = RubyCore::ExtensionTask.new(helper.gemspec)
|
8
|
+
task :test => :compile
|
9
|
+
end
|
10
|
+
|
4
11
|
Rake::TestTask.new(:test) do |t|
|
12
|
+
t.libs.unshift(*extask.libs) if extask
|
5
13
|
t.libs << "test/lib"
|
6
14
|
t.ruby_opts << "-rhelper"
|
7
15
|
t.test_files = FileList["test/**/test_*.rb"]
|
data/ext/win32/resolv/extconf.rb
CHANGED
data/lib/resolv.rb
CHANGED
@@ -3,11 +3,7 @@
|
|
3
3
|
require 'socket'
|
4
4
|
require 'timeout'
|
5
5
|
require 'io/wait'
|
6
|
-
|
7
|
-
begin
|
8
|
-
require 'securerandom'
|
9
|
-
rescue LoadError
|
10
|
-
end
|
6
|
+
require 'securerandom'
|
11
7
|
|
12
8
|
# Resolv is a thread-aware DNS resolver library written in Ruby. Resolv can
|
13
9
|
# handle multiple DNS requests concurrently without blocking the entire Ruby
|
@@ -37,7 +33,7 @@ end
|
|
37
33
|
|
38
34
|
class Resolv
|
39
35
|
|
40
|
-
VERSION = "0.
|
36
|
+
VERSION = "0.6.0"
|
41
37
|
|
42
38
|
##
|
43
39
|
# Looks up the first IP address for +name+.
|
@@ -83,9 +79,22 @@ class Resolv
|
|
83
79
|
|
84
80
|
##
|
85
81
|
# Creates a new Resolv using +resolvers+.
|
82
|
+
#
|
83
|
+
# If +resolvers+ is not given, a hash, or +nil+, uses a Hosts resolver and
|
84
|
+
# and a DNS resolver. If +resolvers+ is a hash, uses the hash as
|
85
|
+
# configuration for the DNS resolver.
|
86
86
|
|
87
|
-
def initialize(resolvers=nil, use_ipv6: nil)
|
88
|
-
|
87
|
+
def initialize(resolvers=(arg_not_set = true; nil), use_ipv6: (keyword_not_set = true; nil))
|
88
|
+
if !keyword_not_set && !arg_not_set
|
89
|
+
warn "Support for separate use_ipv6 keyword is deprecated, as it is ignored if an argument is provided. Do not provide a positional argument if using the use_ipv6 keyword argument.", uplevel: 1
|
90
|
+
end
|
91
|
+
|
92
|
+
@resolvers = case resolvers
|
93
|
+
when Hash, nil
|
94
|
+
[Hosts.new, DNS.new(DNS::Config.default_config_hash.merge(resolvers || {}))]
|
95
|
+
else
|
96
|
+
resolvers
|
97
|
+
end
|
89
98
|
end
|
90
99
|
|
91
100
|
##
|
@@ -615,16 +624,10 @@ class Resolv
|
|
615
624
|
}
|
616
625
|
end
|
617
626
|
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
rescue NotImplementedError
|
623
|
-
rand(arg)
|
624
|
-
end
|
625
|
-
end
|
626
|
-
else
|
627
|
-
def self.random(arg) # :nodoc:
|
627
|
+
def self.random(arg) # :nodoc:
|
628
|
+
begin
|
629
|
+
SecureRandom.random_number(arg)
|
630
|
+
rescue NotImplementedError
|
628
631
|
rand(arg)
|
629
632
|
end
|
630
633
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resolv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tanaka Akira
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Thread-aware DNS resolver library in Ruby.
|
14
14
|
email:
|
@@ -31,7 +31,7 @@ files:
|
|
31
31
|
- bin/console
|
32
32
|
- bin/setup
|
33
33
|
- ext/win32/resolv/extconf.rb
|
34
|
-
- ext/win32/resolv/lib/
|
34
|
+
- ext/win32/resolv/lib/resolv.rb
|
35
35
|
- ext/win32/resolv/resolv.c
|
36
36
|
- lib/resolv.rb
|
37
37
|
- resolv.gemspec
|
@@ -42,7 +42,7 @@ licenses:
|
|
42
42
|
metadata:
|
43
43
|
homepage_uri: https://github.com/ruby/resolv
|
44
44
|
source_code_uri: https://github.com/ruby/resolv
|
45
|
-
post_install_message:
|
45
|
+
post_install_message:
|
46
46
|
rdoc_options: []
|
47
47
|
require_paths:
|
48
48
|
- lib
|
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
58
58
|
version: '0'
|
59
59
|
requirements: []
|
60
60
|
rubygems_version: 3.5.11
|
61
|
-
signing_key:
|
61
|
+
signing_key:
|
62
62
|
specification_version: 4
|
63
63
|
summary: Thread-aware DNS resolver library in Ruby.
|
64
64
|
test_files: []
|
File without changes
|