<commit_before>= Backports Library

Would you like to use features of Ruby 1.8.7 without the need of having 1.8.7 installed? Simply

  require 'backports/1.8.7'

All 1.8.7 features are now available! Many of the features of 1.9 are also available with

  require 'backports/1.9'

Finally, some features of rails' active-support are also available with

  require 'backports/rails'
  
If you want them all:

  require 'backports'

== What's inside

All features of 1.8.7 are backported (well, almost all, see the exception list bellow).

Conditions for inclusion of ruby 1.9 and activesupport features:
1. Won't break older code
2. Simple and self-contained

For example, <tt>Module::instance_methods</tt> returns strings in 1.8 and symbols in 1.9; no change can be made without the risk of breaking existing code. Such incompatibilities between 1.8 and 1.9 methods are left unchanged.

More complex features of active-support (even things like <tt>String::pluralize</tt>), won't be included. <tt>require 'activesupport'</tt> if you need them and are not in rails!

== Installation & compatibility

+backports+ is mirrored on Rubyforge and can thus be installed with:

  sudo gem install backports

To use:

  require 'rubygems'
  require 'backports'   # or a subset like "backports/1.8.7"
  # and off you go!

Compatible with Ruby 1.8 & 1.9, jruby and rubinius.

= Complete List of backports

== Ruby 1.8.7

Complete Ruby 1.8.7 backporting (core language). Refer to the official list of changes[http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS].

Only exceptions:
* String#gsub
* GC.stress=
* Array#choice (use Array#sample instead)
* recursive data handling (Array, Hash, ...)

Libraries have not been backported. See at the end for list of known library backports

== Ruby 1.9

Additionally, the following Ruby 1.9 have been backported:

* Array
  * +try_convert+

* Enumerable
  * +each_with_object+
  * +chunk+

* Enumerator
  * +new+ (with block)

* File
  * +binread+
  * +to_path+
  * All class methods accepting filenames will accept files or anything with a #to_path method.

* Hash
  * +try_convert+
  * <tt>default_proc=</tt>

* Kernel
  * +require_relative+

* Object
  * +define_singleton_method+
  * +flat_map+, +collect_concat+
  * +public_method+
  * +public_send+
  * <tt>respond_to_missing?</tt>

* Proc
  * +yield+

* String
  * +try_convert+
  * <tt>ascii_only?</tt>
  * +chr+
  * +clear+
  * +codepoints+, +each_codepoint+

+Enumerator+ can be accessed directly (instead of <tt>Enumerable::Enumerator</tt>)<commit_msg>Fix doc<commit_after>= Backports Library

Would you like to use features of Ruby 1.8.7 without the need of having 1.8.7 installed? Simply

  require 'backports/1.8.7'

All 1.8.7 features are now available! Many of the features of 1.9 are also available with

  require 'backports/1.9'

Finally, some features of rails' active-support are also available with

  require 'backports/rails'
  
If you want them all:

  require 'backports'

== What's inside

All features of 1.8.7 are backported (well, almost all, see the exception list bellow).

Conditions for inclusion of ruby 1.9 and activesupport features:
1. Won't break older code
2. Simple and self-contained

For example, <tt>Module::instance_methods</tt> returns strings in 1.8 and symbols in 1.9; no change can be made without the risk of breaking existing code. Such incompatibilities between 1.8 and 1.9 methods are left unchanged.

More complex features of active-support (even things like <tt>String::pluralize</tt>), won't be included. <tt>require 'activesupport'</tt> if you need them and are not in rails!

== Installation & compatibility

+backports+ is mirrored on Rubyforge and can thus be installed with:

  sudo gem install backports

To use:

  require 'rubygems'
  require 'backports'   # or a subset like "backports/1.8.7"
  # and off you go!

Compatible with Ruby 1.8 & 1.9, jruby and rubinius.

= Complete List of backports

== Ruby 1.8.7

Complete Ruby 1.8.7 backporting (core language). Refer to the official list of changes[http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7/NEWS].

Only exceptions:
* String#gsub
* GC.stress=
* Array#choice (use Array#sample instead)
* recursive data handling (Array, Hash, ...)

Libraries have not been backported. See at the end for list of known library backports

== Ruby 1.9

Additionally, the following Ruby 1.9 have been backported:

* Array
  * +try_convert+

* Enumerable
  * +each_with_object+
  * +chunk+

* Enumerator
  * +new+ (with block)
  * +flat_map+, +collect_concat+

* File
  * +binread+
  * +to_path+
  * All class methods accepting filenames will accept files or anything with a #to_path method.

* Hash
  * +try_convert+
  * <tt>default_proc=</tt>

* Kernel
  * +require_relative+

* Object
  * +define_singleton_method+
  * +public_method+
  * +public_send+
  * <tt>respond_to_missing?</tt>

* Proc
  * +yield+

* String
  * +try_convert+
  * <tt>ascii_only?</tt>
  * +chr+
  * +clear+
  * +codepoints+, +each_codepoint+

+Enumerator+ can be accessed directly (instead of <tt>Enumerable::Enumerator</tt>)
{'fraction_non_alphanumeric': 0.10236220472440945, 'fraction_numerical': 0.020078740157480315, 'mean_word_length': 3.9911591355599216, 'pattern_counts': {'":': 0, '<': 31, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3158714', 'n_tokens_mistral': 1758, 'n_tokens_neox': 1665, 'n_words': 602}