
Security News
Astral Launches pyx: A Python-Native Package Registry
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Collection of common Sinatra extensions, semi-officially supported.
These are common extension which will not add significant overhead or change any behavior of already existing APIs. They do not add any dependencies not already installed with this gem.
Currently included:
sinatra/capture
: Let's you capture the content of blocks in templates.
sinatra/config_file
: Allows loading configuration from yaml files.
sinatra/content_for
: Adds Rails-style content_for
helpers to Haml, Erb, Erubi
and Slim.
sinatra/cookies
: A cookies
helper for reading and writing cookies.
sinatra/engine_tracking
: Adds methods like haml?
that allow helper
methods to check whether they are called from within a template.
sinatra/json
: Adds a #json
helper method to return JSON documents.
sinatra/link_header
: Helpers for generating link
HTML tags and
corresponding Link
HTTP headers. Adds link
, stylesheet
and prefetch
helper methods.
sinatra/multi_route
: Adds ability to define one route block for multiple
routes and multiple or custom HTTP verbs.
sinatra/namespace
: Adds namespace support to Sinatra.
sinatra/respond_with
: Choose action and/or template automatically
depending on the incoming request. Adds helpers respond_to
and
respond_with
.
sinatra/custom_logger
: This extension allows you to define your own
logger instance using +logger+ setting. That logger then will
be available as #logger helper method in your routes and views.
sinatra/required_params
: Ensure if required query parameters exist
These extensions may add additional dependencies and enhance the behavior of the existing APIs.
Currently included:
sinatra/reloader
: Automatically reloads Ruby files on code changes. DEPRECATED: Please consider
consider using an alternative like rerun or
rack-unreloader instead.sinatra/extension
: Mixin for writing your own Sinatra extensions.
sinatra/test_helpers
: Helper methods to ease testing your Sinatra
application. Partly extracted from Sinatra. Testing framework agnostic
sinatra/quiet_logger
: Extension to exclude specific paths from access log.
It works by patching Rack::CommonLogger
Add gem 'sinatra-contrib'
to Gemfile, then execute bundle install
.
If you don't use Bundler, install the gem manually by executing gem install sinatra-contrib
in your command line.
If you want to use the gem from git, for whatever reason, you can do the following:
github 'sinatra/sinatra' do
gem 'sinatra-contrib'
end
Within this block you can also specify other gems from this git repository.
A single extension (example: sinatra-content-for):
require 'sinatra'
require 'sinatra/content_for'
Common extensions:
require 'sinatra'
require 'sinatra/contrib'
All extensions:
require 'sinatra'
require 'sinatra/contrib/all'
A single extension (example: sinatra-content-for):
require 'sinatra/base'
require 'sinatra/content_for'
require 'sinatra/namespace'
class MyApp < Sinatra::Base
# Note: Some modules are extensions, some helpers, see the specific
# documentation or the source
helpers Sinatra::ContentFor
register Sinatra::Namespace
end
Common extensions:
require 'sinatra/base'
require 'sinatra/contrib'
class MyApp < Sinatra::Base
register Sinatra::Contrib
end
All extensions:
require 'sinatra/base'
require 'sinatra/contrib/all'
class MyApp < Sinatra::Base
register Sinatra::Contrib
end
For more info check the official docs and api docs.
FAQs
Unknown package
We found that sinatra-contrib 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
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.
Security News
The latest Opengrep releases add Apex scanning, precision rule tuning, and performance gains for open source static code analysis.