by Evan

The Rubygems team is proud to announce the availability of 2.0.0.preview2. This version has been merged into ruby 2.0.0-preview2 as well, in preperation for Rubygems 2.0.0 final to be included in ruby 2.0.0 final.

Breaking changes

There are a number of changes in 2.0.0 that may break code expecting deprecated features of Rubygems. Most major libraries that use the internal Rubygems APIs have been updated, but there are bound to be a number that have not.

Deprecated Gem.unresolved_deps in favor of Gem::Specification.unresolved_deps

Merged Gem::Builder into Gem::Package. Use Gem::Package.build(spec) instead of Gem::Builder.new(spec).build

Merged Gem::Format into Gem::Package. Use Gem::Package.new instead of Gem::Format.from_file_by_path

Moved Gem::OldFormat to Gem::Package::Old. Gem::Package will automatically detect old gems for you, so there is no need to refer to it.

Removed Gem::DocManager, replaced by Gem::RDoc and done_installing hook

Removed Gem::Package::TarInput in favor of Gem::Package

Removed Gem::Package::TarOutput in favor of Gem::Package

Removed Gem::RemoteFetcher#open_uri_or_path. (steveklabnik)

Removed Gem::SSL in favor of using OpenSSL directly

Removed Gem.loaded_path

Removed RSS generation from the gem indexer

Removed benchmark option from .gemrc

Removed broken YAML gemspec support in gem build

Removed support for Ruby 1.9.1

Removed many deprecated methods

Major enhancements

As is the point of most 2.0s, Rubygems continues a number of enhancements.

Improved support for default gems shipping with ruby 2.0.0+. The default gems now are properly loaded as more important that the standard library, which was the intent.

A gem can have arbitrary metadata through Gem::Specification#metadata. This feature allows users to embed their own data inside a gem easily and retrieve it. It’s possible to use this to store information about native packages needed, commit inforation, or any other structure data.

gem search now defaults to –remote and is anchored like gem list. Fixes #166

now defaults to –remote and is anchored like gem list. Fixes #166 Added –document to replace –rdoc and –ri. Use –no-document to disable documentation, –document=rdoc to only generate rdoc.

Only ri-format documentation is generated by default with HTML being automatically generated by gem server . This will speed up install time.

. This will speed up install time. Add gemdeps file support. A gemdeps format file is a Gemfile, Isolate, or gem.deps.rb file. This files contain information about which gems and versions are needed to run a particular application. Rubygems now has a subset of functionality provided by bundler builtin to provide easy usage of these files.

Add ability to install gems directly from a compatible gemdep file (Gemfile, Isolate, gem.deps.rb) gem install --file path

Add ability to load gem activation information from a gemdeps file (Gemfile, Isolate, gem.deps.rb). Set RUBYGEMS_GEMDEPS=path to have it loaded. Use - as the path to autodetect (current and parent directories are searched).

Minor enhancements

Additionally, there are innumerable small enhancements. Here is a nice sampling.

Added –only-executables option to gem pristine . Fixes #326

. Fixes #326 Added -I flag for ‘gem query’ to exclude installed items

Added Gem.install(name, version=default) for interactive sessions

Added Gem::FilePermissionError#directory

Added Gem::rubygems_version which is like Gem::ruby_version

Added RUBYGEMS_HOST documentation to gem env

Added a post_installs hook that runs after Gem::DependencyInstaller finishes installing a set of gems

Added a usage method for Gem::Commands::OwnerCommand. (ffmike)

Added an optional type parameter to Gem::Specification#doc_dir.

Added announcements url and clarified how to file tickets

Added guidance for how to use rdoc and ri in setup command. (jjb)

Attempting to install multiple gems with –version is now an error. You can specify per-gem versions like rake:0.9.5

Clarified Gem::CommandManager example code to avoid multi load problems. (baroquebobcat)

Corrupt or bad cached specs are now re-downloaded. (cookrn)

Extension build arguments are saved from install and reused for pristine

If the OS allows it, documentation is built in a forked background process. (alexch)

Imported gem yank from the gemcutter gem. Fixes #177, #343

Packaged gems now contain and verify SHA1 checksums

Removed commas from gem update summary so you can paste it back to cleanup. (amatsuda)

RubyGems will now warn when building gems with prerelease dependencies. Fixes #255

The RUBYGEMS_HOST environment variable is used to determine appropriate API key for pushing or yanking gems

Uninstall is now performed in reverse topological order.

Users are told what to type when they try to uninstall a gem outside GEM_HOME

When building gems with non-world-readable files a warning is shown.

Bug fixes

And lastly, lots and lots of bugfixes. Here is a short memoriam of those bugs we’ve lost this release.