nonnative 1.90.1 → 1.92.0

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: 1895350170f9982d1d4ddb938f7c4aa615e7cda46149bbdbe4be6e6a5eb7411b
4
- data.tar.gz: ff3b759c80d8977c660ad21244b62f8e7c430154adf3c4bf8c48467abb769bf9
3
+ metadata.gz: 64d9a181578ae98d2c97f67833a1319cfa669adcbfa402a98851ff51db095f12
4
+ data.tar.gz: 03fa7ad8b0933577af12c2ee4f5b2516580e40faf2e1f0df57e156a0f41df68a
5
5
  SHA512:
6
- metadata.gz: 67a88409b5cc657cb9fc00b088a9f8d8bc7f19d1e643e088308eaaf306c2acf555eb24e4f5ee874d6a3f075df32f86f75ccf85db5f41742ad2d5d0017aecb50e
7
- data.tar.gz: fa4b976d140d5c87ec81a582c66b748d6f7c101547d24ef128867bfa87671bb5e1b04eefc78bef95892c9b3543647713492f96a771bde7575e2afed9f3f7d26c
6
+ metadata.gz: ed7ec7e6273effa94deb2458712a61db5706b8e2e776f77be711f086a60cf8bd2807fab9cea31fd896657082ddb84f7e8c77fd01afe63dbe053a3c15c31756f2
7
+ data.tar.gz: 81844ddca9b295a71892c7085b9d6ac27d4ab4219a978071a7ef8066d614eb9d11c387240e516cce570f594781e815e9536b49af60e1a5c6ba4c1aed6504d27a
data/.circleci/config.yml CHANGED
@@ -3,7 +3,7 @@ version: 2.1
3
3
  jobs:
4
4
  build:
5
5
  docker:
6
- - image: alexfalkowski/ruby:1.5
6
+ - image: alexfalkowski/ruby:1.6
7
7
  working_directory: ~/nonnative
8
8
  steps:
9
9
  - checkout
data/CHANGELOG.md CHANGED
@@ -6,6 +6,20 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
 
7
7
  ## Unreleased
8
8
 
9
+ ## [v1.92.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.92.0) - 2025-01-29
10
+
11
+ - [`1bd4cc2`](https://github.com/alexfalkowski/nonnative/commit/1bd4cc2b8837f9fd76680a30780ec9d5e4bfa13f) feat(proxy): add ability to reset proxies (#503)
12
+
13
+ ## [v1.91.1](https://github.com/alexfalkowski/nonnative/releases/tag/v1.91.1) - 2025-01-29
14
+
15
+ - [`4fc3075`](https://github.com/alexfalkowski/nonnative/commit/4fc30751a274e3f60a87e02ddb8a16e58eabf33e) fix(deps): bump ruby-lsp from 0.23.6 to 0.23.7 (#502)
16
+ - [`7da406c`](https://github.com/alexfalkowski/nonnative/commit/7da406cd07ea8a6a532865f2f3d542b37a9102ab) build(ci): update alexfalkowski/ruby:1.6 (#501)
17
+
18
+ ## [v1.91.0](https://github.com/alexfalkowski/nonnative/releases/tag/v1.91.0) - 2025-01-28
19
+
20
+ - [`f927b97`](https://github.com/alexfalkowski/nonnative/commit/f927b97e2b978ff08a937450c225aadbc1588230) feat(proxy): move to nonnative.rb (#500)
21
+ - [`c9edfdf`](https://github.com/alexfalkowski/nonnative/commit/c9edfdf50903b57691e9e8e1c4e004277fb15b5c) test(features): formatted (#499)
22
+
9
23
  ## [v1.90.1](https://github.com/alexfalkowski/nonnative/releases/tag/v1.90.1) - 2025-01-28
10
24
 
11
25
  - [`1125797`](https://github.com/alexfalkowski/nonnative/commit/11257970a3024bde56322891199a28a9214e3f6e) fix(proxy): handle errors for HTTPProxyApplication (#498)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nonnative (1.90.1)
4
+ nonnative (1.92.0)
5
5
  concurrent-ruby (>= 1, < 2)
6
6
  config (>= 5, < 6)
7
7
  cucumber (>= 7, < 10)
@@ -89,7 +89,7 @@ GEM
89
89
  http-cookie (1.0.8)
90
90
  domain_name (~> 0.5)
91
91
  json (2.9.1)
92
- language_server-protocol (3.17.0.3)
92
+ language_server-protocol (3.17.0.4)
93
93
  logger (1.6.5)
94
94
  mime-types (3.6.0)
95
95
  logger
@@ -161,7 +161,7 @@ GEM
161
161
  unicode-display_width (>= 2.4.0, < 4.0)
162
162
  rubocop-ast (1.37.0)
163
163
  parser (>= 3.3.1.0)
164
- ruby-lsp (0.23.6)
164
+ ruby-lsp (0.23.7)
165
165
  language_server-protocol (~> 3.17.0)
166
166
  prism (>= 1.2, < 2.0)
167
167
  rbs (>= 3, < 4)
@@ -184,7 +184,7 @@ GEM
184
184
  rack-protection (= 4.1.1)
185
185
  rack-session (>= 2.0.0, < 3)
186
186
  tilt (~> 2.0)
187
- sorbet-runtime (0.5.11781)
187
+ sorbet-runtime (0.5.11784)
188
188
  sys-uname (1.3.1)
189
189
  ffi (~> 1.1)
190
190
  tilt (2.6.0)
@@ -20,6 +20,10 @@ Before('@clear') do
20
20
  Nonnative.clear
21
21
  end
22
22
 
23
+ After('@reset') do
24
+ Nonnative.reset
25
+ end
26
+
23
27
  Given('I set the proxy for process {string} to {string}') do |name, operation|
24
28
  process = Nonnative.pool.process_by_name(name)
25
29
  process.proxy.send(operation)
@@ -89,6 +89,8 @@ module Nonnative
89
89
 
90
90
  def apply_state(state)
91
91
  mutex.synchronize do
92
+ return if @state == state
93
+
92
94
  @state = state
93
95
  close_connections
94
96
 
@@ -10,6 +10,10 @@ module Nonnative
10
10
  # Do nothing.
11
11
  end
12
12
 
13
+ def reset
14
+ # Do nothing.
15
+ end
16
+
13
17
  def host
14
18
  service.host
15
19
  end
@@ -28,6 +28,12 @@ module Nonnative
28
28
  services[runner_index(configuration.services, name)]
29
29
  end
30
30
 
31
+ def reset
32
+ services.each { |s| s.proxy.reset }
33
+ servers.each { |s| s.first.proxy.reset }
34
+ processes.each { |p| p.first.proxy.reset }
35
+ end
36
+
31
37
  private
32
38
 
33
39
  attr_reader :configuration
@@ -4,12 +4,7 @@ module Nonnative
4
4
  class ProxyFactory
5
5
  class << self
6
6
  def create(service)
7
- proxy = case service.proxy.kind
8
- when 'fault_injection'
9
- FaultInjectionProxy
10
- else
11
- NoProxy
12
- end
7
+ proxy = Nonnative.proxy(service.proxy.kind)
13
8
 
14
9
  proxy.new(service)
15
10
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Nonnative
4
- VERSION = '1.90.1'
4
+ VERSION = '1.92.0'
5
5
  end
data/lib/nonnative.rb CHANGED
@@ -64,6 +64,14 @@ module Nonnative
64
64
  Config.load_files(files)
65
65
  end
66
66
 
67
+ def configuration
68
+ @configuration ||= Nonnative::Configuration.new
69
+ end
70
+
71
+ def configure
72
+ yield configuration
73
+ end
74
+
67
75
  def log_lines(path, predicate)
68
76
  File.readlines(path).select { |l| predicate.call(l) }
69
77
  end
@@ -76,12 +84,12 @@ module Nonnative
76
84
  @observability ||= Nonnative::Observability.new(configuration.url)
77
85
  end
78
86
 
79
- def configuration
80
- @configuration ||= Nonnative::Configuration.new
87
+ def proxies
88
+ @proxies ||= { 'fault_injection' => Nonnative::FaultInjectionProxy }.freeze
81
89
  end
82
90
 
83
- def configure
84
- yield configuration
91
+ def proxy(kind)
92
+ Nonnative.proxies[kind] || Nonnative::NoProxy
85
93
  end
86
94
 
87
95
  def start
@@ -112,5 +120,9 @@ module Nonnative
112
120
  @configuration = nil
113
121
  @pool = nil
114
122
  end
123
+
124
+ def reset
125
+ Nonnative.pool.reset
126
+ end
115
127
  end
116
128
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nonnative
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.90.1
4
+ version: 1.92.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alejandro Falkowski
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-01-28 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: concurrent-ruby