Sinatra 1.0 Frequently Asked Questions

Sinatra is going 1.0. Here are some things you should know:

Is Sinatra 1.0 a rewrite / major conceptual overhaul?

No. Sinatra 1.0 is very much the same codebase as the current stable 0.9 release (0.9.6). The largest changes are internal - we’re dropping the backward compatibility module and test suite that’s been maintained since the 0.3 release. The majority of obsoleted features are simple class/method name changes that have been documented for some time. Very few features have been removed in their entirety.

Some new features have been introduced.

Will my existing Sinatra app work with 1.0? How can I check?

Maybe.

If you’ve kept up with deprecations and use officially documented features, your app should be fine under Sinatra 1.0.

The latest Sinatra 0.9.x release (0.9.6 at time of writing) includes comprehensive deprecation warnings for all incompatibilities introduced in Sinatra 1.0. Run your test suite and app under 0.9.6 and watch for warnings on standard error. When no more deprecation warnings remain, upgrade your staging environment to Sinatra 1.0 and verify that stuff works.

Can I install and run under Sinatra 1.0 today?

YES! Install the latest 1.0 release with:

gem install sinatra

Alternatively, you can grab a clone of the master branch:

git clone git://github.com/sinatra/sinatra.git
RUBYLIB="$(pwd)/sinatra/lib:$RUBYLIB"

What incompatibilities are being introduced in Sinatra 1.0?

The following is a comprehensive list of features obsoleted in the 1.0 release. All of these have been deprecated for some time:

What about new features?

See the CHANGES file for a list of features added in the 1.0 release. There’s also a comprehensive diff of all changes between the 0.9.x and 1.0 releases.

Lastly, the 1.0 Lighthouse milestone page includes 80 tickets with details on various features and bug fixes.

How will versions be handled in the 1.x series?

We’ve adopted the Semantic Versioning Model. All 1.x releases will be backward compatible with the initial 1.0 release.

(This is one of the reasons we’ve waited so long to do an official 1.0 release. We’re required not to break anything shipped in 1.0 for a very long time, so interfaces we don’t like require considerable scrutiny.)

Will the 0.9.x series continue to be maintained?

Yes. There will be additional Sinatra 0.9.x releases for security issues or major defects. No new features will be added to the 0.9.x series.

The 0.9.x series will be maintained for as long as people use it.

How can I pin my app to 0.9.x to avoid upgrading to 1.0?

You shouldn’t have to do anything if you bundle/vendor sinatra with your app. Just make sure you’re pulling from the 0.9.x branch or vendoring an 0.9.x gem.

If you use Rubygems, there’s a very real possibility that Sinatra will be upgraded to 1.0 on your system. You can force your apps to use an 0.9.x version with:

gem 'sinatra', '< 1.0'
Fork me on GitHub