tcr 0.4.0 → 0.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '083e01d825d6a7807d3452e11191832b0577b30a334e22c023cd7a7d06e9eec0'
4
- data.tar.gz: 4086810e2e1bcd060f564ed19f711035ce6e489bbe1fbb520e745428a361bd1c
3
+ metadata.gz: 2218fe9a2c9cb0c2c5c9d92f1e22c0a537985d45a37ca97b25e75b132984225c
4
+ data.tar.gz: d6db4c0a7d82b531f3517f2fa47a3e12cd2f530d3442dda6cbfca0fd2b9ba50f
5
5
  SHA512:
6
- metadata.gz: 72985071944d541b1623e4593a6766fa4bf5af3a5c137bca88aee527d840c676717535eba2d5baa0727daa85d9dd74eee9040e6ca6b51937935503594aced1b5
7
- data.tar.gz: 2c7628bd3b89708ab7a55fb937696a9d932e4a4f6b4198e4ab269091d2595fa29d1c3e818457ff868ccae6dce7a52b5fb6ab8a15fa96cff0ee690a2ecba6e0af
6
+ metadata.gz: c274ad83970a61cb4c15e27d399a8d2efd099463fa2fa85b69c6b193b77f64f95d60effedb01f7c88641ac49ad24c5e3039317aec19ec874a7641f4173d8a208
7
+ data.tar.gz: 19d781dacbba3de87fe11e94d3d0598f94ee47976eef94dacb37688dfa45c3375329397076fa3ef2be327c22fdd985a29e1a5f37a245439b68be69d25d41055d
@@ -0,0 +1,10 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "bundler"
8
+ directory: "/"
9
+ schedule:
10
+ interval: "weekly"
@@ -18,7 +18,7 @@ jobs:
18
18
  - "3.1"
19
19
  - "3.2"
20
20
  steps:
21
- - uses: actions/checkout@v2
21
+ - uses: actions/checkout@v4
22
22
  - name: Set up Ruby
23
23
  uses: ruby/setup-ruby@v1
24
24
  with:
data/Gemfile CHANGED
@@ -4,5 +4,6 @@ gemspec
4
4
 
5
5
  gem "rspec"
6
6
  gem "mail"
7
+ gem "net-imap", "0.2.2"
7
8
  gem "net-ldap"
8
9
  gem "mime-types"
data/lib/tcr/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module TCR
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
data/lib/tcr.rb CHANGED
@@ -90,11 +90,11 @@ class Socket
90
90
  class << self
91
91
  alias_method :real_tcp, :tcp
92
92
 
93
- def tcp(host, port, *socket_opts)
93
+ def tcp(host, port, *local_args, **timeout_opts)
94
94
  if TCR.configuration.hook_tcp_ports.include?(port)
95
95
  TCR::RecordableTCPSocket.new(host, port, TCR.cassette)
96
96
  else
97
- real_tcp(host, port, *socket_opts)
97
+ real_tcp(host, port, *local_args, **timeout_opts)
98
98
  end
99
99
  end
100
100
  end
data/spec/tcr_spec.rb CHANGED
@@ -523,4 +523,18 @@ RSpec.describe TCR do
523
523
  end
524
524
  }.not_to raise_error
525
525
  end
526
+
527
+ context "when port is not in hook_tcp_ports" do
528
+ it "it honors Socket.tcp keyword arguments" do
529
+ TCR.configure { |c|
530
+ c.hook_tcp_ports = [8080]
531
+ c.cassette_library_dir = "."
532
+ }
533
+
534
+ TCR.use_cassette("test") do
535
+ sock = Socket.tcp("google.com", 80, connect_timeout: 1, resolv_timeout: 1)
536
+ expect(sock).to be_a(Socket)
537
+ end
538
+ end
539
+ end
526
540
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob Forman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-29 00:00:00.000000000 Z
11
+ date: 2024-11-27 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: TCR is a lightweight VCR for TCP sockets.
14
14
  email:
@@ -18,6 +18,7 @@ extensions: []
18
18
  extra_rdoc_files: []
19
19
  files:
20
20
  - ".github/CODEOWNERS"
21
+ - ".github/dependabot.yml"
21
22
  - ".github/workflows/tcr.yml"
22
23
  - ".gitignore"
23
24
  - Gemfile
@@ -63,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
64
  - !ruby/object:Gem::Version
64
65
  version: '0'
65
66
  requirements: []
66
- rubygems_version: 3.4.7
67
+ rubygems_version: 3.4.19
67
68
  signing_key:
68
69
  specification_version: 4
69
70
  summary: TCR is a lightweight VCR for TCP sockets.