Commit Graph

5501 Commits

Author SHA1 Message Date
Godfrey Chan cce376c999 🔥 these are lambdas now [ci skip]
This has changed since around 2b1500d6
2014-07-03 14:52:03 -07:00
Godfrey Chan 268a29d49a The hex escape sequence can be of any length 2014-07-02 15:55:28 -07:00
John F. Douthat 41de23ec03 Fix escape_once double-escaping hex-encoded entities
(This is a manual merge of #9102)
2014-07-02 15:54:47 -07:00
John Paul Ashenfelter d75992b0b2 `DateTime#to_f` now preserves fractional seconds.
Previously this method always returns `.0` in the fractional part. This commit
changes it to preserve the fractional seconds instead.

Fixes #15994.
2014-07-02 15:01:35 -07:00
Sean Griffin b2cf8b251a Add `Hash#map_values` to ActiveSupport
Didn't get a chance to convert existing code, I'll skim through the code
base to make use of this later this afternoon.
2014-06-29 13:31:43 -06:00
Robin Dupret 9ca0f8da2a Tiny documentation fixes [ci skip] 2014-06-29 20:15:28 +02:00
Robin Dupret d93ae4fca8 Quick pass through Active Support and guides CHANGELOG
[ci skip]
2014-06-29 20:13:49 +02:00
Rafael Mendonça França 3c19402fc3 Merge pull request #15943 from wagenet/cache-instrumentation
Always instrument ActiveSupport::Cache
2014-06-27 18:24:01 -03:00
Peter Wagenet acee114ba0 Always instrument ActiveSupport::Cache
The current approach is broken because it uses a thread local value
which means on multi-threaded environments it has to be turned on
per thread. Secondly, ActiveSupport::Notifications does not
instrument items when there are not subscribers so this flag is
unnecessary.
2014-06-27 14:13:10 -07:00
jamesprior c97b18a347 Update documentation for run_callbacks
In some cases run_callbacks will return nil.  I'm attempting to update the documentation for the method to clarify.
2014-06-27 16:23:32 -04:00
Rafael Mendonça França d04763f43c Merge pull request #14247 from robin850/inflections-with-uncountables
Make the apply_inflections method case-sensitive
2014-06-26 18:14:47 -03:00
Godfrey Chan 5add8b8d6d :nodoc: our SecureRandom patches [ci skip]
These methods shouldn't be added to `SecureRandom`, as they are neither secure nor random. The more appropriate place for this seems to be `Digest`, so we should move them there. (Pull request welcomed!)

Marking this `:nodoc:` for now, so we don't accidentally ship it as public API.

See https://github.com/rails/rails/pull/15306/files#r13055862 for details.
2014-06-26 10:55:58 -07:00
Rafael Mendonça França 6bcedea2fe Merge pull request #15845 from robin850/jruby-isolation
Make the isolated tests run on JRuby
2014-06-26 09:56:00 -03:00
Robin Dupret 643409dcb0 Make the apply_inflections method case-sensitive
Since d3071db1, the apply_inflections method check if the downcased
version of a string is contained inside the "whitelist" of uncountable
words. However, if the word is composed of capital letters, it won't be
matched in the list while it should.

We can't simply revert to the previous behavior as there is a
performance concern (benchmarked over /usr/share/dict/words):

Before d3071db1  135.610000   0.290000  135.900000 (137.807081)
Since d3071db1   22.170000    0.020000  22.190000  ( 22.530005)
With the patch   22.060000    0.020000  22.080000  ( 22.125771)

Benchmarked with http://git.io/aFnWig

This way, the solution is to put the down-case version of words inside
the @uncountables array.
2014-06-26 14:03:56 +02:00
Yves Senn 18def156ba docs, fix BacktraceCleaner code example. Closes #15911. [ci skip] 2014-06-25 19:47:29 +02:00
Yuki Nishijima 98f0cab396 Fix a bug where NameError#name returns a qualified name in string
Ruby's original behaviour is that :

  * It only returns a const name, not a qualified aname
  * It returns a symbol, not a string
2014-06-24 10:13:17 -07:00
Zuhao Wan 023d14ecbb Create with_env helper for tests. 2014-06-22 20:31:34 +08:00
Yves Senn e32dade866 Merge pull request #15856 from zuhao/refactor_activesupport_decoding_test
Use with_parse_json_times helper in tests.
2014-06-22 13:47:25 +02:00
Zuhao Wan 42b33590f3 Avoid hardcoded magic number in test teardown. 2014-06-22 18:36:07 +08:00
Zuhao Wan 17ad556a3f Use with_parse_json_times helper in tests. 2014-06-22 18:30:44 +08:00
Robin Dupret 3136388e55 Make the isolated tests run on JRuby
As there is no forking on JRuby, we need to spawn sub-processes to make
the tests run in isolation.

Previously, we were defining globally env variables and running the test
file through backticks and delete these variables once the test ran.

Now, we simply rely on IO.popen as this is cross-platform and the env
variables are available during the child-process execution only so there
are no race conditions.

[Ben Browning & Robin Dupret]
2014-06-21 11:01:23 +02:00
Arthur Neves bd3fde0931
Add regression test for NameError#name 2014-06-20 09:55:41 -04:00
Arthur Neves b36df0f6c8
Make dependencies.rb add a name to NameError 2014-06-20 09:44:45 -04:00
Yves Senn 911b282cf0 Merge pull request #15799 from zuhao/refactor_activesupport_time_zone_test_helpers
Extract out with_env_tz helper method.
2014-06-18 13:59:57 +02:00
Zuhao Wan 9c492885d1 Extract out with_env_tz helper method.
It’s used at so many places that extracting it out into a helper file
is worth doing.
2014-06-18 19:46:04 +08:00
Zachary Scott 9f86780226 Fix documentation from #15669 [ci skip] 2014-06-17 14:13:02 -07:00
Aditya Kapoor b81f364905 [ci skip] fix doc for the Hash#assert_valid_keys 2014-06-17 14:10:46 -07:00
Zuhao Wan 0c2fbc5095 Move test teardown into `ensure` block. 2014-06-17 20:57:02 +08:00
Juanjo Bazán 2c515b337f Formatting fix in AS changelog [ci skip] 2014-06-16 20:30:26 -03:00
Rafael Mendonça França d8569bd498 Merge pull request #15684 from aditya-kapoor/add-tests-for-assert-valid-keys
Add test cases for Hash#asset_valid_keys
2014-06-16 13:27:59 -03:00
Kuldeep Aggarwal 880721434c remove unnecessary calling of `I18n.backend.store_translations(empty, {})`
Clean up I18n stored translations after test
continuation with #15714
2014-06-15 08:53:58 +05:30
Aditya Kapoor fedb16ae12 Add test cases for Hash#asset_valid_keys 2014-06-14 14:13:06 +05:30
Rafael Mendonça França bcb0b99fe9 Merge pull request #15679 from akshay-vishnoi/test-cases
Add missing test cases for #assert_no_difference
2014-06-13 18:40:29 -03:00
Sean Griffin d6bb789266 Merge pull request #15680 from akshay-vishnoi/doc_changes
[ci skip] BigDecimal#duplicable? returns false in 1.9.x
2014-06-12 19:49:04 -06:00
Akshay Vishnoi 7a979b2c57 [ci skip] BigDecimal#duplicable? returns false in 1.9.x 2014-06-13 07:12:26 +05:30
Akshay Vishnoi bb5c1321d6 Add missing test cases for #assert_no_difference 2014-06-13 06:52:58 +05:30
Akshay Vishnoi 48af90f87a [ci skip] Correct output of #assert_not 2014-06-12 22:46:39 +05:30
Rafael Mendonça França 15c2a5be6e Revert "remove unnecssary require of `to_param`, as `to_query` is already require `to_param`"
Revert "No need to require to_param, it is already required in to_query.rb"

This reverts commits ccdd97662e
and d697ee1426.

Reason by @jeremy: These requires are not for implementation dependency.
They ensure that requiring array conversions provides to_query, to_param,
and other array conversion behaviors.

The fact that to_query is implemented in terms of to_param is just a
coincidence. If to_query removed its to_param require, then someone
requiring array conversions would no longer have to_param available.

This change removes these intentional dependencies on to_param in favor
of implementation side effects—an undesirable move that's susceptible to
regression.
2014-06-11 17:10:42 -03:00
Kuldeep Aggarwal d697ee1426 remove unnecssary require of `to_param`, as `to_query` is already require `to_param` 2014-06-12 01:00:45 +05:30
Akshay Vishnoi ccdd97662e No need to require to_param, it is already required in to_query.rb 2014-06-11 23:23:00 +05:30
Akshay Vishnoi 5505131cc1 Move test for blank.rb under object 2014-06-11 22:53:05 +05:30
Yves Senn 47baab0c41 Merge pull request #15628 from akshay-vishnoi/test-cases
Add test cases for #in? and #presence_in
2014-06-11 17:25:36 +02:00
Akshay Vishnoi f648195247 Add test cases for #in? and #presence_in 2014-06-11 06:50:18 +05:30
Aaron Patterson a5ab38c7bb remove deprecated code. Rely on `describe` provided by minitest 2014-06-10 17:14:57 -07:00
Rafael Mendonça França 6cef56ffac Merge pull request #15616 from apanzerj/fix_long_key_paths
fix error with long keys in ActiveSupport::Cache::FileStore
2014-06-10 15:07:23 -03:00
Adam Panzer 9010274627 fix error with long keys in ActiveSupport::Cache::FileStore 2014-06-10 10:53:48 -07:00
Akshay Vishnoi 294ddff512 [ci skip] Add Docs for strip_insignificant_zeros option in number helpers 2014-06-10 23:07:49 +05:30
Akshay Vishnoi 9bb0f1e08a [ci skip] Correct output and use valid options of number helpers 2014-06-10 22:16:13 +05:30
Rafael Mendonça França 3fe33a318f Fix bug that make HashWithIndifferentAccess work differently of Hash
Before HashWithIndifferentAccess were doing deep_dup of the inner hashes
when Hash doesn't do. Now both are behaving in the same way.
2014-06-09 18:30:05 -03:00
Aditya Kapoor 885ebda266 Add Missing Test Cases for the constantize 2014-06-07 23:58:38 +05:30