
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.
Ducklink is a super-simple way of centrally managing the format of URLs which should be used for links to other sites. Quack.
Given a URL, Ducklink will extract the host and try to match against one of its configured formats.
If nothing matches, the URL is returned untouched. If a match is found, then the URL returned will be based on the format together with any run-time parameters you passed in.
Ducklink::Decorator.configure do
host 'www.example.com' do
format '{{url}}?extra=params&added=here'
end
end
Ducklink.decorate 'http://www.example.com/some/path'
=> http://www.example.com/some/path?extra=params&added=here
Ducklink::Decorator.configure do
host 'www.example.com' do
format 'http://affiliate.example.com?clickref=42&url={{url}}'
end
end
Ducklink.decorate 'http://www.example.com/some/path'
=> http://affiliate.example.com?clickref=42&url=http://www.example.com/some/path
If you need to, you can URLEncode the target URL explicitly:
Ducklink::Decorator.configure do
host 'www.example.com' do
format 'http://affiliate.example.com?clickref=42&url={{url}}'
set :url, CGI::escape(self[:url])
end
end
Ducklink.decorate 'http://www.example.com/some/path'
=> http://affiliate.example.com?clickref=42&url=http%3A%2F%2Fwww.example.com%2Fsome%2Fpath
Ducklink::Decorator.configure do
host 'www.example.com' do |context|
format 'http://affiliate.example.com?clickref={{reference}}&url={{url}}'
set :reference, context[:reference]
end
end
Ducklink.decorate 'http://www.example.com/some/path', :reference => 100
=> http://affiliate.example.com?clickref=100&url=http://www.example.com/some/path
Ducklink::Decorator.configure do
group do
format 'http://affiliate.example.com?clickref={{reference}}&url={{url}}#campaign={{campaign}}'
host 'buy.example.com', 'shop.example.com' do |context|
set :campaign, 'campaign1'
set :reference, context[:reference]
end
host 'another.com' do |context|
set :campaign, 'campaign2'
set :reference, context[:reference]
end
end
end
Ducklink.decorate 'http://shop.example.com/goodies', :reference => 100
=> http://affiliate.example.com?clickref=100&url=http://shop.example.com/goodies#campaign=campaign1
Ducklink is released under the MIT Licence.
Copyright © 2011 Henry Garner
FAQs
Unknown package
We found that ducklink demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.