Ruby Standard Library

The Ruby Standard Library is a large collection of classes and modules you can require in your code to gain additional features.

Below is an overview of the libraries and extensions, followed by a brief description of each.

Libraries

  • MakeMakefile: A module used to generate a Makefile for C extensions

  • RbConfig: Information about your Ruby configuration and build

  • Gem: A package management framework for Ruby

Extensions

  • Coverage: Provides coverage measurement for Ruby

  • Monitor: Provides a reentrant mutex

  • objspace: Extends the ObjectSpace module to add methods for internal statistics

  • PTY: Creates and manages pseudo-terminals

  • Ripper: Provides an interface for parsing Ruby programs into S-expressions

  • Socket: Accesses underlying OS socket implementations

Default gems

  • Default gems are shipped with Ruby releases and also available as rubygems.

  • Default gems are not uninstallable from the Ruby installation.

  • Default gems can be updated using rubygems.

    • e.g. gem update json

  • Default gems can be used with bundler environments like unbundled_env.

  • Default gems can be used at any version in a Gemfile.

    • e.g. gem "json", ">= 2.6"

Libraries

Extensions

Tools

  • IRB (GitHub): Interactive Ruby command-line tool for REPL (Read Eval Print Loop)

  • RDoc (GitHub): Documentation generator for Ruby

Bundled gems

  • Bundled gems are shipped with Ruby releases and also available as rubygems.

    • They are only bundled with Ruby releases.

    • They can be uninstalled from the Ruby installation.

    • They need to be declared in a Gemfile when used with bundler.

Libraries

  • minitest: A test library supporting TDD, BDD, mocking, and benchmarking

  • power_assert: Power Assert for Ruby

  • rake: Ruby build program with capabilities similar to make

  • test-unit: A compatibility layer for MiniTest

  • rexml: An XML toolkit for Ruby

  • rss: A family of libraries supporting various XML-based “feeds”

  • net-ftp: Support for the File Transfer Protocol

  • net-imap: Ruby client API for the Internet Message Access Protocol

  • net-pop: Ruby client library for POP3

  • net-smtp: Simple Mail Transfer Protocol client library for Ruby

  • matrix: Represents a mathematical matrix

  • prime: Prime numbers and factorization library

  • rbs: RBS is a language to describe the structure of Ruby programs

  • typeprof: A type analysis tool for Ruby code based on abstract interpretation

  • debug: Debugging functionality for Ruby

  • racc: A LALR(1) parser generator written in Ruby

  • mutex_m: Mixin to extend objects to be handled like a Mutex

  • getoptlong: Parse command line options similar to the GNU C getopt_long()

  • base64: Support for encoding and decoding binary data using a Base64 representation

  • bigdecimal: Provides arbitrary-precision floating point decimal arithmetic

  • observer: Provides a mechanism for the publish/subscribe pattern in Ruby

  • abbrev: Calculates a set of unique abbreviations for a given set of strings

  • resolv-replace: Replace Socket DNS with Resolv

  • rinda: The Linda distributed computing paradigm in Ruby

  • drb: Distributed object system for Ruby

  • nkf: Ruby extension for the Network Kanji Filter

  • syslog: Ruby interface for the POSIX system logging facility

  • csv: Provides an interface to read and write CSV files and data