Skip to content

Refresh parsed SCP options when the URI query changes - #92

Open
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/uri-query-options
Open

Refresh parsed SCP options when the URI query changes#92
OskarEichler wants to merge 1 commit into
net-ssh:masterfrom
OskarEichler:codex/uri-query-options

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Handle valueless query entries and empty separators without crashing, and refresh parsed options after query changes while retaining the same options hash when the query is unchanged.

Reproduction and evidence

Standalone local reproduction:

require 'uri/scp'
u = URI.parse('scp://host/file?flag&&port=22')
p u.options # before: NoMethodError; after: {flag: [], port: 22}
u.query = 'port=2222'
p u.options # now reflects port 2222

500 model variations cover integer/string/list values, valueless entries, redundant separators, query replacement/removal and mutations to the exposed options hash while the query remains unchanged.

Compatibility / breaking changes

A valueless option follows the existing empty-value representation ([]); numeric/list conversion rules are retained. After a query change, options now reflect that query instead of stale cached values. This does not start applying URI query options to SSH connections or alter percent-decoding rules.

Verification and limits

  • This focused branch passes the existing upstream suite: 36 tests / 70 assertions, Ruby 4.0.6, net-ssh 7.3.3, test-unit 3.7.8 and Mocha 2.1.0; all Ruby commands used rbenv.
  • The combined release-based consumer candidate passes the suite with frozen string literals enabled, 10 focused cases, 2,906 model assertions, 24 URI-component assertions and 19 local scp/URI assertions. Combined evidence includes other separately proposed fixes and existing upstream frozen-string corrections; it is not attributed to this patch alone.
  • No repository tests added/modified under the consuming project's explicit no-new-tests policy. Reproductions/models ran externally. No deployed servers, SSH connections or production data were used.
  • All seven runtime files parse with the Ruby 2.6 parser; actual older-Ruby/Windows/remote-server matrices were not run locally. No upstream lint config exists; targeted lint has the same eight pre-existing warnings, with no new warnings.
  • Existing upstream PRs/issues and contribution guidance were checked. Maintainer CI results are pending; no CI pass is claimed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant