net-ping 2.1.0 → 2.1.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: 27c470dd18b95b9b05e68e1dd6e79da70a8c8d4eaaa28581e770fa4d0d028aca
4
- data.tar.gz: fc020ad255eb094dd057f552e67c36f83a00e87aa88e12837ceb3f2bf1c8673b
3
+ metadata.gz: 12d4bcbcdb97fb3b116be13a5bc7ad632b4efc116127d9b5859531b5605be3ae
4
+ data.tar.gz: 22603f15d676ac4e3a4137a0bdec76019b7a52b8ae5ca028b452b8760ad6bd15
5
5
  SHA512:
6
- metadata.gz: 4fc2c4d695cbdb27ddd478b92929f6f9164eb07d768b56ee8f6d69cb102ded9bfe435ff0fd389136b77a86f200440da26f6078bca87561275f881f5b5abb7c24
7
- data.tar.gz: 5c45a5a55df135b3145e6aab5b3286c27d92487e9a5ac0329ada3641659acef7a8c69a4fb8f22ac2d04b6c68627a6335fd7c9ca2c681987c35713da78472cdbe
6
+ metadata.gz: ab74625d886822f7801e5c9c6e7704664bb789f745b47a29ec54cf8e7baa4cbb1a86c332df8bc16a4757900987dc3389642c290cf4d38d98badbc1e60df7ffa1
7
+ data.tar.gz: bb55d09ac91ec4ac1e407e7050f655d7fd305f3fcab3fa2093613745509724d138b25b22282d2d00d63eb5880d50814d7bfe0ac4d9e414904fbeb2d0e2618ec5
data/CHANGES CHANGED
@@ -1,3 +1,9 @@
1
+ == 2.1.1 - 16-Aug-2026
2
+ * Fix the license format in net-ping.gemspec to use the SPDX identifier
3
+ "Artistic-2.0" [#47](https://github.com/eitoball/net-ping/pull/47).
4
+ * Exclude CLAUDE.md and docs/ from the packaged gem files
5
+ [#48](https://github.com/eitoball/net-ping/pull/48).
6
+
1
7
  == 2.1.0 - 08-Aug-2026
2
8
  * Publish platform-specific gem metadata so Linux installs cap2 and current
3
9
  Windows RubyInstaller installs win32-security for ICMP support
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- net-ping (2.1.0)
4
+ net-ping (2.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,6 +1,6 @@
1
1
  module Net
2
2
  class Ping
3
3
  # The version of the net-ping library.
4
- VERSION = '2.1.0'
4
+ VERSION = '2.1.1'
5
5
  end
6
6
  end
data/net-ping.gemspec CHANGED
@@ -3,13 +3,15 @@ require_relative "lib/net/ping/version"
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = 'net-ping'
5
5
  spec.version = Net::Ping::VERSION
6
- spec.license = 'Artistic 2.0'
6
+ spec.license = 'Artistic-2.0'
7
7
  spec.author = 'Chris Chernesky'
8
8
  spec.email = 'chris.netping@tinderglow.com'
9
9
  spec.homepage = 'https://github.com/chernesk/net-ping'
10
10
  spec.summary = 'A ping interface for Ruby.'
11
11
  spec.test_file = 'test/test_net_ping.rb'
12
- spec.files = Dir['**/*'].reject { |f| f.include?('git') || File.extname(f) == '.gem' }
12
+ spec.files = Dir['**/*'].reject do |f|
13
+ f.include?('git') || File.extname(f) == '.gem' || f == 'CLAUDE.md' || f == 'docs' || f.start_with?('docs/')
14
+ end
13
15
  spec.metadata = {
14
16
  'bug_tracker_uri' => "#{spec.homepage}/issues",
15
17
  'changelog_uri' => "#{spec.homepage}/blob/master/CHANGES",
@@ -78,6 +78,16 @@ class TestNetPingGemPackaging < Test::Unit::TestCase
78
78
  delete_files(built_gem_files)
79
79
  end
80
80
 
81
+ def test_gem_create_excludes_non_distributable_project_files_from_spec_files
82
+ load_specifications.each do |path, spec|
83
+ non_distributable = spec.files.select do |f|
84
+ f == 'CLAUDE.md' || f == 'docs' || f.start_with?('docs/')
85
+ end
86
+
87
+ assert_equal([], non_distributable, path)
88
+ end
89
+ end
90
+
81
91
  def test_gem_check_uses_fixed_expectations_instead_of_loaded_specifications
82
92
  stdout, stderr, status = run_rake('clean', 'gem:create')
83
93
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-ping
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Chernesky
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-08 00:00:00.000000000 Z
11
+ date: 2026-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-unit
@@ -80,15 +80,12 @@ extra_rdoc_files:
80
80
  files:
81
81
  - CHANGES
82
82
  - CHANGES.out_of_date
83
- - CLAUDE.md
84
83
  - Gemfile
85
84
  - Gemfile.lock
86
85
  - MANIFEST
87
86
  - README.md
88
87
  - Rakefile
89
88
  - doc/ping.txt
90
- - docs/superpowers/plans/2026-07-25-platform-specific-gems.md
91
- - docs/superpowers/specs/2026-07-25-platform-specific-gems-design.md
92
89
  - examples/example_pingexternal.rb
93
90
  - examples/example_pinghttp.rb
94
91
  - examples/example_pingtcp.rb
@@ -115,7 +112,7 @@ files:
115
112
  - test/test_net_ping_wmi.rb
116
113
  homepage: https://github.com/chernesk/net-ping
117
114
  licenses:
118
- - Artistic 2.0
115
+ - Artistic-2.0
119
116
  metadata:
120
117
  bug_tracker_uri: https://github.com/chernesk/net-ping/issues
121
118
  changelog_uri: https://github.com/chernesk/net-ping/blob/master/CHANGES
data/CLAUDE.md DELETED
@@ -1,89 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Development commands
6
-
7
- Install dependencies:
8
-
9
- ```sh
10
- bundle install
11
- ```
12
-
13
- Run the default suite:
14
-
15
- ```sh
16
- bundle exec rake test
17
- ```
18
-
19
- Run one protocol-specific test file through its Rake task:
20
-
21
- ```sh
22
- bundle exec rake test:tcp
23
- bundle exec rake test:http
24
- bundle exec rake test:udp
25
- bundle exec rake test:external
26
- bundle exec rake test:icmp
27
- bundle exec rake test:wmi
28
- ```
29
-
30
- There is no lint task or linter configuration. Build the gem with
31
- `bundle exec rake gem:create`; `bundle exec rake gem:install` builds and
32
- installs it locally.
33
-
34
- `test:icmp` requires elevated privileges: root or `net_raw` capability on
35
- Unix (checked via the `cap2` gem, falling back to a root check if `cap2`
36
- isn't available), or elevated security on Windows (via `win32-security`).
37
- The aggregate `test` task (`test/test_net_ping.rb`) only requires the ICMP
38
- test file when that privilege check passes. External-ping tests invoke the
39
- system `ping` command; HTTP tests use FakeWeb/webmock except the timeout
40
- case, which makes a real network connection.
41
-
42
- CI (`.github/workflows/test.yml`) runs `bundle exec rake test` on
43
- ubuntu-latest and windows-latest across Ruby 2.7-3.4.
44
-
45
- ## Architecture
46
-
47
- This is a Ruby gem that exposes `Net::Ping` implementations for several
48
- reachability mechanisms:
49
-
50
- - `lib/net/ping/ping.rb` defines the abstract `Net::Ping` base class and its
51
- shared state: `host`, `port`, `timeout`, `exception`, `warning`, and
52
- `duration`.
53
- - `lib/net/ping/{tcp,udp,icmp,external,http}.rb` implement socket, raw ICMP,
54
- system-command, and HTTP pings. `wmi.rb` is loaded only on Windows
55
- (`File::ALT_SEPARATOR` check).
56
- - `lib/net/ping.rb` is the all-in-one entry point (`require 'net/ping'`);
57
- requiring a protocol file directly (e.g. `require 'net/ping/tcp'`) loads
58
- only that implementation and reduces memory footprint.
59
- - Each protocol has a matching `test/test_net_ping_<protocol>.rb` file. The
60
- aggregate `test/test_net_ping.rb` requires the supported protocol suites
61
- based on the platform/privilege checks described above.
62
-
63
- ## Repository-specific conventions
64
-
65
- - A subclass `ping` method calls `super(host)` first. The base implementation
66
- validates that a host is present and resets `@exception`, `@warning`, and
67
- `@duration` for each attempt.
68
- - `ping` returns a truthy success value or `false`; callers inspect
69
- `exception` after failures rather than receive connection errors. Set
70
- `duration` only after a successful ping and leave it `nil` on failure.
71
- `ping?` is the boolean wrapper supplied by the base class (or an explicit
72
- alias in `External`).
73
- - TCP and UDP treat connection refusal according to their class-level
74
- `service_check` setting (aliased as `econnrefused`/`ecr`). Keep the
75
- Boolean-only setter validation and test both modes when changing that
76
- behavior.
77
- - Preserve platform branches: `External` maps `ping`/`ping6` options to each
78
- OS's `ping`/`ping6` syntax (Linux, AIX, BSD/macOS, Solaris, HP-UX, Windows),
79
- ICMP requires raw-socket privileges, and WMI is Windows-only.
80
- - HTTP tests stub requests with FakeWeb/webmock and reset proxy environment
81
- variables in `setup`; register any new HTTP cases rather than making
82
- ordinary tests depend on live services.
83
-
84
- ## Repository layout notes
85
-
86
- - `.worktrees/` contains git worktrees for in-progress branches; treat them
87
- as separate checkouts, not part of the main tree.
88
- - `docs/superpowers/` holds plan/spec documents from prior sessions using the
89
- `superpowers` skill set — reference material, not source.
@@ -1,317 +0,0 @@
1
- # Platform-specific Gem Dependencies Implementation Plan
2
-
3
- > **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
4
-
5
- **Goal:** Build and validate RubyGems artifacts that install `cap2` on Linux and `win32-security` on current Windows RubyInstaller systems.
6
-
7
- **Architecture:** Keep `net-ping.gemspec` OS-independent and create two small gemspec overlays for Linux and `mingw-ucrt`. Centralize artifact generation and metadata validation in the Rake gem namespace, then run that validation in the existing Linux/Windows CI matrix.
8
-
9
- **Tech Stack:** Ruby, RubyGems (`Gem::Specification`, `Gem::Package`, `Gem::Platform`), Rake, test-unit, GitHub Actions.
10
-
11
- ## Global Constraints
12
-
13
- - Produce exactly three same-version `net-ping` gems: `ruby`, `universal-linux`, and `universal-mingw-ucrt`.
14
- - `universal-linux` must add `cap2 (>= 0.2.2)`; `universal-mingw-ucrt` must add `win32-security (>= 0.2.0)`.
15
- - The Ruby gem must not contain either OS-specific runtime dependency.
16
- - Support `mingw-ucrt` only; legacy `mingw32` is out of scope.
17
- - CI builds and validates artifacts but never publishes them.
18
- - Do not create git commits for this work.
19
-
20
- ---
21
-
22
- ## File Structure
23
-
24
- | File | Responsibility |
25
- | --- | --- |
26
- | `net-ping.gemspec` | Define the OS-independent Ruby artifact and common metadata. |
27
- | `net-ping-universal-linux.gemspec` | Overlay `universal-linux` and the `cap2` runtime dependency. |
28
- | `net-ping-universal-mingw-ucrt.gemspec` | Overlay `universal-mingw-ucrt` and the `win32-security` runtime dependency. |
29
- | `Rakefile` | Build, inspect, and locally install the platform-appropriate artifact. |
30
- | `test/test_net_ping_gem_packaging.rb` | Build temporary artifacts and assert their platform/dependency metadata. |
31
- | `test/test_net_ping.rb` | Load the packaging test in the aggregate suite. |
32
- | `.github/workflows/test.yml` | Run gem artifact checks on Linux and Windows. |
33
- | `README.md` | Explain automatic platform-specific dependency installation. |
34
- | `CHANGES` | Record the metadata correction for the next release. |
35
-
36
- ### Task 1: Define and test platform gem specifications
37
-
38
- **Files:**
39
- - Create: `net-ping-universal-linux.gemspec`
40
- - Create: `net-ping-universal-mingw-ucrt.gemspec`
41
- - Create: `test/test_net_ping_gem_packaging.rb`
42
- - Modify: `net-ping.gemspec:1-40`
43
- - Modify: `test/test_net_ping.rb`
44
-
45
- **Interfaces:**
46
- - Consumes: `net-ping.gemspec`, which supplies the shared `Gem::Specification`.
47
- - Produces: three loadable gemspecs whose `platform` and `runtime_dependencies` describe their target platform.
48
-
49
- - [ ] **Step 1: Write the failing package-metadata test**
50
-
51
- Create `test/test_net_ping_gem_packaging.rb`. Load every gemspec before building any artifact so `spec.files` cannot include an artifact created for an earlier specification. Build the loaded specifications into temporary `.gem` files, open each using `Gem::Package`, and assert the platform and runtime dependencies:
52
-
53
- ```ruby
54
- require 'rubygems/package'
55
- require 'test/unit'
56
-
57
- class TestNetPingGemPackaging < Test::Unit::TestCase
58
- EXPECTATIONS = {
59
- 'net-ping.gemspec' => ['ruby', {}],
60
- 'net-ping-universal-linux.gemspec' => ['universal-linux', {'cap2' => '>= 0.2.2'}],
61
- 'net-ping-universal-mingw-ucrt.gemspec' => [
62
- 'universal-mingw-ucrt',
63
- {'win32-security' => '>= 0.2.0'}
64
- ]
65
- }.freeze
66
-
67
- def setup
68
- @specifications = EXPECTATIONS.keys.map do |path|
69
- [path, Gem::Specification.load(path)]
70
- end
71
- @gem_files = @specifications.map { |_, spec| Gem::Package.build(spec) }
72
- end
73
-
74
- def teardown
75
- @gem_files.each { |path| File.delete(path) if File.exist?(path) }
76
- end
77
-
78
- def test_platforms_and_runtime_dependencies
79
- @specifications.each do |path, spec|
80
- expected_platform, expected_dependencies = EXPECTATIONS.fetch(path)
81
- packaged_spec = Gem::Package.new(spec.file_name).spec
82
- dependencies = packaged_spec.runtime_dependencies.to_h do |dependency|
83
- [dependency.name, dependency.requirement.to_s]
84
- end
85
-
86
- assert_equal(expected_platform, packaged_spec.platform.to_s, path)
87
- assert_equal(expected_dependencies, dependencies, path)
88
- end
89
- end
90
- end
91
- ```
92
-
93
- Add `require 'test_net_ping_gem_packaging'` to `test/test_net_ping.rb`.
94
-
95
- - [ ] **Step 2: Run the new test to verify it fails**
96
-
97
- Run:
98
-
99
- ```sh
100
- bundle exec ruby -Itest test/test_net_ping_gem_packaging.rb
101
- ```
102
-
103
- Expected: failure because the Linux and Windows overlay gemspec files do not exist.
104
-
105
- - [ ] **Step 3: Make the base gemspec OS-independent and add overlays**
106
-
107
- Remove the `File::ALT_SEPARATOR`, `RbConfig`, and `RUBY_PLATFORM` conditional runtime dependency logic from `net-ping.gemspec`; leave only shared metadata and development dependencies.
108
-
109
- Create `net-ping-universal-linux.gemspec`:
110
-
111
- ```ruby
112
- spec = Gem::Specification.load('net-ping.gemspec')
113
- spec.platform = Gem::Platform.new(['universal', 'linux'])
114
- spec.add_dependency('cap2', '>= 0.2.2')
115
- spec
116
- ```
117
-
118
- Create `net-ping-universal-mingw-ucrt.gemspec`:
119
-
120
- ```ruby
121
- spec = Gem::Specification.load('net-ping.gemspec')
122
- spec.platform = Gem::Platform.new(['universal', 'mingw-ucrt'])
123
- spec.add_dependency('win32-security', '>= 0.2.0')
124
- spec
125
- ```
126
-
127
- Use the project’s existing block-style `Gem::Specification.new` format for the base gemspec. Verify the installed RubyGems version accepts the two platform strings with `Gem::Platform.new`.
128
-
129
- - [ ] **Step 4: Run the package-metadata test to verify it passes**
130
-
131
- Run:
132
-
133
- ```sh
134
- bundle exec ruby -Itest test/test_net_ping_gem_packaging.rb
135
- ```
136
-
137
- Expected: PASS; all three artifacts have the expected platform and exactly the expected runtime dependencies.
138
-
139
- - [ ] **Step 5: Run the aggregate test suite**
140
-
141
- Run:
142
-
143
- ```sh
144
- bundle exec rake test
145
- ```
146
-
147
- Expected: PASS.
148
-
149
- ### Task 2: Make Rake build, validate, and install platform artifacts deterministically
150
-
151
- **Files:**
152
- - Modify: `Rakefile:6-29`
153
-
154
- **Interfaces:**
155
- - Consumes: the three gemspec paths from Task 1.
156
- - Produces: `gem:create` builds all artifacts; `gem:check` aborts on invalid artifact metadata; `gem:install` installs the local platform’s specific artifact or the Ruby fallback.
157
-
158
- - [ ] **Step 1: Add a failing artifact-validation command**
159
-
160
- Add `gem:check` to the `gem` namespace. It must load the three expected gem files with `Gem::Package`, map each runtime dependency to `name => requirement.to_s`, and abort if the platform or dependency hash differs from:
161
-
162
- ```ruby
163
- {
164
- 'ruby' => {},
165
- 'universal-linux' => {'cap2' => '>= 0.2.2'},
166
- 'universal-mingw-ucrt' => {'win32-security' => '>= 0.2.0'}
167
- }
168
- ```
169
-
170
- Run it before changing `gem:create`:
171
-
172
- ```sh
173
- bundle exec rake clean gem:create gem:check
174
- ```
175
-
176
- Expected: FAIL because `gem:create` still builds only one artifact.
177
-
178
- - [ ] **Step 2: Implement deterministic specification loading and artifact creation**
179
-
180
- Define the shared list once in `Rakefile`:
181
-
182
- ```ruby
183
- GEMSPEC_FILES = %w[
184
- net-ping.gemspec
185
- net-ping-universal-linux.gemspec
186
- net-ping-universal-mingw-ucrt.gemspec
187
- ].freeze
188
- ```
189
-
190
- Update `gem:create` to load all files before it builds any artifact:
191
-
192
- ```ruby
193
- specifications = GEMSPEC_FILES.map { |path| Gem::Specification.load(path) }
194
- specifications.each { |spec| Gem::Package.build(spec) }
195
- ```
196
-
197
- Retain the existing RubyGems pre-2.0 builder branch if support for it is still required. In either branch, load every specification before beginning the build loop.
198
-
199
- Implement `gem:check` using `Gem::Package.new(file).spec`; use `abort` with the artifact filename and expected/actual values when a check fails.
200
-
201
- Update `gem:install` to load the same specification list and select:
202
-
203
- ```ruby
204
- specific = specifications.find do |spec|
205
- spec.platform != Gem::Platform::RUBY && Gem::Platform.installable?(spec)
206
- end
207
- spec = specific || specifications.find { |item| item.platform == Gem::Platform::RUBY }
208
- ```
209
-
210
- Install `spec.file_name`, not `Dir['*.gem'].first`; abort when no Ruby fallback specification is found.
211
-
212
- - [ ] **Step 3: Run artifact validation to verify it passes**
213
-
214
- Run:
215
-
216
- ```sh
217
- bundle exec rake gem:create gem:check
218
- ```
219
-
220
- Expected: PASS and creation of `net-ping-<version>.gem`,
221
- `net-ping-<version>-universal-linux.gem`, and
222
- `net-ping-<version>-universal-mingw-ucrt.gem`.
223
-
224
- - [ ] **Step 4: Verify local artifact selection**
225
-
226
- Run:
227
-
228
- ```sh
229
- bundle exec rake gem:install
230
- gem specification net-ping platform
231
- ```
232
-
233
- Expected on Linux: `universal-linux`; on Windows: `universal-mingw-ucrt`; on
234
- other platforms: `ruby`.
235
-
236
- - [ ] **Step 5: Re-run tests**
237
-
238
- Run:
239
-
240
- ```sh
241
- bundle exec rake test
242
- ```
243
-
244
- Expected: PASS.
245
-
246
- ### Task 3: Enforce packaging in CI and document the behavior
247
-
248
- **Files:**
249
- - Modify: `.github/workflows/test.yml:19-28`
250
- - Modify: `README.md:4-15`
251
- - Modify: `CHANGES:1-13`
252
-
253
- **Interfaces:**
254
- - Consumes: `gem:create` and `gem:check` from Task 2.
255
- - Produces: CI verification on both matrix operating systems and accurate end-user dependency documentation.
256
-
257
- - [ ] **Step 1: Add the CI packaging verification step**
258
-
259
- After the existing `bundle exec rake test` step, add:
260
-
261
- ```yaml
262
- - run: bundle exec rake gem:create gem:check
263
- ```
264
-
265
- Do not add RubyGems credentials, publishing actions, or tag triggers.
266
-
267
- - [ ] **Step 2: Document platform-specific dependency resolution**
268
-
269
- Replace the prerequisite list’s unconditional `win32-security (MS Windows
270
- only)` wording with text that states RubyGems installs `win32-security` from
271
- the Windows artifact and `cap2` from the Linux artifact when installing
272
- `net-ping`. Keep the installation command `gem install net-ping`.
273
-
274
- At the beginning of `CHANGES`, add:
275
-
276
- ```text
277
- == Next Release
278
- * Publish platform-specific gem metadata so Linux installs cap2 and current
279
- Windows RubyInstaller installs win32-security for ICMP support.
280
- ```
281
-
282
- - [ ] **Step 3: Run targeted packaging and full test verification**
283
-
284
- Run:
285
-
286
- ```sh
287
- bundle exec rake gem:create gem:check
288
- bundle exec rake test
289
- ```
290
-
291
- Expected: both commands PASS.
292
-
293
- - [ ] **Step 4: Inspect the final diff without committing**
294
-
295
- Run:
296
-
297
- ```sh
298
- git diff --check
299
- git diff -- net-ping.gemspec net-ping-universal-linux.gemspec \
300
- net-ping-universal-mingw-ucrt.gemspec Rakefile \
301
- test/test_net_ping_gem_packaging.rb test/test_net_ping.rb \
302
- .github/workflows/test.yml README.md CHANGES
303
- ```
304
-
305
- Expected: only the planned packaging, CI, test, and documentation changes;
306
- no whitespace errors and no git commit.
307
-
308
- ## Plan Self-Review
309
-
310
- - **Spec coverage:** Task 1 creates the three required artifacts and assigns
311
- their dependencies; Task 2 validates metadata and selects a local artifact;
312
- Task 3 runs validation in CI and documents the behavior. CI publishing,
313
- legacy `mingw32`, and runtime protocol changes are excluded.
314
- - **Placeholder scan:** No unresolved item, unspecified test, or ambiguous
315
- implementation step remains.
316
- - **Consistency:** The gemspec filenames, platform names, dependency
317
- versions, and Rake task names are identical across all tasks.
@@ -1,71 +0,0 @@
1
- # Platform-specific gem dependencies
2
-
3
- ## Goal
4
-
5
- Resolve issue #31 by publishing platform-specific `net-ping` gems whose
6
- runtime dependencies accurately describe the requirements for ICMP support.
7
- The solution also corrects the equivalent Linux `cap2` metadata omission.
8
-
9
- ## Scope
10
-
11
- The release produces three gems with the same name and version:
12
-
13
- | Gem platform | Additional runtime dependency |
14
- | --- | --- |
15
- | `ruby` | None |
16
- | `universal-linux` | `cap2 (>= 0.2.2)` |
17
- | `universal-mingw-ucrt` | `win32-security (>= 0.2.0)` |
18
-
19
- Only the current RubyInstaller `mingw-ucrt` platform is supported for Windows.
20
- Legacy `mingw32` is out of scope.
21
-
22
- The CI workflow builds and validates these gems, but does not publish them.
23
- The existing release process remains responsible for pushing all three files
24
- to RubyGems.
25
-
26
- ## Design
27
-
28
- `net-ping.gemspec` becomes the OS-independent Ruby gemspec. It must not
29
- inspect the host OS or add OS-specific runtime dependencies.
30
-
31
- `net-ping-universal-linux.gemspec` loads the base specification, changes its
32
- platform to `universal-linux`, and adds `cap2`. The platform is intentionally
33
- CPU-independent so RubyGems can select it for supported Linux CPU variants.
34
-
35
- `net-ping-universal-mingw-ucrt.gemspec` loads the same base specification,
36
- changes its platform to `universal-mingw-ucrt`, and adds `win32-security`.
37
-
38
- The Rake gem namespace explicitly enumerates the three gemspecs. `gem:create`
39
- cleans old gem artifacts and builds all three. `gem:install` selects the
40
- specific generated specification compatible with the local platform, falling
41
- back to the Ruby specification when no platform-specific specification
42
- matches, then installs its artifact.
43
-
44
- ## Verification
45
-
46
- Add `gem:check`, which reads each generated gem through RubyGems and fails
47
- when its platform or runtime dependencies differ from this specification:
48
-
49
- - Ruby gem: platform `ruby`; neither `cap2` nor `win32-security`.
50
- - Linux gem: platform `universal-linux`; includes `cap2`.
51
- - Windows gem: platform `universal-mingw-ucrt`; includes `win32-security`.
52
-
53
- The existing GitHub Actions matrix continues to run the test suite. It also
54
- runs `gem:create` and `gem:check` on both Ubuntu and Windows. A missing,
55
- malformed, or incorrectly attributed dependency causes the job to fail.
56
-
57
- ## Documentation
58
-
59
- Update the prerequisite/install documentation to state that RubyGems chooses
60
- the platform-specific package and installs the Linux or Windows ICMP
61
- dependency automatically.
62
-
63
- Add a `CHANGES` entry describing the corrected platform-specific dependency
64
- metadata.
65
-
66
- ## Non-goals
67
-
68
- - Publishing gems from CI.
69
- - Supporting legacy `mingw32`.
70
- - Changing ICMP runtime behavior.
71
- - Altering non-ICMP protocol implementations or tests.