Skip to content

Commit

Permalink
Bump version to 3.87.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyevans committed Dec 17, 2024
1 parent fe7c699 commit 8f7a89b
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
= master
= 3.87.0 (2024-12-17)

* Add host_routing plugin for routing based on request host header (jeremyevans)

Expand Down
52 changes: 52 additions & 0 deletions doc/release_notes/3.87.0.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
= New Features

* A host_routing plugin has been added, for easier routing based on
the request host. Example:

plugin :host_routing do |hosts|
hosts.to :api, "api.example.com", "api2.example.com"
hosts.default :www
end

route do |r|
r.api do
# requests to api.example.com or api2.example.com
end

r.www do
# requests to other domains
end
end

The plugin also adds request predicate methods:

route do |r|
r.api? # true if the request is to api.example.com or api2.example.com
r.www? # true for request for other domains
end

If the :scope_predicates plugin option is given, these predicate
methods are also supported directly in block scope (no "r.").

For more advanced cases, such as prefix matches on the host, the
hosts.default method accepts a block. In this case, you should
also call hosts.register to notify the plugin about what hosts
the block could return:

plugin :host_routing do |hosts|
hosts.register :api
hosts.default :www do |host|
:api if host.end_with?(".api.example.com")
end
end

= Other Improvements

* In the custom_block_results plugin, if the block passed to
handle_block_result returns an object that is not a String,
nil, or false, Roda no longer attempts to write it to the response
body. Doing so is undesirable and would be a violation of the rack
spec.

* Minor performance improvements have been made to the header_matchers
plugin.
2 changes: 1 addition & 1 deletion lib/roda/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Roda
RodaMajorVersion = 3

# The minor version of Roda, updated for new feature releases of Roda.
RodaMinorVersion = 86
RodaMinorVersion = 87

# The patch version of Roda, updated only for bug fixes from the last
# feature release.
Expand Down

0 comments on commit 8f7a89b

Please sign in to comment.