Commit Graph

5221 Commits

Author SHA1 Message Date
Kenta Murata & Akira Matsuda
9e997e9039 Fix AS::NumberHelper results with large precisions
before:
  ActiveSupport::NumberHelper.number_to_rounded '3.14159', precision: 50
  => "3.14158999999999988261834005243144929409027099609375"
after:
  ActiveSupport::NumberHelper.number_to_rounded '3.14159', precision: 50
  => "3.14159000000000000000000000000000000000000000000000"
2013-12-20 16:26:35 +09:00
Rafael Mendonça França
04ad814bb9 Make sure multiline string is not accepted by the regexp 2013-12-19 17:28:19 -02:00
Xavier Noria
d0829f46db Revert "revises the release notes about message verifiers [ci skip]"
This reverts commit 293a1a68992ba3e3e80f9f0f685e866ff79bf11a.
2013-12-19 19:59:48 +01:00
Xavier Noria
293a1a6899 revises the release notes about message verifiers [ci skip]
Example code does not run yet with beta1.
2013-12-19 19:58:40 +01:00
Vijay Dev
a3b1105ada Merge branch 'master' of github.com:lifo/docrails 2013-12-20 00:10:30 +05:30
Rafael Mendonça França
f70e94cbd2 Merge pull request #13406 from hincupetru/master
Fixed configurable.rb regular expression name check
2013-12-19 08:35:48 -08:00
Hincu Petru
4cb30d9f8b Fixed configurable.rb regular expression name check 2013-12-19 17:30:01 +00:00
Rafael Mendonça França
21fe17a067 Merge pull request #13401 from akshay-vishnoi/refactor
Prevent creation of instance methods when `instance_reader = false`, Grammar checks, Conditional statements combined
2013-12-19 07:39:13 -08:00
Akshay Vishnoi
d4197bc4a2 Prevent creation of instance methods when instance_reader = false, Grammar checks, Conditional statements combined 2013-12-19 19:35:13 +05:30
Carlos Antonio da Silva
c5b76b5362 Prefer assert_raise instead of flunk + rescue to test for exceptions
Change most tests to make use of assert_raise returning the raised
exception rather than relying on a combination of flunk + rescue to
check for exception types/messages.
2013-12-19 09:20:51 -02:00
Carlos Antonio da Silva
d799b9c1cf Fix asserting the correct exception message in dependencies test
In Minitest, the second argument of assert_raise(s) accepts a string as
the message that should be shown in case of a failure in the assertion
(eg nothing was raised when it should), and not the exception message to
be matched.

To do that we need to save the exception returned from assert_raise(s)
into a local variable and check for the exception message using it.
2013-12-19 08:47:09 -02:00
Akira Matsuda
4e68765cf6 Unused classes in AS tests 2013-12-19 16:30:16 +09:00
Guillermo Iguaran
86dcb55588 Merge pull request #13400 from nishant-cyro/docs
fix typos and grammar mistake [ci skip]
2013-12-18 22:33:49 -08:00
nishant-cyro
517caa85c9 fix typos and grammar mistake [ci skip] 2013-12-19 12:02:01 +05:30
Godfrey Chan
e63748cd37 Merge pull request #13366 from vipulnsward/minitest-namespace-change
Change all `MiniTest` to `Minitest`
2013-12-18 19:22:30 -08:00
Akira Matsuda
c454fc29a8 Unused classes in test case 2013-12-19 08:15:06 +09:00
Yves Senn
8ac78d81b1 Merge pull request #13367 from abhishekjain16/new_branch
change to DateTime.civil_from_format from DateTime.civil_from_fromat in ...

[ci skip]
2013-12-18 01:12:08 -08:00
Vipul A M
7bae2921ec Change all MiniTest to Minitest since, MiniTest namespace has been renamed to Minitest
Ref: https://github.com/seattlerb/minitest/blob/master/History.txt
2013-12-18 14:39:50 +05:30
abhishek
29712f0cbc change to DateTime.civil_from_format from DateTime.civil_from_fromat in changelog [ci skip] 2013-12-18 14:21:10 +05:30
David Heinemeier Hansson
c0a2d474c5 Get ready to release 4.1.0.beta1 2013-12-17 16:05:28 -08:00
Yves Senn
bb0bc7a26f Merge pull request #13346 from chancancode/release_notes_etc
Release notes fixes [ci skip]
2013-12-17 08:56:27 -08:00
Godfrey Chan
2003d0409e Some assorted fixes for the 4.1 release notes:
* Added release notes for secrets.yml and mentioned it in the highlights
* Added release notes for Mailer previews and mentioned it in the highlights
* Added release notes for Module#concerning
* Removed mention for AV extraction from the highlights
* Rearranged the major features to put highlighted features first
* Various improvements and typo fixes

[ci skip]
2013-12-17 08:39:07 -08:00
Carlos Antonio da Silva
ae196e85ee Merge pull request #13341 from carlosantoniodasilva/ca-i18n
Default I18n.enforce_available_locales to true

We will default this option to true from now on to ensure users properly handle their list of available locales whenever necessary. This option was added as a security measure and thus Rails will follow it defaulting to secure option.

Also improve the handling of I18n config options in its railtie, taking the new enforce_available_locales option into account, by setting it as the last one in the process. This ensures no other configuration will trigger a deprecation warning due to that setting.
2013-12-17 08:22:26 -08:00
Rafael Mendonça França
5d77edf0cf concern doesn't include the module automatically
[ci skip]
2013-12-17 12:40:44 -02:00
Carlos Antonio da Silva
7c858b03a9 Require I18n >= 0.6.9
The option enforce_available_locales is only available on latest
versions, so require the last available one which has the option +
other related fixes and should not have backward compatibility issues.
2013-12-17 09:06:57 -02:00
Carlos Antonio da Silva
8e21ae37ad Add changelog and upgrading notice related to I18n enforce_available_locales handling 2013-12-17 09:06:56 -02:00
Carlos Antonio da Silva
6802196a6b Disable available locales checks to avoid warnings running the tests 2013-12-17 09:05:41 -02:00
Carlos Antonio da Silva
c445c6d1b9 Default I18n.enforce_available_locales to true
We will default this option to true from now on to ensure users properly
handle their list of available locales whenever necessary. This option
was added as a security measure and thus Rails will follow it defaulting
to secure option.

Also improve the handling of I18n config options in its railtie, taking
the new enforce_available_locales option into account, by setting it as
the last one in the process. This ensures no other configuration will
trigger a deprecation warning due to that setting.
2013-12-17 09:05:41 -02:00
Carlos Antonio da Silva
aaa5463cc0 Fix indent on AS changelog [ci skip] 2013-12-17 09:03:12 -02:00
Jeremy Kemper
1eee0ca6de Introduce Module#concerning
A natural, low-ceremony way to separate responsibilities within a class.

Imported from https://github.com/37signals/concerning#readme
2013-12-17 02:31:57 -07:00
Jeremy Kemper
e7b8769cbc Merge pull request #13321 from mezis/fix-safebuffer-interpolation-master
Fixes interpolation on SafeBuffer
2013-12-16 06:54:48 -08:00
Rafael Mendonça França
108171a44e Merge pull request #13307 from akshay-vishnoi/typo
Spelling and Grammar check [ci skip]
2013-12-15 11:19:44 -08:00
Akshay Vishnoi
c758093eca Spelling and Grammar check [ci skip] 2013-12-16 00:44:37 +05:30
Julien Letessier
a764938ad0 Fixes interpolation on SafeBuffer
Interpolation was untested and did not work with hash arguments.

Adds
- support for interpolation with hash argument
- tests for the above
- tests for safe/unsafe interpolation
2013-12-14 10:10:47 +00:00
Jeremy Kemper
b474d06d5e Perf: save ~9% of object allocations on heavy requests.
The per-thread registry is keyed on the class name, and each request for
the class name returns a new string. This is in the hot path for a lot
of Active Record behavior, so we easily accumulate thousands of repeated
strings.

To fix, we simply cache the key when the class is first extended with
the module.

TODO: Eliminate this module. The per-thread instance concept is common,
but this technique confuses and obfuscates.
2013-12-12 18:53:32 -07:00
Rafael Mendonça França
6e2b734f56 Merge pull request #13229 from vipulnsward/fix-10635-tests
Fix test-error introduced by #10635.
2013-12-12 08:52:40 -08:00
Vipul A M
1f80e8d685 PR #10635 introduces rescue from ArgumentError thrown by Base64.strict_decode64.
This broke natural order of things for `StaleSessionCheck#stale_session_check!` which tried auto_loading a class based on `ArgumentError` message , and later retrying the `Marshal#load` of class, successfully allowing auto_loading.

  This PR tries to fix this behavior by forwarding `ArgumentError` 's not raised  by `Base64.strict_decode64` , as is, ahead to `StaleSessionCheck#stale_session_check!`
2013-12-12 22:15:42 +05:30
Rafael Mendonça França
830044ee6f Copy-edit the parent commit 2013-12-12 14:09:04 -02:00
Rafael Mendonça França
415d1e10e3 Merge pull request #13268 from aayushkhandelwal11/master
Moving the common code of increment and decrement of cache file store in...
2013-12-12 14:04:21 -02:00
Aayush khandelwal
337a07b589 Moving the common code of increment and decrement of cache file store into seprate function
Removing the double checking for the value of id

simplifying code for checking conditional code for key

Removing the default values for parameters

removing reduntant code and asiigning value of id in local variable

removing wrongly added line break[ci ckip]

reverting code
2013-12-12 18:39:39 +05:30
Carlos Antonio da Silva
fe24f3560a Changelog improvements [ci skip] 2013-12-12 08:33:46 -02:00
Yves Senn
6f3c3ba784 Merge pull request #13287 from aayushkhandelwal11/typo_rectified
typos rectified lifecycle => life cycle
2013-12-11 23:32:04 -08:00
Aayush khandelwal
10fffd7ae6 typos rectified lifecycle => life cycle 2013-12-12 12:55:35 +05:30
Jeremy Kemper
864b92cd25 JSON: speed up date/time encoding
Comparing dates & times with other objects using #== is slow.
Internally, it hits #<=> which calls #to_datetime on objects
that don't respond to it, so we incur the cost of raising an
exception with a possibly-deep backtrace.

Cost of #jsonify on a Time object:

Calculating -------------------------------------
                 old      3644 i/100ms
                 new     12652 i/100ms
-------------------------------------------------
                 old    43373.8 (±3.5%) i/s -     218640 in   5.047017s
                 new   173437.6 (±5.2%) i/s -     872988 in   5.047747s
2013-12-11 23:32:33 -07:00
Godfrey Chan
ebfd97124d Merge pull request #13284 from aayushkhandelwal11/typos_corrected
s/everytime/every time/
2013-12-11 22:13:04 -08:00
Aayush khandelwal
4a9e54ef35 typos rectified [ci skip] 2013-12-12 11:29:23 +05:30
Carlos Antonio da Silva
59b7203180 Remove not necessary file, move constants to the file they are used
File 'empty_bool.rb' was introduced around 4 years ago in
c10958fbddb22052e7cbe5fe6b825cda3cb26e48 to remove method redefined
warning in AS test suite, however we do not have such need for reuse
anymore, so we can safely move the constants back to the file where
they are currently used and get rid of the extra file/require.
2013-12-11 20:40:04 -02:00
Carlos Antonio da Silva
443c31f8fc Nodoc missing number helper classes in AS [ci skip]
These classes are not meant to be public.
2013-12-11 20:01:54 -02:00
Aayush khandelwal
714a38217e typo rectified [skip ci] 2013-12-11 18:25:48 +05:30
Aaron Patterson
11c0ef58a6 Merge pull request #13260 from arunagw/using-parallelize_me
Using parallelize_me! to parallelize isolated test
2013-12-10 14:17:42 -08:00