Active Support — Utility classes and standard library extensions from Rails
Active Support is a collection of various utility classes and standard library extensions that were found useful for Rails. All these additions have hence been collected in this bundle as way to gather all that sugar that makes Ruby sweeter.
Download
The latest version of Active Support can be found at
Documentation can be found at
Installation
The preferred method of installing Active Support is through its GEM file. You’ll need to have RubyGems installed for that, though. If you have it, then use:
% [sudo] gem install activesupport-1.0.0.gem
License
Active Support is released under the MIT license.
Support
The Active Support homepage is www.rubyonrails.com. You can find the Active Support RubyForge page at rubyforge.org/projects/activesupport. And as Jim from Rake says:
Feel free to submit commits or feature requests. If you send a patch, remember to update the corresponding unit tests. If fact, I prefer new feature to be submitted in the form of new unit tests.
For other information, feel free to ask on the ruby-talk mailing list (which is mirrored to comp.lang.ruby) or contact mailto:david@loudthinking.com.
| Modules | |
|---|---|
| ActiveSupport | OrderedHash is namespaced to prevent conflicts with other implementations |
| Builder | If the Builder::XChar module is not currently defined, fail on any name clashes in standard library classes. |
| ClassInheritableAttributes | Retain for backward compatibility. Methods are now included in Class. |
| Dependencies | |
| Enumerable | |
| Inflector | The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without, and class names to foreign keys. The default inflections for pluralization, singularization, and uncountable words are kept in inflections.rb. |
| Kernel | Since Ruby is very dynamic, methods added to the ancestors of BlankSlate after BlankSlate is defined will show up in the list of available BlankSlate methods. We handle this by defining a hook in the Object and Kernel classes that will hide any method defined after BlankSlate has been loaded. |
| Test | |
| Classes | |
|---|---|
| Array | |
| BigDecimal | |
| BlankSlate | BlankSlate provides an abstract base class with no predefined methods (except for __send__ and __id__). BlankSlate is useful as a base class when writing classes that depend upon method_missing (e.g. dynamic proxies). |
| CGI | |
| Class | These class attributes behave something like the class inheritable accessors. But instead of copying the hash over at the time the subclass is first defined, the accessors simply delegate to their superclass unless they have been given a specific value. This stops the strange situation where values set after class definition don’t get applied to subclasses. |
| Date | |
| DateTime | |
| Exception | Add file-blaming to exceptions |
| FalseClass | |
| File | |
| Fixnum | Enhance the Fixnum class with a XML escaped character conversion. |
| Float | |
| Hash | |
| HashWithIndifferentAccess | This class has dubious semantics and we only have it so that people can write params[:key] instead of params[‘key’] |
| Integer | |
| Logger | Adds the ‘around_level’ method to Logger. |
| MissingSourceFile | |
| Module | Extends the module object with module and instance accessors for class attributes, just like the native attr* accessors for instance attributes. |
| NameError | Add a missing_name method to NameError instances. |
| NilClass | Extensions to nil which allow for more helpful error messages for people who are new to rails. |
| Numeric | |
| Object | Same as above, except in Object. |
| OrderedOptions | |
| Pathname | |
| Proc | |
| Range | |
| Regexp | |
| String | Enhance the String class with a XML escaped character version of to_s. |
| Symbol | |
| Time | Ruby 1.8-cvs and 1.9 define private Time#to_date |
| TimeZone | A value object representing a time zone. A time zone is simply a named offset (in seconds) from GMT. Note that two time zone objects are only equivalent if they have both the same offset, and the same name. |
| TrueClass | |
| XmlSimple | Locked down XmlSimple#xml_in_string |
<code/>and<pre/>for code samples.