resolv 0.6.2 → 0.6.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9f3223ba332f64c3b4b3af1b7044b9fb1369f6da74e05d74d4704fa5d1235d3c
4
- data.tar.gz: 205750363ae9e6014d7cf7daa1e81010525543d7178fc3258ae4eaee4b007afb
3
+ metadata.gz: b38c0a6bfbc3572750fa6aabfc908f518021868ae4fd523024e9a606a638ddd3
4
+ data.tar.gz: 915329aaefb0c6deee41e8e61ecdf261d92a13978ce52587102d81439ba32acc
5
5
  SHA512:
6
- metadata.gz: 7cb060b5cac5331a0c1a719e1c436588230636687f655487d01cbe6c028fb704e425c90b63480bd12eff8c6c798653ad593b8315a108305e91db61c69a9704e0
7
- data.tar.gz: 05d23a3d86214475e34406c614b611d5898ca66f49cebf9ff0507e0afa46acd85cab72d8b162f7a3d702bdb4c22577ee8a88bdbdefeb76bfca3757aed3b553b5
6
+ metadata.gz: 84c70f3d4dd7837793d637007603f3b9c94963cd5ffdf01aa63fb8512750b2930158a1bbc9e3875e62895ad385eb9afdaa3790b253f610bef1bfed7e14dc29f0
7
+ data.tar.gz: 7fc14713cf5fb4e92278da88e5c8c892ac7d6bcb5fd9ea69bab07346ca543eb1aa5b627fa08fe547975ad9584a444f121a1fb00c13e79fcb3ad5712b9f23b8a9
@@ -0,0 +1,4 @@
1
+ changelog:
2
+ exclude:
3
+ labels:
4
+ - dependencies # Added by Dependabot
@@ -23,20 +23,20 @@ jobs:
23
23
 
24
24
  steps:
25
25
  - name: Harden Runner
26
- uses: step-security/harden-runner@6c439dc8bdf85cadbbce9ed30d1c7b959517bc49 # v2.12.2
26
+ uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
27
27
  with:
28
28
  egress-policy: audit
29
29
 
30
- - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30
+ - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
31
31
 
32
32
  - name: Set up Ruby
33
- uses: ruby/setup-ruby@a4effe49ee8ee5b8b5091268c473a4628afb5651 # v1.245.0
33
+ uses: ruby/setup-ruby@d5126b9b3579e429dd52e51e68624dda2e05be25 # v1.267.0
34
34
  with:
35
35
  bundler-cache: true
36
36
  ruby-version: ruby
37
37
 
38
38
  - name: Publish to RubyGems
39
- uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
39
+ uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2
40
40
 
41
41
  - name: Create GitHub release
42
42
  run: |
@@ -0,0 +1,33 @@
1
+ name: Sync ruby
2
+ on:
3
+ push:
4
+ branches: [master]
5
+ jobs:
6
+ sync:
7
+ name: Sync ruby
8
+ runs-on: ubuntu-latest
9
+ if: ${{ github.repository_owner == 'ruby' }}
10
+ steps:
11
+ - uses: actions/checkout@v5
12
+
13
+ - name: Create GitHub App token
14
+ id: app-token
15
+ uses: actions/create-github-app-token@v2
16
+ with:
17
+ app-id: 2060836
18
+ private-key: ${{ secrets.RUBY_SYNC_DEFAULT_GEMS_PRIVATE_KEY }}
19
+ owner: ruby
20
+ repositories: ruby
21
+
22
+ - name: Sync to ruby/ruby
23
+ uses: convictional/trigger-workflow-and-wait@v1.6.5
24
+ with:
25
+ owner: ruby
26
+ repo: ruby
27
+ workflow_file_name: sync_default_gems.yml
28
+ github_token: ${{ steps.app-token.outputs.token }}
29
+ ref: master
30
+ client_payload: |
31
+ {"gem":"${{ github.event.repository.name }}","before":"${{ github.event.before }}","after":"${{ github.event.after }}"}
32
+ propagate_failure: true
33
+ wait_interval: 10
@@ -24,7 +24,7 @@ jobs:
24
24
  os: macos-latest
25
25
  runs-on: ${{ matrix.os }}
26
26
  steps:
27
- - uses: actions/checkout@v4
27
+ - uses: actions/checkout@v5
28
28
  - name: Set up Ruby
29
29
  uses: ruby/setup-ruby@v1
30
30
  with:
@@ -1,5 +1,5 @@
1
1
  require 'mkmf'
2
- if RUBY_ENGINE == "ruby" and have_library('iphlpapi', 'GetNetworkParams')
2
+ if RUBY_ENGINE == "ruby" and have_library('iphlpapi', 'GetNetworkParams', ['windows.h', 'iphlpapi.h'])
3
3
  create_makefile('win32/resolv')
4
4
  else
5
5
  File.write('Makefile', "all clean install:\n\t@echo Done: $(@)\n")
@@ -58,7 +58,7 @@ module Win32
58
58
  end
59
59
  end
60
60
  using SZ
61
- rescue LoadError
61
+ rescue LoadError, Gem::LoadError
62
62
  require "open3"
63
63
  end
64
64
 
@@ -82,8 +82,8 @@ module Win32
82
82
  nvdom = get_item_property(TCPIP_NT, 'NV Domain')
83
83
 
84
84
  unless nvdom.empty?
85
- @search = [ nvdom ]
86
- udmnd = get_item_property(TCPIP_NT, 'UseDomainNameDevolution').to_i
85
+ search = [ nvdom ]
86
+ udmnd = get_item_property(TCPIP_NT, 'UseDomainNameDevolution', dword: true)
87
87
  if udmnd != 0
88
88
  if /^\w+\./ =~ nvdom
89
89
  devo = $'
@@ -126,17 +126,23 @@ module Win32
126
126
  [ search.uniq, nameserver.uniq ]
127
127
  end
128
128
 
129
- def get_item_property(path, name, expand: false)
129
+ def get_item_property(path, name, expand: false, dword: false)
130
130
  if defined?(Win32::Registry)
131
- Registry::HKEY_LOCAL_MACHINE.open(path) do |reg|
132
- expand ? reg.read_s_expand(name) : reg.read_s(name)
131
+ begin
132
+ Registry::HKEY_LOCAL_MACHINE.open(path) do |reg|
133
+ if dword
134
+ reg.read_i(name)
135
+ else
136
+ expand ? reg.read_s_expand(name) : reg.read_s(name)
137
+ end
138
+ end
133
139
  rescue Registry::Error
134
- ""
140
+ dword ? 0 : ""
135
141
  end
136
142
  else
137
143
  cmd = "Get-ItemProperty -Path 'HKLM:\\#{path}' -Name '#{name}' -ErrorAction SilentlyContinue | Select-Object -ExpandProperty '#{name}'"
138
144
  output, _ = Open3.capture2('powershell', '-Command', cmd)
139
- output.strip
145
+ dword ? output.strip.to_i : output.strip
140
146
  end
141
147
  end
142
148
  end
data/lib/resolv.rb CHANGED
@@ -4,6 +4,7 @@ require 'socket'
4
4
  require 'timeout'
5
5
  require 'io/wait'
6
6
  require 'securerandom'
7
+ require 'rbconfig'
7
8
 
8
9
  # Resolv is a thread-aware DNS resolver library written in Ruby. Resolv can
9
10
  # handle multiple DNS requests concurrently without blocking the entire Ruby
@@ -33,7 +34,7 @@ require 'securerandom'
33
34
 
34
35
  class Resolv
35
36
 
36
- VERSION = "0.6.2"
37
+ VERSION = "0.6.3"
37
38
 
38
39
  ##
39
40
  # Looks up the first IP address for +name+.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resolv
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tanaka Akira
@@ -19,7 +19,9 @@ extra_rdoc_files: []
19
19
  files:
20
20
  - ".git-blame-ignore-revs"
21
21
  - ".github/dependabot.yml"
22
+ - ".github/release.yml"
22
23
  - ".github/workflows/push_gem.yml"
24
+ - ".github/workflows/sync-ruby.yml"
23
25
  - ".github/workflows/test.yml"
24
26
  - ".gitignore"
25
27
  - BSDL
@@ -55,7 +57,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
57
  - !ruby/object:Gem::Version
56
58
  version: '0'
57
59
  requirements: []
58
- rubygems_version: 3.6.7
60
+ rubygems_version: 3.6.9
59
61
  specification_version: 4
60
62
  summary: Thread-aware DNS resolver library in Ruby.
61
63
  test_files: []