
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Fustigit will let you "parse" SCP-like address triplets using Ruby's baked-in URI library (... and just a moderate amount of monkey-patching) and turn them into probably-valid URI objects.
A triplet is a format for specifying a remote resource, much like a URI. It looks like this:
# The username is optional but the hostname and pathname are not
<username>@<hostname>:<pathname>
Triplets predate the original ratification of the URI RFC, and are tricksy to parse if you're playing by URI rules since they don't define a protocol and they use a colon to separate the hostname from the pathname. scp
and git
are the two most common tools that still use triplets.
The answer is usually "Git" (but sometimes it's scp
). Git supports a conveniently inconvenient number of formats for expressing where a remote repository is located and/or what protocol should be used to connect to it. Some of them are perfectly valid URIs. Some of them are not. It's the ones that are not that may be a problem.
---
# These won't parse and they're both SUPER common
- example.com:path/to/repo.git
- git@example.com:user/project.git
# But these will parse, which is great since they're also SUPER common
- https://example.com/user/project.git
- http://example.com/user/project.git
Enter Fustigit.
Carelessly Without a care in the world!
>> URI.parse "git@github.com:mckern/fustigit.git"
URI::InvalidURIError: bad URI(is not URI?): git@github.com:mckern/fustigit.git [/some/path/for/ruby/lib/ruby/2.1.0/uri/common.rb:176:in `split']
>> require 'fustigit'
=> true
>> uri = URI.parse "git@github.com:mckern/fustigit.git"
=> #<URI::SSH:0x007f8459131f98 URL:git@github.com:mckern/fustigit.git>
>> uri.host
=> "github.com"
>> uri.user
=> "git"
>> uri.path
=> "mckern/fustigit.git"
>> uri.to_s
=> "git@github.com:mckern/fustigit.git"
>>
Careful use of Module#prepend
and Module#extend
in URI
and URI::Parser
, judicious use of regular expressions, and by defining a few new URI
subclasses: URI::Git
, URI::SSH
, URI::SCP
, and URI::RSYNC
. Some of these classes then have the Triplet
module mixed in, which helps smooth over the conversion between a valid RFC-compliant URI and an address triplet.
Addressable::URI
instead of ::URI
?Take a look at Martin Emde's Gitable, which extends Addressable::URI
with additional support for Git addresses.
In the spirit of Jordan Sissel (a hero to admins and operations people everywhere), if fustigit is not helping you parse weird Git addresses, then there is a bug in fustigit. Please open an issue or submit a pull request if something doesn't work.
Fustigate is licensed under the Apache License, Version 2.0.
"When in doubt, use brute force." ― Ken Thompson
Ryan McKern <ryan@mckern.sh>
FAQs
Unknown package
We found that pl_fustigit demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.