Commit Graph

1943 Commits

Author SHA1 Message Date
Mikhail Dieterle
5d27338ab0 make Hash#extract! more symmetric with Hash#slice 2012-10-08 01:20:36 +03:00
Jeremy Kemper
b9999c58c2 Ruby 2 compat. Hash[] now raises on bad elements rather than ignoring them. No sense over-testing this MRI-specific behavior. See ruby/ruby@8d6add973e 2012-10-06 20:57:22 -07:00
Michael Koziarski
0a507925cf Merge pull request #6952 from NZKoz/key_generator
Add ActiveSupport::KeyGenerator as a simple wrapper around PBKDF2
2012-10-02 14:26:16 -07:00
Nihad Abbasov
ae9b3d7cec remove unnecessary object/conversions file 2012-10-02 13:37:25 +05:00
Arun Agrawal
21051676fc warning fixed: (...) interpreted as grouped expression 2012-10-01 18:25:19 +05:30
Brian Durand
b784900208 fix broken cache tests 2012-09-30 21:56:47 -07:00
Michael Koziarski
def2ccb8e3 Add ActiveSupport::KeyGenerator as a simple wrapper around PBKDF2
This will be used to derive keys from the secret and a salt, in order to allow us to
do things like encrypted cookie stores without using the secret for multiple
purposes directly.
2012-10-01 14:22:19 +13:00
Steve Klabnik
7f1eef9b01 Fix other assertions that were backwards.
This time I used ack.
2012-09-30 12:37:59 -07:00
Steve Klabnik
06d173b382 fix order of assertions. 2012-09-30 11:08:11 -07:00
Brian Durand
e3a746b6fc Optimize ActiveSupport::Cache::Entry to reduce memory and processing overhead. 2012-09-30 09:26:04 -07:00
Wojciech Wnętrzak
b4006db471 Changed test names to match proper context 2012-09-28 22:58:27 +02:00
Andy Lindeman
ba34110677 ConstantLookup is not needed in every TestCase decendant 2012-09-26 23:21:52 -04:00
Jeremy Kemper
86ebe0bd36 Tests tag the Rails log with the current test class and test case 2012-09-26 11:17:02 -07:00
Jeremy Kemper
107fd8788f Allow wrapping a logger that hasn't set a formatter. Default to our SimpleFormatter. Otherwise we try extending nil with the tagging API. 2012-09-26 11:17:02 -07:00
Jeremy Kemper
d36f57f430 Add logger.push_tags and .pop_tags to complement logger.tagged 2012-09-26 10:16:40 -07:00
Mike Moore
b13400086c Add missing inflector dependency 2012-09-25 15:40:00 -06:00
Mike Moore
52db1f9148 Add register_spec_type test coverage 2012-09-24 14:24:08 -06:00
Mike Moore
4894eef448 Create ActiveSupport::Testing::ConstantLookup
AS::TC::ConstantLookup walks the test's name to find the constant it is describing.
This additional lookup logic is needed to better support minitest's spec DSL.
2012-09-24 13:44:49 -06:00
José Corcuera Z
c60e19bc6d Remove .rb from require sentences 2012-09-21 16:57:15 -05:00
Jeremy Kemper
0a7b1319d3 Merge pull request #7613 from marcandre/delegate_to_class
Nice and easy delegation to the class
2012-09-20 11:19:47 -07:00
kennyj
105cb3d9e3 Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and %::z format strings. 2012-09-20 00:51:28 +09:00
Jeremy Kemper
aebbd4bb4d No need to defensively work jobs in another thread 2012-09-18 15:22:24 -07:00
gregolsen
da26dfbefd Date.beginning_of_week thread local and beginning_of_week application config option added (default is Monday) 2012-09-18 17:18:19 +03:00
kennyj
87321488da Remove unncessary code. 2012-09-17 21:33:43 +09:00
Jeremy Kemper
b881be7331 Always run jobs using a consumer, even in synchronous & test queues, to ensure shared behavior. 2012-09-16 22:37:47 -07:00
Larry Lv
1efe30ebce set up config_accessor with a default value by block
* ActiveSupport::Configurable should allow config_accessor to take
  default value by block, just like cattr_accessor.

    class User
      include ActiveSupport::Configurable
      config_accessor :hair_colors do
        [:brown, :black, :blonde, :red]
      end
    end

    User.hair_colors # => [:brown, :black, :blonde, :red]

* remove trailing whitespaces in configurable.rb and its test file.

* Update ActiveSupport CHANGELOG.
2012-09-17 09:14:21 +08:00
Santiago Pastorino
8577687fcb Move queue classes to ActiveSupport 2012-09-14 14:10:00 -07:00
Pranas Kiziela
54575d8797 Allow passing block to deep_merge and deep_merge!
Hash#merge accepts block that you can use to customize how hash values
are merged. This change makes merge and deep_merge compatible.
2012-09-13 23:01:18 +03:00
Piotr Niełacny
71993c6f97 Change ActiveSupport::Deprecation to class.
ActiveSupport::Deprecation is now a class rather than a module. You can
get instance of ActiveSupport::Deprecation calling #instance method.

  ActiveSupport::Deprecation.instance

But when you need to get new object od ActiveSupport::Deprecation you
need to just call #new.

  @instance = ActiveSupport::Deprecation.new

Since you can create a new object, you can change the version and the
name of the library where the deprecator concerned.

  ActiveSupport::Deprecation.new('2.0', 'MyGem')

If you need use another deprecator instance you can select it in the
options of deprecate method.

  deprecate :method, :deprecator => deprecator_instance

Documentation has been updated.
2012-09-13 08:42:00 +02:00
Robert Pankowecki
2c690a0f5b extend ActiveSupport::Deprecation with self, allow other objects to extend/include it also.
test local deprecation

deprecator object

Test ActiveSupport::Deprecation when included
2012-09-13 08:42:00 +02:00
Marc-Andre Lafortune
ad5f18e6e9 Nice and easy delegation to the class 2012-09-11 23:05:19 -04:00
Kalys Osmonov
6b2a24c3bd &#39 dates back to SGML when &#x27 was introduced in HTML 4.0 2012-09-09 19:48:32 +06:00
Carlos Antonio da Silva
f24a5517e9 Fix AS tests due to builder change with nil values / empty strings
Check 0180e090ab6cbe66f7b521a0c03e278a0463accd for more reasoning about
that.
2012-09-07 13:37:04 -03:00
Leo Cassarani
edab820d9e Extend HashWithIndifferentAccess#update to take an optional block
When a block is passed into the method, it will be invoked for each
duplicated key, with the key in question and the two values as
arguments. The value for the duplicated key in the receiver will
be set to the return value of the block.

This behaviour matches Ruby's long-standing implementation of
Hash#update and is intended to provide a more consistent interface.

HashWithIndifferentAccess#merge is also affected by the change, as it
uses #update internally.
2012-09-05 00:59:29 +01:00
Xavier Noria
b33700f558 detect circular constant autoloading
Nowadays circular autoloads do not work, but the user gets a NameError
that says some constant is undefined. That's puzzling, because he is
normally trying to autoload a constant he knows can be autoloaded.
With this check we can give a better error message.
2012-08-28 20:34:39 +02:00
Rafael Mendonça França
a1d18ed9cf Merge pull request #7029 from panthomakos/date-and-time
Refactored common date and time calculations.
2012-08-25 18:26:07 -07:00
Francesco Rodriguez
cc14a3b2c1 Fix ActiveSupport tests that depend on run order 2012-08-23 16:00:58 -05:00
José Valim
891043d5d0 Revert "Use join without default separator"
This reverts commit b0ab8dc0b2b0f580ffe5ac9ff57fd13152e18577
because it was removing the contents of the message when we
did not have any tag. A test case is also committed.
2012-08-23 11:01:55 -03:00
Aaron Patterson
6a79aa7f81 skip the memcache tests if the memcache server is not up 2012-08-22 15:42:48 -07:00
Xavier Noria
8b16ff64f2 revises a brittle test in Active Support
The revised test assumed that the default permissions of a file
matched the umask of the process, but in the general case that
depends also on the file system. This test was failing in the
/vagrant shared folder of Rails development boxes.
2012-08-22 23:10:33 +02:00
José Valim
a1687e48cb Make ActiveSupport::Autoload local
Previously, ActiveSupport::Autoload was global and reserved
for usage inside Rails. This pull request makes it local,
fixes its test (they were not being run because its file
was named wrongly) and make it part of Rails public API.
2012-08-21 14:46:12 -03:00
Guillermo Iguaran
bd680e3f5f Add test to cover increment/decrement of non-existing key in MemCacheStore 2012-08-17 22:22:55 -05:00
Guillermo Iguaran
82663306f4 Replace deprecated memcache-client gem with dalli in ActiveSupport::Cache::MemCacheStore
memcache-client was deprecated in favour of dalli in 2010.
2012-08-17 22:22:55 -05:00
Eric Saxby
6fe36ba585 Evented notifications take priority over Timed notifications
In cases where a notification subscriber includes methods to support
both Evented and Timed events, Evented should take priority over Timed.
This allows subscribers to be backwards compatible (older Rails only
allows Timed events) while defaulting to newer behavior.
2012-08-11 17:39:20 -07:00
Carlos Antonio da Silva
47b4d13c8d Ensure I18n format values always have precedence over defaults
Always merge I18n format values, namespaced or not, over the default
ones, to ensure I18n format defaults will have precedence over our
namespaced values.

Precedence should happen like this:

    default :format
    default :namespace :format
    i18n    :format
    i18n    :namespace :format

Because we cannot allow our namespaced default to override a I18n
:format config - ie precision in I18n :format should always have higher
precedence than our default precision for a particular :namespace.

Also simplify default format options logic.
2012-08-11 00:20:19 -03:00
Carlos Antonio da Silva
a9dccda936 Fallback to :en locale instead of handling a constant with defaults
Action Pack already comes with a default locale fine for :en, that is
always loaded. We can just fallback to this locale for defaults, if
values for the current locale cannot be found.

Closes #4420, #2802, #2890.
2012-08-11 00:20:19 -03:00
Erich Menge
83f2ffcf43 Deprecate ActiveSupport::JSON::Variable
Reason: ActiveSupport::JSON::Variable is not used anymore internally. It
was deprecated in 3-2-stable but we reverted all the deprecation for
point releases.

See #6536 and #6546.
Conflicts:
	activesupport/lib/active_support/json/variable.rb
2012-08-07 19:36:08 -03:00
Xavier Noria
2f58795e78 defines String#indent [closes #7263] [Xavier Noria & Ace Suares] 2012-08-07 16:57:28 +02:00
Rafael Mendonça França
bf39026d56 Merge pull request #7272 from lexmag/string_inquirer
Add AS::StringInquirer#respond_to? method
2012-08-06 09:24:37 -07:00
Aleksey Magusev
a1beec1de0 Add AS::StringInquirer#respond_to? method
Consistently with #method_missing
2012-08-06 16:59:12 +04:00
Xavier Noria
447b6a4e67 removes usage of Object#in? from the code base (the method remains defined by Active Support)
Selecting which key extensions to include in active_support/rails
made apparent the systematic usage of Object#in? in the code base.
After some discussion in

    5ea6b0df9a

we decided to remove it and use plain Ruby, which seems enough
for this particular idiom.

In this commit the refactor has been made case by case. Sometimes
include? is the natural alternative, others a simple || is the
way you actually spell the condition in your head, others a case
statement seems more appropriate. I have chosen the one I liked
the most in each case.
2012-08-06 00:30:02 +02:00
Pan Thomakos
b530fd1083 Refactored common date and time calculations.
* Added the `DateAndTime::Calculations` module that is included in Time
  and Date. It houses common calculations to reduce duplicated code.
* Simplified and cleaned-up the calculation code.
* Removed duplication in tests by adding a behavior module for shared
  tests. I also added some missing tests.
2012-08-04 16:13:03 -07:00
Santiago Pastorino
b6ab441772 html_escape should escape single quotes
https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content
Closes #7215
2012-07-31 22:26:52 -03:00
David Celis
7db0b073fe Make ActiveSupport::Inflector locale aware and multilingual
The Inflector is currently not very supportive of internationalized
websites. If a user wants to singularize and/or pluralize words based on
any locale other than English, they must define each case in locale
files. Rather than create large locale files with mappings between
singular and plural words, why not allow the Inflector to accept a
locale?

This patch makes ActiveSupport::Inflector locale aware and uses `:en`` unless
otherwise specified. Users will still be provided a list of English (:en)
inflections, but they may additionally define inflection rules for other
locales. Each list is kept separately and permanently. There is no reason to
limit users to one list of inflections:

    ActiveSupport::Inflector.inflections(:es) do |inflect|
      inflect.plural(/$/, 's')
      inflect.plural(/([^aeéiou])$/i, '\1es')
      inflect.plural(/([aeiou]s)$/i, '\1')
      inflect.plural(/z$/i, 'ces')
      inflect.plural(/á([sn])$/i, 'a\1es')
      inflect.plural(/é([sn])$/i, 'e\1es')
      inflect.plural(/í([sn])$/i, 'i\1es')
      inflect.plural(/ó([sn])$/i, 'o\1es')
      inflect.plural(/ú([sn])$/i, 'u\1es')

      inflect.singular(/s$/, '')
      inflect.singular(/es$/, '')

      inflect.irregular('el', 'los')
    end

    'ley'.pluralize(:es)   # => "leyes"
    'ley'.pluralize(:en)   # => "leys"
    'avión'.pluralize(:es) # => "aviones"
    'avión'.pluralize(:en) # => "avións"

A multilingual Inflector should be of use to anybody that is tasked with
internationalizing their Rails application.

Signed-off-by: David Celis <david@davidcelis.com>
2012-07-30 21:49:18 -07:00
John Firebaugh
e11348063b Don't test language-level exception messages
Ruby implementations should be free to produce exception
messages that are not identical to MRI. For example,
Rubinius produces 'Expected an even number, got 5'.
2012-07-27 12:51:12 -07:00
David Heinemeier Hansson
04998cd0c9 Add Object#try! with the old NoMethodError raising behavior 2012-07-27 12:33:02 -05:00
David Heinemeier Hansson
99ea1a875b will now return nil instead of raise a NoMethodError if the receiving object does not implement the method 2012-07-27 12:22:38 -05:00
Aaron Patterson
e482100d6e Revert "Merge pull request #7084 from LTe/logger_default_separator"
This reverts commit c08f30ff5fcda7e07cd9275a073acb2091e4b3f7, reversing
changes made to e243a8a32eb4c8777f07ca4b974bd7e38d9477d3.
2012-07-18 13:32:21 -07:00
Piotr Niełacny
dc97a9a9dd Don't use default separator
When the default separator is set logger will create incorrect output
2012-07-18 09:44:45 +02:00
kennyj
414008f98e Fix class_eval without __FILE__ and __LINE__. 2012-07-18 01:16:55 +09:00
Aaron Patterson
b7a4fe18f2 remove duplicate requires of mocha.
Mocha is already required by AS::TestCase, so remove the duplicate
requires.
2012-07-03 14:28:29 -07:00
Andrew White
822c858a1a Improve performance of DateTime#seconds_since_unix_epoch
Calculate the seconds since the UNIX epoch using the difference in
Julian day numbers from the epoch date. By reducing the Rational math
to just the offset component this gives a significant improvement.

Benchmark:

Calculating --------------------------------------------
       new     27733 i/100ms
   current     15031 i/100ms
       new     27737 i/100ms
   current     15549 i/100ms
--------------------------------------------------------
       new   548182.1 (±0.9%) i/s - 2745567 in 5.008943s
   current   216380.9 (±1.6%) i/s - 1082232 in 5.002781s
       new   510281.9 (±1.2%) i/s - 2551804 in 5.001525s
   current   219858.3 (±1.8%) i/s - 1103979 in 5.023039s
2012-07-02 07:05:17 +01:00
Andrew White
98b46bf5e2 Make Time#change work with offsets other than UTC or local
Use Time.new to create times where the current offset is not zero or
not in the local time zone - closes #4847 and #6651.
2012-07-01 09:11:21 +01:00
Carlos Antonio da Silva
33192cfa07 Fix failing test in file update checker
Introduced in 1abe31670fdad2c357b4356b40a4567a46d16693

The test was failing when running on isolation, because the extensions were
not being loaded, thus 1.year.from_now was failing. Just use mktime
instead, adding 1 year to Time.now.
2012-06-29 15:08:08 -03:00
abonec
20519efa6e fix FileUpdateChecker when file has wrong mtime (from future) 2012-06-29 19:43:33 +04:00
Carlos Antonio da Silva
60571b8539 Ensure Array#to_sentence does not modify given hash
Also simplify I18n logic for Array#to_sentence, doing only one lookup
for all keys and using merge!, instead of one lookup for each option key.
2012-06-26 22:05:56 -03:00
Carlos Antonio da Silva
d6aea126de Get rid of the clear_i18n hack by using a different locale
Use a different and very specific locale for testing currency negative
format, and an empty store for currency defaults.
2012-06-24 19:30:06 -03:00
Carlos Antonio da Silva
dc766c9e7b Move number helper i18n related tests to AS
They also make more sense here since all the related logic with I18n is
handled by AS::NumberHelper, and not by AV anymore.
2012-06-24 19:30:06 -03:00
Godfrey Chan
fe933be5e2 Adds missing inflector tests to ensure idempotency
This is a follow up to #4719. It appears that singularize and pluralize
are supposed to be idempotent - i.e. when you call singularize or
pluralize multiple times on the same string, you should get the same
result. (At least for the "officially supported" cases that the stock
inflector is designed to handle.) #4719 added the missing tests for
regular cases, and this commit added the missing tests for the
irregularities.

While I'm at that, I also synced up the irregularity test cases with
the current set of irregularity cases that we ship out-of-the-box.
2012-06-21 02:16:48 -07:00
paranoiase Kang
2773257ac6 Add prev_quarter and next_quarter method in Time/Date/DateTime 2012-06-20 11:39:11 -03:00
Mike Gehard
db03f13255 Remove extra test case.
Make the test description better reflect what is happening
2012-06-19 11:56:16 -06:00
Chris Zetter
8c07696f47 Fix lookup on HashWithIndifferentAccess for array values. 2012-06-18 21:49:43 -03:00
タコ焼き仮面
c6d86a5db4 make events not use date and time to determine parent_of. fixes #5932 2012-06-18 16:34:23 -07:00
Aaron Patterson
56a1bb2f10 raise the same exception in order to keep path info
Ruby 2.0.0 implements LoadError#path, but newly raised load errors will
not contain the path information.  Replace the error message, copy
blame, and rereaise the same exception object
2012-06-12 16:19:51 -07:00
Akira Matsuda
fa2af42cdb Proc always respond_to :binding 2012-06-12 01:43:28 +09:00
Xavier Noria
d3a99c32d1 removes the obsolete require_association method from dependencies
This is an obsolete method from the very early days,
apparently it was used circa 2004 because STI support
was not smart enough. This method is not public
interface, and we are heading a major version, so
removal seems right.
2012-06-10 00:38:40 +02:00
Andrew White
870310db6a Eliminate dependency on Rails::VERSION::STRING
To facilitate the use of ActiveSupport::Testing::Performance outside
of a Rails application conditionally check for the presence of
Rails::VERSION::STRING before including it in the environment string.
2012-06-05 20:43:41 +01:00
Francesco Rodriguez
5e1d40f773 add instance_accessor option to ActiveSupport::Configurable#config_accessor
Changes:

* Add `instance_accessor` option to opt out of the instance writer and
  instance reader methods.
* Raises a NameError if the name of the attribute is not valid.
* Update documentation and tests.
* Add CHANGELOG entry in activesupport.
2012-06-05 10:50:48 -05:00
Andrew White
67b94799c2 Reduce warning messages when running Active Support tests
Eliminate the warnings generated by redefining methods and constants.
2012-05-31 17:18:25 +01:00
Piotr Sarnacki
aab0d4e2c6 Merge pull request #6554 from erichmenge/remove-json-variable
Remove deprecated ActiveSupport::JSON::Variable.
2012-05-30 13:04:33 -07:00
Erich Menge
1f5dddcf2f Remove deprecated ActiveSupport::JSON::Variable. 2012-05-30 14:39:00 -05:00
Rafael Mendonça França
d5025f15d8 Merge pull request #6541 from tjouan/tj/activesupport-fix-tests-requiring-unsafe-umask
Make  tests pass with umask
2012-05-30 12:15:21 -07:00
Erich Menge
1e335ad138 True, False, and Nil should be represented in as_json as themselves. 2012-05-29 21:13:03 -05:00
Thibault Jouan
7b6bf02303 Make File#atomic_write tests pass with umask
Assertions on file permissions only pass with some combinations of
file create mode and the process file mode creation mask. This mask
should be applied on the file create mode before related assertions.
2012-05-29 21:01:03 +00:00
Arun Agrawal
3335cb7f12 JRuby return different Array for module contents.
Test was failing against JRuby. 

It loads like [Constant3 Constant1]
2012-05-29 17:30:12 +05:30
José Valim
6ba93ac6f6 Merge pull request #6525 from freerange/minitest-passthrough-exceptions
Exceptions like Interrupt & NoMemoryError should not be rescued in tests.
2012-05-29 01:35:40 -07:00
Andrew Mutz
598f8bdda1 decoupling activesupport performance testing from actionview and adding tests 2012-05-28 21:09:20 -07:00
James Mead
b057fab638 Exceptions like Interrupt should not be rescued.
Neither Test::Unit nor MiniTest rescue exceptions like Interrupt or
NoMemoryError, but ActiveSupport::Testing::SetupAndTeardown#run which
overrides MiniTest::Unit::TestCase#run rescues them.

Rescuing an Interrupt exception is annoying, because it means when you
are running a lot of tests e.g. when running one of the rake test tasks,
you cannot break out using ctrl-C.

Rescuing exceptions like NoMemoryError is foolish, because the most
sensible thing to happen is for the process to terminate as soon as
possible.

This solution probably needs some finessing e.g. I'm not clear whether
the assumption is that only MiniTest is supported. Also early versions
of MiniTest did not have this behaviour. However, hopefully it's a
start.

Integrating with Test::Unit & MiniTest has always been a pain. It would
be great if both of them provided sensible extension points for the kind
of things that both Rails and Mocha want to do.
2012-05-28 22:44:28 +01:00
Jared Beck
371508c240 Fix handling of negative zero in number_to_currency 2012-05-28 04:42:53 -04:00
Andrew Mutz
155cd5e6b5 Moving NumberHelpers from ActionView to ActiveSupport 2012-05-27 18:14:21 -07:00
Li Ellis Gallardo
38813da6dc Truncate now has the ability to receive a html option that allows it to call rails helpers.
This way if my text is long I don't have to do something like this:

.text
= truncate(@text, :length => 27)

 if @text.size >= 27
    = link_to "continue", notes_path, ....."")
2012-05-26 10:24:17 -05:00
Alexey Vakhov
b4167d3f3e Fix Range#sum optimized version
At 1bd4d1c67459a91415ee73a8f55d2309c0d62a87 was added Range#sum
optimized version for arithmetic progressions. This improvment injected
a defect with not integer range boundaries. The defect was fixed by
e0adfa82c05f9c975005f102b4bcaebfcd17d241. The second commit really
disabled optimization at all because in Ruby integer-valued numbers are
instances of Fixnum and Bignum classes. We should #use is_a?
(#kind_of?) method instead #instance_of? to check if value is numerical:

    1.class                 # => Fixnum
    1.instance_of?(Integer) # => false
    1.is_a?(Integer)        # => true

    -100_000_000_000.class                 # => Bignum
    -100_000_000_000.instance_of?(Integer) # => false
    -100_000_000_000.is_a?(Integer)        # => true

Moreover original implementation of Range#sum has a defect with reverse
range boundaries. If the first boundary is less than the second range is
empty. Current commit fixes and tests this case too.
2012-05-25 17:46:53 +04:00
Carlos Antonio da Silva
317f49493a Add missing requires for deep_dup and hash ext test 2012-05-24 19:18:28 -03:00
Rafael Mendonça França
b0ebdf3e74 Use deep_dup in the deep_transform_keys tests.
Using only dup make some tests to not catch up an implementation error
because the methods were changing the nested hashes.

Related to:
541429fbe4 (L1R96)
2012-05-24 18:13:52 -03:00
Mark McSpadden
2b5b60fc3c Add Hash#deep_transform_keys and Hash#deep_transform_keys! Also convert deep_*_keys to use deep_transform_keys. 2012-05-23 13:11:06 -05:00
Lucas Húngaro
a4bb195c91 Adding deep versions of stringify_keys and symbolize_keys (plain and bang) for nested hashes 2012-05-23 11:56:10 -03:00
Mark McSpadden
6ff887321b Add Hash#transform_keys and Hash#transform_keys! and refactor *_keys methods to use them. 2012-05-23 09:08:04 -05:00
Angelo capilleri
5646d65d01 changed xml type datetime to dateTime, fixes #6328
XmlMini define the xml 'datatime', but according to
http://www.w3.org/TR/xmlschema-2/#dateTime could be better
change this to 'dateTime' with upper case letter 'T.
So 'DateTime' and 'Time' are redefined from 'datetime' to 'dateTime'

add the changing to the changelog
2012-05-23 14:45:56 +02:00
Michael Koziarski
e44009aa2b Merge pull request #5125 from winston/log_exception_when_cache_read_fails
#read_entry in ActiveSupport::Cache::FileStore should log details of the exception when an exception is thrown
2012-05-21 19:02:48 -07:00
Alexey Vakhov
e4569b50d1 Add instance_accessor option to class_attribute 2012-05-22 00:28:34 +04:00
kennyj
e5e2ba14c3 Don't use assert_block method. It will be deprecated. 2012-05-20 00:14:40 +09:00
Andrew White
3d0e4895cd Handle case where ancestor is not the end of the chain 2012-05-19 15:47:35 +01:00
Marc-Andre Lafortune
eb09411460 Fix constantize so top level constants are looked up properly. 2012-05-19 15:47:35 +01:00
Marc-Andre Lafortune
99e9a733c8 Make constantize look down the ancestor chain (excluding Object) 2012-05-19 15:47:35 +01:00
Jeremy Kemper
98657ad10c Merge pull request #6376 from jgaskins/timestamp-microseconds
Increase numeric-timestamp precision to nanoseconds
2012-05-18 17:30:35 -07:00
Jamie Gaskins
900dbc54f1 Increase AR#cache_key precision to nanoseconds 2012-05-19 08:20:08 +08:00
Jeremy Kemper
40bdf553a0 Merge pull request #6183 from nashby/fix-issue-6179
wrap time ranges with timezones
2012-05-18 14:10:25 -07:00
kennyj
5c02e305fe Fix warning: possibly useless use of % in void context 2012-05-19 05:32:43 +09:00
Vasiliy Ermolovich
3b1c30c99f doesn't modify params in SafeBuffer#% 2012-05-18 18:30:48 +03:00
Vasiliy Ermolovich + Sergey Nartimov
dcdde7da48 respect nsec in TimeWithZone
when we pass fractional usec to Time methods we should use Rational
instead of Float because of accuracy problem

    Time.local(2011,6,12,23,59,59,999999.999).nsec
    # => 999999998

    Time.local(2011,6,12,23,59,59,Rational(999999999, 1000)).nsec
    # => 999999999
2012-05-18 13:07:52 +03:00
José Valim
6950d74e18 Merge pull request #6361 from markmcspadden/issue_6265
Remove special cases for duplicable? on Class and Module
2012-05-17 00:07:10 -07:00
Mark McSpadden
2f06d5842b Remove special cases for duplicable? on Class and Module 2012-05-17 03:00:31 -04:00
José Valim
313f292e27 Ensure blocks given to subscriber are properly yield 2012-05-17 08:52:40 +02:00
Vasiliy Ermolovich
e2e513621d wrap time ranges with timezones, closes #6179 2012-05-17 08:24:42 +03:00
Anuj Dutta
bc51ad957a Fix an issue with inflection where my_analyses (in plular form) incorrectly converted to my_analyasis(in singular form). 2012-05-16 22:58:03 +01:00
Vasiliy Ermolovich
9fb21e98e2 fix safe string interpolation with SafeBuffer#%, closes #6352 2012-05-16 21:05:26 +03:00
Aaron Patterson
1c3e5bee3d Merge pull request #5571 from jarkko/5559-fix-dst-jump-bug-on-master
[#5559] Do not black out the system timezone DST jump hour if Time.zone ...
2012-05-15 08:24:25 -07:00
Vasiliy Ermolovich
a1f695287b remove useless tests for Range#step 2012-05-13 20:10:31 +03:00
Santiago Pastorino
1c481be331 Remove blockless_step leave all that up to Ruby
Closes #6297
2012-05-13 13:44:39 -03:00
Vijay Dev
70237e7dd3 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	activesupport/lib/active_support/callbacks.rb
2012-05-12 19:10:49 +05:30
Vasiliy Ermolovich
b8f394f4a3 Object#try can't call private methods 2012-05-12 14:07:21 +03:00
Santiago Pastorino
36dd1857dc Remove useless load path modifications 2012-05-11 19:00:35 -03:00
Edward Tsech
21190f37f8 Test Hash#except can receive more than one argument. 2012-05-11 14:09:55 +02:00
Edward Tsech
1065ef8fd3 Fix copypaste. [ci skip] 2012-05-11 11:11:41 +02:00
grosser
b5005b6259 add unless_exist option to memory store 2012-05-10 08:19:45 -07:00
Francesco Rodriguez
c1ce4144d1 AS::Callbacks#run_callbacks remove key argument 2012-05-10 02:21:03 -05:00
Xavier Noria
ed2feb7962 Merge pull request #6064 from gazay/fix_guides_for_as_core_ext
Fix guides for as core ext
2012-05-07 13:01:58 -07:00
Alexey Gaziev
8b67a022ec Added tests for comparsion operator for Range 2012-05-07 23:53:57 +04:00
Piotr Sarnacki
98553a5574 Keep all methods in object/deep_dup 2012-05-06 11:13:15 -07:00
Alexey Gaziev
657b4ff04a Nice logic for deep_dup in rails 2012-05-06 10:28:35 -07:00
José Valim
d6e2c81cfe Merge pull request #6169 from marcandre/respond_to_missing
Respond to missing
2012-05-05 00:34:13 -07:00
Marc-Andre Lafortune
14762dc5ef Use respond_to_missing for TimeWithZone 2012-05-05 02:45:04 -04:00
Marc-Andre Lafortune
9bda37474e Use respond_to_missing? for Chars 2012-05-05 02:44:58 -04:00
Marc-Andre Lafortune
3ea70f985b Use respond_to_missing? for OrderedOptions 2012-05-05 02:43:41 -04:00
Jeremy Kemper
fecfd61c22 Merge pull request #6156 from mjtko/feature-beginning_of_hour
Beginning and end of hour support for Time and DateTime
2012-05-04 15:34:11 -07:00
Mark J. Titorenko
6223d72b52 enable tests for beginning_of_* and end_of_* within time zone tests; enable test for future_with_time_current_as_time_with_zone; fix beginning_of_month test. 2012-05-04 16:11:32 +01:00
Mark J. Titorenko
8c3f4bec1f added beginning_of_hour support to core_ext calculations for Time and DateTime 2012-05-04 16:01:57 +01:00
Aaron Patterson
7a3e43cc58 Merge pull request #4452 from tapajos/e5425c8f68fbb720fcbf4b14e1f154ac27dbbbed
Fix cache (FileStore) clear to keep .gitkeep.
2012-05-03 15:56:54 -07:00
David FRANCOIS
18aa1ae29c BigDecimal string wrapping in JSON serialization can now be opted-out, fixes #6033 2012-05-02 07:16:00 +02:00
Sebi Burkhard
d538778808 JSON: encode BigDecimal NaN/Infinity as null. 2012-05-01 11:28:46 +07:00
Piotr Sarnacki
3cc6995e71 Merge pull request #2532 from hasclass/as_json__encode_infinite_and_nan_floats_as_null
JSON: Encode infinite or NaN floats as `null` to generate valid JSON.
2012-04-30 21:06:22 -07:00
José Valim
66c5ac3be9 Merge pull request #5177 from cap10morgan/fix-gh-issue-4374
fix inflector bug where -ice gets singularized into -ouse
2012-04-30 00:13:40 -07:00
José Valim
0b019cc3b8 Merge pull request #6044 from gazay/tests_for_string_truncate_w_regexp_separator
Tests for regexp separator in String#truncate
2012-04-29 03:08:41 -07:00
Alexey Gaziev
076536433f Tests for regexp separator in String#truncate
5a7513593f
2012-04-29 13:42:40 +04:00
Carlos Antonio da Silva
34599c4f57 Add test for default silence and stderr deprecation behaviors 2012-04-28 18:25:35 -03:00
Daniel Schierbeck
1bac04e854 Optimize the performance of #delegate
Remove the use of #__send__ in order to boost performance. This also
means that you can no longer delegate to private methods on the
target object.
2012-04-12 13:47:52 +02:00
Xavier Noria
206974a97c adds a new test case for titleize 2012-04-08 01:10:08 +02:00
Xavier Noria
4b685aad7b revises the regexp used in titleize
The regexp used in titleize matches saxon genitive
and other contractions, only to call capitalize on
the captured text and have the apostrophe upcased
which yields the apostrophe itself. It is more
clear that the regexp matches just what it has to
match.
2012-04-07 23:58:44 +02:00
Xavier Noria
e25eeed5b8 the file update checker now also detects removed files 2012-04-03 16:18:56 -07:00
Arun Agrawal
27a8e693da no more deprecation required. 2012-03-31 23:00:13 +05:30
Arun Agrawal
6a240826ca No more BufferedLogger so it can be LoggerTest 2012-03-31 22:49:15 +05:30
Arun Agrawal
40c38d969c warning removed: (...) interpreted as grouped expression 2012-03-31 16:31:07 +05:30
Aaron Patterson
ad95a61b62 Merge pull request #4911 from Floppy/master
Reduce FILENAME_MAX_SIZE in ActiveSupport::Cache::FileStore
2012-03-30 17:43:55 -07:00
Dmitry Plashchynski
96b951ce24 validate attribute names in class and module attribute accessors 2012-03-30 15:45:46 +03:00
Vasiliy Ermolovich
633ee64e20 String#titleize works properly with smart quotes, closes #5584 2012-03-26 21:18:25 +03:00
Jarkko Laine
03becb1309 [#5559] Do not black out the system timezone DST jump hour if Time.zone differs from that.
The system timezone DST jump hour should not be blacked out by Time.zone.parse if current Time.zone does not do the jump at that time.

Fixes #5559.
2012-03-24 20:15:00 +02:00
Sergey Nartimov
2ee28b2bf8 fix HashWithIndifferentAccess.[] method 2012-03-23 23:09:29 +03:00
Aaron Patterson
ea482d366a oops, forgot to commit the tests! 💣 2012-03-23 11:47:42 -07:00
Sergey Nartimov
9c857db757 deprecate Proc#bind that can cause symbol memory leak 2012-03-22 22:25:55 +03:00
Aaron Patterson
440559f661 bigdecimal can be duped on Ruby 2.0 2012-03-20 09:51:22 -07:00
kennyj
c5b3cbc7e8 Add missing require 2012-03-20 23:11:27 +09:00
FND
e0ee14ed23 Provide access to logger instance within TaggedLogging blocks
this improves encapsulation, simplifying occurrences like the following:

    Rails.logger.tagged("DEBUG") { Rails.logger.debug(msg) }

... by removing the need to rely on (i.e. repeat) outer variables:

    Rails.logger.tagged("DEBUG") { |logger| logger.debug(msg) }
2012-03-19 10:49:27 +01:00
Aaron Patterson
273054d6e1 remove some mocha stubs 2012-03-16 11:24:52 -07:00
Carlos Antonio da Silva
c045eebd5d Remove deprecation from AS::Deprecation behavior, some minor cleanups
* Refactor log subscriber, use select! to avoid a new object
* Remove deprecation messages related to AS::Deprecation behavior
  This was added about 2 years ago for Rails 3:
  d4c7d3fd94
* Remove some not used requires
* Refactor delegate to avoid string conversions and if statements inside each block
2012-03-16 09:01:48 -03:00
Sandeep
15404fd3da fixed - warning: assigned but unused variable - checker 2012-03-16 17:14:54 +05:30
Jon Rowe
4073505065 escape commas in paths before globbing to avoid infinite hang in Dir[] 2012-03-15 12:21:20 +00:00
Erich Menge
be623677a3 Allow retrieve_cache_key to work on collections such as ActiveRecord::Relation. 2012-03-12 12:29:30 -05:00
Rafael Mendonça França
9f69f01569 Remove warning of unused variable 2012-03-08 23:58:05 -03:00
Aaron Patterson
085cb3b9af Merge pull request #5287 from nashby/hash-slice-extract
refactor Hash#slice and Hash#extract!
2012-03-08 09:54:34 -08:00
José Valim
d1a4faf61f Ensure load hooks can be called more than once with different contexts. 2012-03-06 22:05:07 +01:00
Vasiliy Ermolovich
74cb4b63bd refactor Hash#slice and Hash#extract! 2012-03-06 08:33:14 +03:00
Vishnu Atrai
d8996d3cab remove usages of AS::OrderedHash 2012-03-03 23:48:29 +05:30
Aaron Patterson
139963c99a Merge branch 'master-security'
* master-security:
  Ensure [] respects the status of the buffer.
  delete vulnerable AS::SafeBuffer#[]
  use AS::SafeBuffer#clone_empty for flushing the output_buffer
  add AS::SafeBuffer#clone_empty
  fix output safety issue with select options

Conflicts:
	actionpack/lib/action_view/helpers/tags/base.rb
2012-03-01 09:56:04 -08:00
José Valim
8ccaa34103 Ensure [] respects the status of the buffer. 2012-02-29 16:09:02 -08:00
Xavier Noria
699ba8ab52 Merge pull request #4284 from mattdbridges/time_calculation_aliases
Added aliases for prev_year, prev_month, and prev_week in Time and Date calculations
2012-02-28 01:37:19 -08:00
Wes Morgan
16e7f2f809 fix inflector bug where -ice gets pluralized into -ouse
This should happen for mouse or louse, but not slice or pumice.
2012-02-25 14:22:15 -07:00
Xavier Noria
31ceb5e67b decouples the implementation of the inflector from its test suite
Trying alternative implementations of the inflections
is hard because the suite is coupled with the current
one, setting ivars by hand etc. This commit relies on
initialize_dup, as long as you maintain that one you
can tweak the implementation.
2012-02-24 15:06:17 -08:00
Bogdan Gusiev
10bac29b33 AS::Callbacks: deprecate rescuable option 2012-02-22 17:43:13 +02:00
Winston
b52c66f1be #read_entry in ActiveSupport::Cache::FileStore should log details of the exception when an exception is thrown. 2012-02-22 19:19:05 +08:00
Matt Bridges
d6366625e0 Adding :last_week, :last_month, and :last_year aliases to Time and Date
core extensions
2012-02-21 16:27:08 -06:00
Akira Matsuda
71d8c77e5a delete vulnerable AS::SafeBuffer#[] 2012-02-20 16:02:45 -08:00
Akira Matsuda
71b95bd954 add AS::SafeBuffer#clone_empty 2012-02-20 16:02:44 -08:00
Xavier Noria
fd5d9b366c fixes a regression introduced by 532cd4, and a bogus test in AP the regression uncovered 2012-02-10 22:17:30 -08:00
Xavier Noria
6728191494 Merge pull request #4719 from markmcspadden/singularize_words_that_end_in_ss
Add Inflection test (and fixes) to ensure singularizing a singular actually give you the correct singular in more cases
2012-02-10 11:14:10 -08:00
Shigeya Suzuki
6f68e63274 make Range#overlaps? accept Range of Time 2012-02-09 22:08:28 -08:00
Xavier Noria
827b520bd1 Merge pull request #4878 from vijaydev/ordinal-2072
PR #2072 with docs
2012-02-07 14:08:02 -08:00
James Smith
c33334fc92 Change FILENAME_MAX_SIZE in FileStore to 228.
In order that temp filenames generated from it will fit in 255 chars. See https://github.com/rails/rails/issues/4907
2012-02-06 17:03:26 +00:00
kennyj
9abdabf185 Optional start_day argument for Time#all_week.
Closes #4883
2012-02-06 00:20:16 +09:00
Vijay Dev
a470d79697 Document Integer#ordinal available in PR #2072.
Also remove an unasserted line in the tests.
2012-02-04 18:46:19 +05:30
Tim Gildea
6fa0190fe4 Add ActiveSupport::Inflector.ordinal and Integer#ordinal 2012-02-04 18:25:54 +05:30
Vijay Dev
7a72fdc7dc remove unasserted line in test 2012-02-04 18:24:17 +05:30
Bogdan Gusiev
4f53091dd1 AS::Callbacks: rip out per_key option. 2012-02-04 13:31:00 +02:00
Dmitriy Vorotilin
705a1d5b88 Added as_json method for multibyte strings 2012-02-01 02:06:46 +04:00
David Heinemeier Hansson
83dbef6074 Revert "Fix expanding cache key for single element arrays"
This reverts commit abe915f23777efe10f17d611bf5718ca855a0704.

This broke all existing keys and it's wrong anyway. The array is just there as a convenience option for building the string. It's intentional that [ "stuff"] and "stuff" generates the same key.
2012-01-27 20:44:08 +01:00
Mark McSpadden
532cd49530 Add Inflection test (and fixes) to ensure singularizing a singular actually give you the correct singular in more cases 2012-01-27 02:20:13 -06:00
Alex Tambellini
7598284c0b safe_constantize should handle wrong constant name NameErrors Fixes #4710 2012-01-26 14:19:49 -05:00
Aaron Patterson
ef7fc6ebb3 global variables may not be set depending on the match. fixes #4703 2012-01-26 09:24:14 -08:00
brainopia
b258bec431 Deprecate DateTime.local_offset 2012-01-25 23:04:40 +04:00
kennyj
5e59d75536 Fix GH #4344. A defined callback in extended module is called too. 2012-01-24 17:36:30 +09:00
Aaron Patterson
a0da46ecaf pushed broadcasting down to a module 2012-01-20 14:18:29 -08:00
Aaron Patterson
14d1029aa3 fixed test for more informative message 2012-01-20 11:57:07 -08:00
Aaron Patterson
e7e1890c49 made the broadcast logger quack more like a logger 2012-01-20 11:57:07 -08:00
Aaron Patterson
d42b3d4347 add a broadcasting logger so we can split logs 2012-01-20 11:57:07 -08:00
kennyj
d8b06dc5c2 Convert URI.parser.parse to URI.parse, and remove ruby 1.8.x code. 2012-01-19 20:27:16 +09:00
Marcos Tapajos
e5425c8f68 Cache (FileStore) clear should keep .gitkeep 2012-01-13 13:28:16 -02:00
Xavier Noria
04df7bb02c deprecates Module#local_constant_names 2012-01-12 12:17:35 -08:00
Aaron Patterson
b15d2c0708 require minitest rather than test/unit 2012-01-06 15:50:47 -08:00
Aaron Patterson
f65559fcc2 make sure the test case name is nil 2012-01-06 15:17:08 -08:00
Aaron Patterson
056b8386d0 removing unnecessary requires 2012-01-06 14:43:04 -08:00
Aaron Patterson
0579f303ec rescue the assertion exception 2012-01-06 14:01:02 -08:00
Aaron Patterson
f8964bd546 add the class name to the assertion message 2012-01-06 13:58:55 -08:00
Rafael Mendonça França
2fc3a30e17 Remove more references to Test::Unit 2012-01-06 15:36:36 -03:00
Rafael Mendonça França
b2fca9533e No need to check if MiniTest::Assertions is defined 2012-01-06 13:31:39 -03:00
Rafael Mendonça França
3ca7fa96f7 Remove unneeded tests 2012-01-06 13:31:39 -03:00
Norman Clarke
cac15643cf Implement Chars#swapcase. 2012-01-06 12:06:26 -03:00
Rafael Mendonça França
61fd7cd9ed Require ActiveSupport::TestCase form ActiveSupport isolation tests 2012-01-06 01:14:21 -03:00
Aaron Patterson
b8d8c50785 use AS::TestCase as the base class 2012-01-05 17:12:46 -08:00
José Valim
4751cc21e8 Merge pull request #4332 from norman/multibyte
Putting AS::Multibyte on a Ruby 1.9 diet
2012-01-05 13:46:39 -08:00
Norman Clarke
16bee7618c Use friendlier method name 2012-01-05 17:25:40 -03:00
Norman Clarke
3fe7ca1dbe Replace Unicode.u_unpack with String#codepoints 2012-01-05 17:08:27 -03:00
Norman Clarke
51648a6fee Remove multibyte utils
This is neither a public API, nor used internally, so let's remove it.
2012-01-05 17:02:14 -03:00
Norman Clarke
b81bef531c Just use Ruby's String#[]= 2012-01-05 16:26:24 -03:00
Karunakar (Ruby)
0023643522 Moved all the logger methods to active support logger
minor
2012-01-06 00:38:46 +05:30
Norman Clarke
f49febe1db Merge branch 'refactor-multibyte-chars' of https://github.com/lest/rails into multibyte
Conflicts:
	activesupport/lib/active_support/multibyte/chars.rb
2012-01-05 15:19:00 -03:00
Aaron Patterson
1dbbe7b663 Merge pull request #4316 from wrozka/time_advance_nsec
Time advance nsec bug
2012-01-05 09:08:30 -08:00
Vishnu Atrai
c776075add parse only minitest results in isolation test 2012-01-05 21:05:13 +05:30
Sergey Nartimov
7301aa2e0d refactor AS::Multibyte::Chars 2012-01-05 18:25:27 +03:00
Norman Clarke
c4b522d3c8 Make return value from bang methods match Ruby docs
The docs for the String class indicate that methods like `rstrip!` and
others should return nil when they do not have an effect on the string.
2012-01-05 11:51:10 -03:00
Norman Clarke
963c36004c Fix incorrect behavior specified in test.
This test was actually specifying the opposite of what it should.
2012-01-05 10:50:25 -03:00
Pawel Pierzchala
c766f3e4b0 Nano seconds fraction of time is copied properly in Time#advance
When day, month or year was passed, advance created a new time
ignoring previous nsec fraction. Now nsec is passed through
usec as a Rational number.
2012-01-05 13:23:13 +01:00
Rafael Mendonça França
7d26fad384 No need to require psych since require yaml does that. 2012-01-04 14:29:13 -03:00
Rafael Mendonça França
761b049b2e No need to use rescue block to require psych 2012-01-04 13:30:57 -03:00
Rafael Mendonça França
38b9fbf1d9 Whitespaces ✂️ 2012-01-04 12:39:28 -03:00
Rafael Mendonça França
73a0f9df47 Add test to make sure that add two safe buffers always return a safe buffer 2012-01-04 12:37:20 -03:00
Xavier Noria
e04232e904 Merge pull request #4250 from lest/range-json
use #to_s to convert Range to json
2012-01-02 13:53:52 -08:00
José Valim
44df252382 Merge pull request #4252 from lest/deprecate-activesupport-base64
remove ActiveSupport::Base64 in favor of ::Base64
2012-01-02 11:54:00 -08:00
Sergey Nartimov
0f2f8003d2 remove ActiveSupport::Base64 in favor of ::Base64 2012-01-02 22:48:15 +03:00
Vijay Dev
881ca628b0 fix a warning about grouped expressions 2012-01-01 23:01:28 +05:30
Sergey Nartimov
dc05914be7 use #to_s to convert Range to json 2012-01-01 20:16:10 +03:00
Sergey Nartimov
952e9d9005 refactor Range#include? to handle ranges with floats 2011-12-29 13:26:52 +03:00
Vasiliy Ermolovich
a19d0f5a66 deprecate Base64.encode64s from AS. Use Base64.strict_encode64 instead 2011-12-27 22:46:44 +03:00
Vasiliy Ermolovich
a7ba8e1fb3 remove File#to_path alias 2011-12-25 22:22:22 +03:00
Sergey Nartimov
1e9e88fcd3 remove checks for encodings availability 2011-12-25 14:34:58 +03:00
Sergey Nartimov
5ca86ac8f9 deprecate String#encoding_aware? and remove its usage 2011-12-24 15:57:54 +03:00
Aaron Patterson
367741ef22 Revert "Added Enumerable#pluck to wrap the common pattern of collect(&:method) *DHH*"
This reverts commit 4d20de8a50d889a09e6f5642984775fe796ca943.

Conflicts:

	activesupport/CHANGELOG.md
	activesupport/lib/active_support/core_ext/enumerable.rb
	activesupport/test/core_ext/enumerable_test.rb
2011-12-22 12:21:18 -07:00
Vasiliy Ermolovich
c4df2d0b6e deprecate Array#uniq_by and Array#uniq_by! in favor of Array#uniq and Array#uniq! from ruby 1.9 2011-12-22 19:34:39 +03:00
Sergey Nartimov
4f6af26a88 remove AS whiny nil extension and deprecate config.whiny_nils 2011-12-22 10:28:36 +03:00
lest
f1b4cacbae remove Enumerable#each_with_object from core_ext as it is present in ruby 1.9 2011-12-21 19:07:00 +03:00
lest
a57c6441a8 remove Kernel#singleton_class from core_ext as it is present in ruby 1.9 2011-12-21 18:53:38 +03:00
Vasiliy Ermolovich
c52ce1dae2 remove Array#sample from core_ext 2011-12-21 17:31:40 +03:00