
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
iri
Advanced tools
The class Iri helps you build a URI and then modify its parts via a simple fluent interface:
require 'iri'
url = Iri.new('http://google.com/')
.append('find').append('me') # -> http://google.com/find/me
.with(q: 'books about OOP', limit: 50) # -> ?q=books+about+OOP&limit=50
.without(:q) # remove this query parameter
.without('limit', 'speed') # also remove these two
.over(q: 'books about tennis', limit: 10) # replace these params
.scheme('https') # replace 'http' with 'https'
.host('localhost') # replace the host name
.port('443') # replace the port
.fragment('page-4') # replaces the fragment part of the URI, after the '#'
.query('a=1&b=2') # replaces the entire query part of the URI
.path('/new/path') # replace the path of the URI, leaving the query untouched
.cut('/q') # replace everything after the host and port
.to_s # convert it to a string
See the full list of methods.
Install it:
gem install iri
Or add this to your Gemfile:
gem 'iri'
Pay attention, it is not a parser. The only functionality this gem provides is building URIs.
It is very convenient to use inside HAML, for example:
- iri = Iri.new(request.url)
%a{href: iri.over(offset: offset + 10)} Next Page
%a{href: iri.over(offset: offset - 10)} Previous Page
Of course, it's better to create the iri object only once per request
and re-use it where you need. It's immutable, so you won't have any
side-effects.
PS. See how I use it in this Sinatra web app: yegor256/0rsk.
Read these guidelines. Make sure your build is green before you contribute your pull request. You will need to have Ruby 2.3+ and Bundler installed. Then:
bundle update
bundle exec rake
If it's clean and you don't see any error messages, submit your pull request.
FAQs
Unknown package
We found that iri demonstrated a healthy version release cadence and project activity because the last version was released less than 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
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.