Commit Graph

3480 Commits

Author SHA1 Message Date
Francesco Rodriguez
039917b408 Remove key argument from run_callbacks to fix build 2012-05-10 03:29:46 -05:00
Francesco Rodriguez
c1ce4144d1 AS::Callbacks#run_callbacks remove key argument 2012-05-10 02:21:03 -05:00
Francesco Rodriguez
6cbe8dab1e deleting empty lines in docs parts 2012-05-10 02:09:59 -05:00
Vijay Dev
7918d7bf5c Merge branch 'master' of github.com:lifo/docrails 2012-05-08 23:56:25 +05:30
Vijay Dev
f31613a031 cut some duplication and minor edits [ci skip] 2012-05-08 23:49:20 +05:30
Michael Koziarski
c52ba1b372 Merge pull request #5500 from panthomakos/load-all
Removed ActiveSupport#load_all!
2012-05-07 18:57:59 -07:00
Francesco Rodriguez
2805c28e3e added docs to cattr_reader 2012-05-07 19:37:00 -05:00
Francesco Rodriguez
1ff3530488 better docs for cattr_accessor and cattr_writer 2012-05-07 19:04:27 -05:00
Francesco Rodriguez
2fb6d12ad3 added docs and examples to cattr_writer method 2012-05-07 17:33:54 -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
d785b292a8 Changes for numeric api for Time because Time.current works different 2012-05-07 23:56:27 +04:00
Francesco Rodriguez
7b487e5dc1 added docs to cattr_accessor method 2012-05-07 12:39:41 -05:00
Francesco Rodriguez
17ef794299 adding example about using cattr_accessor with subclasses 2012-05-07 11:28:15 -05: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
Rob Zolkos
9b854ccd77 Add missing public method doc to TimeWithZone.name 2012-05-06 21:04:02 +10: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
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
Aaron Patterson
e539b2ad0e Merge pull request #4496 from makeable/master
Active Support Cache - race_condition_ttl should be an integer
2012-05-03 10:39:51 -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
Piotr Sarnacki
ec94d84425 Merge pull request #6096 from hasclass/as_json__encode_infinite_and_nan_bigdecimals_as_null
JSON: encode BigDecimal NaN/Infinity as null.
2012-05-01 12:34:45 -07:00
Vijay Dev
0c9e7b69d8 more edits [ci skip] 2012-05-01 19:18:47 +05:30
Vijay Dev
4ceac1a7cc copy edit AS deprecation/behaviours docs [ci skip] 2012-05-01 19:14:42 +05:30
Vijay Dev
42ff22f33a Merge branch 'master' of github.com:lifo/docrails 2012-05-01 19:06:03 +05:30
Rob Zolkos
073043ff03 Add documention for utc_offset method 2012-05-01 21:16:56 +10: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
Erich Menge
dda6fa8c9c Minor English fix. 2012-04-30 20:21:02 -05:00
Andrew White
63c00ba558 Merge pull request #5838 from IamNaN/patch-1
Incorporating Pacific Island zone changes circa Dec 31 2011
2012-04-30 05:49:03 -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
Jeremy Kemper
363d7ee551 Merge pull request #6074 from mark-rushakoff/unused-variables
Remove some unused variable assignments
2012-04-29 21:27:09 -07:00
Jeremy Kemper
a89827e97c Merge pull request #5999 from bogdan/callbacks
AS::Callbacks#run_callbacks optimized to reduce backtrace
2012-04-29 16:04:10 -07:00
Mark Rushakoff
d56f5c8db7 Remove unused assignments 2012-04-29 11:03:11 -07:00
twinturbo
110f3f458a Document ActiveSupport::Deprecations.behavior 2012-04-29 10:49:21 -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
José Valim
ffc861c101 Merge pull request #5986 from carlosantoniodasilva/deprecation-behavior-silence
Add a "silence" behavior to completely turn off deprecation warnings.
2012-04-29 01:24:27 -07:00
twinturbo
d7532c189f Merge branch 'master' of github.com:lifo/docrails 2012-04-28 22:33:11 -07:00
twinturbo
2c136ae054 Document exception handling inside resce_from handlers 2012-04-28 22:32:18 -07:00
Francesco Rodriguez
6659252d9f fix typo in ActiveSupport::Inflector#titleize 2012-04-28 23:04:36 -05:00
Jeremy Kemper
1a4e27ff96 Merge pull request #5996 from gazay/remove_excess_selfs
Active Support housekeeping and polish
2012-04-28 20:18:26 -07:00
Alexey Gaziev
432a65fab2 String quotes and trailing spaces 2012-04-29 03:12:07 +04:00
Alexey Gaziev
f1220516fb Indentation for private methods
e7d55f734a
2012-04-29 03:12:07 +04:00
Alexey Gaziev
92572241e2 AS core_ext refactoring pt.2 2012-04-29 03:12:07 +04:00
Alexey Gaziev
1946d7b922 AS core_ext refactoring 2012-04-29 03:09:44 +04:00
twinturbo
9608395923 Document #behavior= and update CHANGELOG 2012-04-28 13:40:30 -03:00
Adam Hawkins
76cd1ca08d Add a "silence" behavior to completely turn off deprecation warnings. 2012-04-28 13:40:30 -03:00
Bogdan Gusiev
764f69e841 AS::Callbacks optimized to reduce call backtrace 2012-04-27 10:12:47 +03:00
Jeremy Kemper
bd6203f9f0 Merge pull request #5880 from asanghi/master
Stamp out ruby-debug with debugger everywhere else in the code base
2012-04-25 05:09:14 -07:00
Aditya Sanghi
d6c831c198 and one more time 2012-04-24 21:56:41 -05:00
Oscar Del Ben
f98d929e67 Remove circular require of time/zones 2012-04-21 10:50:38 +02:00
kennyj
8f1a0af738 Remove unused code. We should use 'active_support/time'. 2012-04-19 00:19:39 +09:00
Aditya Sanghi
67ede88055 another attempt at the language 2012-04-18 02:24:44 +05:30
Aditya Sanghi
6f80ea2aec review changes for #5875 2012-04-18 01:03:59 +05:30
Vijay Dev
5b336ff443 Merge branch 'master' of github.com:lifo/docrails 2012-04-18 00:10:06 +05:30
Aaron Patterson
1d26fcb9f8 Revert "Merge pull request #5864 from vatrai/remove_ordered_hash_autoload"
This reverts commit 86c640a1625aa3a8ec8728c2f1c640c9718fcb0b, reversing
changes made to a0c2cfdc51e16fc39c1d3b1e78bdd257188fa04e.
2012-04-17 06:31:44 -07:00
Aditya Sanghi
0232543e0d stamp out ruby-debug19 with extreme prejudice :) 2012-04-17 15:31:05 +05:30
Vishnu Atrai
387d4e7ee0 remove autoload for OrderedHash, usages removed already 2012-04-16 22:22:36 +05:30
Arun Agrawal
57baa0e97a fixed broken build after multi_json upgrade
Multi_json also upgraded.
2012-04-16 19:11:32 +05:30
Piotr Sarnacki
9a4bfd04a3 Require for time_with_zone should stay in core_ext/time_zones 💣 2012-04-15 23:44:07 +02:00
Piotr Sarnacki
6a6b79939d Add missing require in Active Support time zones (fixes #5854)
I also removed the other require as it's already present in
`activesupport/core_ext/time/calculations`
2012-04-15 23:39:14 +02:00
Dave Gerton
1d08ce5f56 Correcting some confusion. Pago Pago is part of American Samoa, not Samoa. Further, Samoa and Tokelau jumped across the IDL from Dec 29 to Dec 31, 2011 switching from UTC-11 to UTC+13. American Samoa did not make the change and remains at UTC-11. Pacific/Fakaofo and Pacific/Apia are in TZInfo and documentation about the dateline change is in austalasia at IANA. 2012-04-13 13:02:40 -10:00
Michael de Silva
b744199cc2 Add documentation to detail passing of an object as the second
parameter passed to the ActiveSupport::Notifications.subscribe
method instead of a block

Example code sample and output is provided as well.
2012-04-13 01:24:43 +03:00
Michael de Silva
32df313173 Fix further typos in ActiveSupport::Notifications 2012-04-13 00:48:53 +03:00
Michael de Silva
702d25e34d Fix rdoc typo in ActiveSupport::Notifications 2012-04-13 00:44:14 +03:00
Vijay Dev
8248f4202d Merge branch 'master' of github.com:lifo/docrails 2012-04-12 21:44:11 +05:30
Daniel Schierbeck
5fb6bd8b22 Remove Module#delegate! 2012-04-12 14:55:30 +02:00
Daniel Schierbeck
402a119ddb Add back the old deprecate method as deprecate! 2012-04-12 13:47:52 +02:00
Daniel Schierbeck
2310db373b Change API docs regarding delegation to non-public methods 2012-04-12 13:47:52 +02: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
Santiago Pastorino
6ddbd1844a Inline the symbolize_keys/stringify_keys methods
user     system      total        real
symbolize_keys  5.980000   0.070000   6.050000 (  6.048187)
new_symbolize_keys  4.310000   0.050000   4.360000 (  4.364745)
2012-04-08 22:30:20 -03:00
Santiago Pastorino
2e43159959 Remove Fixnum#to_sym support in 1.8.7 2012-04-08 22:10:03 -03:00
Jan Xie
2c72a4abde fix doc for ActiveSupport::Callbacks::Callback#define_conditional_callback 2012-04-08 19:21:10 +08:00
Trevor Wennblom
c5abd0604d update stdlib doc urls in comments - active_support/core_ext/[integer|numeric]/time.rb
http://stdlib.rubyonrails.org/ last updated in 2005
2012-04-07 19:03:49 -05: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
29089bf6fa revises requires of some AS deprecation files 2012-04-05 14:33:47 -07:00
Carlos Antonio da Silva
b621ded813 Initialize variables in file update checker to avoid warnings 2012-04-05 14:49:03 -03:00
Carlos Antonio da Silva
b1e55041eb Remove not used require from as to avoid circular requires 2012-04-05 14:48:01 -03:00
Xavier Noria
acae4fd4ed Merge pull request #3084 from esad/master
Dependency fix for activesupport
2012-04-05 05:57:22 -07:00
Santiago Pastorino
a9398a7da4 Merge pull request #5716 from jurriaan/tr-gsub-cleanup
Updated/changed unneeded tr/gsubs
2012-04-04 10:43:24 -07:00
Santiago Pastorino
c6bd8a9d3a Merge pull request #5188 from jlxw/patch-1
logger.silence is deprecated
2012-04-04 10:38:55 -07:00
Xavier Noria
e25eeed5b8 the file update checker now also detects removed files 2012-04-03 16:18:56 -07:00
Jurriaan Pruis
2d8396fc9f Updated/changed useless tr/gsubs 2012-04-03 15:16:09 +02:00
Artyom Bolshakov
5f62e88b3b Fix typo 2012-04-03 14:20:32 +04:00
Aaron Patterson
0244c0d8f3 use undef_method to avoid NameError exceptions all the time 2012-03-31 17:22:03 -07:00
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
Dmitrii Golub
ba9537c275 remove redundant variable 2012-03-28 03:09:40 +04:00
Aaron Patterson
281b31b4bb Merge pull request #5331 from castlerock/remove_unused_require
remove unused require from AS/core_ext/class/delegating_att.rb
2012-03-26 16:12:40 -07:00
Vasiliy Ermolovich
633ee64e20 String#titleize works properly with smart quotes, closes #5584 2012-03-26 21:18:25 +03:00
Piotr Sarnacki
a4bf3045ca Merge pull request #5566 from lest/patch-3
fix HashWithIndifferentAccess.[] method
2012-03-25 04:16:53 -07: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
Arun Agrawal
ef864c3a22 removed warning: shadowing outer local variable - exception 2012-03-24 10:35:36 +05:30
Sergey Nartimov
2ee28b2bf8 fix HashWithIndifferentAccess.[] method 2012-03-23 23:09:29 +03:00
Piotr Sarnacki
d1887d384a Fix tests, when creating rescue handler, we need to check for arity now
Before it was handled by Proc.bind, but since Proc.bind has been
deprecated, this is no longer the case and returned handler
needs to match rescuer.
2012-03-23 11:49:25 +01:00
Sergey Nartimov
9c857db757 deprecate Proc#bind that can cause symbol memory leak 2012-03-22 22:25:55 +03:00
Aaron Patterson
b6c128d6d0 remove duplicate requires. thanks @atambo 2012-03-21 16:42:28 -07:00
Aaron Patterson
c7847f14fd evented listeners can subscribe to any message 2012-03-21 16:18:47 -07:00
Aaron Patterson
6989db9238 evented subscribers work 2012-03-21 16:18:47 -07:00
Aaron Patterson
f08f8750a5 start / finish events are sent by the instrumenter 2012-03-21 16:18:46 -07:00
Aaron Patterson
60736fec53 push the autoloads up to requires 2012-03-21 16:18:46 -07:00
Aaron Patterson
d99c790f65 split subscribers based on pattern type 2012-03-21 11:12:58 -07:00
Aaron Patterson
bdf7624a59 probably should require the objects we monkey patch. 2012-03-20 10:38:43 -07:00
Aaron Patterson
c317c5b25d search private and protected methods for convert_key 2012-03-20 09:58:42 -07:00
Aaron Patterson
440559f661 bigdecimal can be duped on Ruby 2.0 2012-03-20 09:51:22 -07: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
Pan Thomakos
0f8f99b989 Removed ActiveSupport#load_all!
This is no longer used and actually raises an error when trying to load
`ActiveSupport::Dependencies`. I removed the related code and added the
`Dependencies` module to the autoload list.
2012-03-18 11:24:04 -07:00
Aaron Patterson
090156adeb use empty? on the hash to avoid another method call 2012-03-16 12:15:31 -07:00
Aaron Patterson
4c8a5a0087 removed unnecessary calls to "freeze" 2012-03-16 11:50:15 -07:00
Aaron Patterson
0ae5807fa3 make stubbing Time.now easier 2012-03-16 10:36:18 -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
Jon Rowe
4073505065 escape commas in paths before globbing to avoid infinite hang in Dir[] 2012-03-15 12:21:20 +00:00
Aaron Patterson
7f40b9cd42 make the tagged formatter extend the existing formatter 2012-03-12 11:34:02 -07:00
Aaron Patterson
0f5b32cd08 Merge pull request #5394 from erichmenge/master
retrieve_cache_key should work on objects that act like arrays.
2012-03-12 10:33:50 -07:00
Erich Menge
be623677a3 Allow retrieve_cache_key to work on collections such as ActiveRecord::Relation. 2012-03-12 12:29:30 -05:00
Pan Thomakos
6b480d2e82 Improved ActiveSupport::Autoload performance.
`ActiveSupport::Autoload#autoload` performance is improved in the default
case where a path is present. Since the full path name is not generated, it
isn't necessary to determine the full constant name either. This results in a
3x performance gain and reduces the number of Ruby objects generated. For a full
benchmark check [this gist](https://gist.github.com/2020228).
2012-03-11 23:26:48 -07:00
Vishnu Atrai
82a62b804c remove unused require from AS/core_ext/class/delegating_att.rb 2012-03-10 18:02:08 +05:30
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
Vijay Dev
7c90d91c3c Clean up module docs [ci skip]
Removed some useless docstrings and no-doc'ed some.
2012-03-07 01:04:14 +05:30
Vasiliy Ermolovich
74cb4b63bd refactor Hash#slice and Hash#extract! 2012-03-06 08:33:14 +03:00
Carlos Antonio da Silva
681d89f96b Stop SafeBuffer#clone_empty from issuing warnings
Logic in clone_empty method was dealing with old @dirty variable, which
has changed by @html_safe in this commit:
139963c99a

This was issuing a "not initialized variable" warning - related to:
https://github.com/rails/rails/pull/5237

The logic applied by this method is already handled by the [] override,
so there is no need to reset the variable here.
2012-03-02 11:07:42 -03:00
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
homa
ef79b8400f Inflector/constantize - inject method lets us to avoid using another variable 2012-02-28 18:34:19 +01: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
Aaron Patterson
f42c96331a call binmode on the tempfile for Ruby 1.8 compatibility 2012-02-27 11:57:04 -08:00
Aaron Patterson
9ad7767aba Merge pull request #5179 from RalphShnelvar/Binary_mode_Window_bug
Binary mode window bug
2012-02-27 10:10:53 -08:00
jlxw
b16eb56280 logger.silence is deprecated 2012-02-27 13:51:02 +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
Vishnu Atrai
cd641fa96e ordered_options will work if inherited from Hash, remove OrderedHash usage 2012-02-21 23:08:36 +05:30
Aaron Patterson
12e2405a27 Merge pull request #5108 from mirakui/patch-1
Bug: cache_key.size doesn't return length of filename but size of file
2012-02-21 09:14:19 -08:00
Santiago Pastorino
67a5157974 Merge pull request #5112 from nupurjain/activesupport_cache_refactor
suggested changes.
2012-02-21 03:44:06 -08:00
Nupur Jain
f0baa1c301 suggested changes. 2012-02-21 16:50:35 +05:30
Issei Naruta
0b1ce07822 Bug: cache_path.size doesn't return length of filename but size of file if cache_path is Pathname. 2012-02-21 18:35:31 +09: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
Vijay Dev
2cb86cdb8a Merge branch 'master' of github.com:lifo/docrails 2012-02-18 22:02:34 +05:30
Eric Oestrich
3720d5ee19 Update Time#change docs to reflect the options it uses
[ci skip]
2012-02-17 11:02:27 -05:00
Sokolov Yura
1076c88784 sync __run_callbacks with ruby-trunk
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/34580
In this revision behavior of respond_to? had changed: now to ask about
protected method one should pass second argument `true`
2012-02-14 15:05:45 +04:00
Sergey Nartimov
b5f5e279a6 remove unnecessary require core_ext/string/encoding 2012-02-14 10:09:21 +03:00
Xavier Noria
6bd7023e2f prefer tr to gsub for replacing characters 2012-02-12 16:59:51 -08:00
Xavier Noria
5cff94fd85 inflection regexp are meant to be applied once 2012-02-12 16:57:47 -08:00
Xavier Noria
dc03a2f56c removes redundant argument 2012-02-12 16:45:14 -08:00
Xavier Noria
d3071db120 boosts inflections
The impact of this change has been measured pluralizing
the entire /usr/share/dict/words, showing a 6x speedup
2012-02-12 15:58:10 -08:00
Xavier Noria
5f548eb28e say unshift when you mean unshift (modulus prepend) 2012-02-11 04:58:40 -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
Aaron Patterson
fc3fad8d85 Merge pull request #4985 from shigeya/range_overlaps_to_use_cover
make Range#overlaps? accept Range of Time
2012-02-10 10:11:09 -08:00
Shigeya Suzuki
6f68e63274 make Range#overlaps? accept Range of Time 2012-02-09 22:08:28 -08:00
Uddhava
53f442be28 Replaced OrderedHash usage with Ruby 1.9 Hash 2012-02-09 17:35:22 +05:30
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
Bogdan Gusiev
24b75fc40c AS::Callbacks: remove unused code 2012-02-05 12:58:44 +02:00
Tim Gildea
6fa0190fe4 Add ActiveSupport::Inflector.ordinal and Integer#ordinal 2012-02-04 18:25:54 +05:30
Bogdan Gusiev
4f53091dd1 AS::Callbacks: rip out per_key option. 2012-02-04 13:31:00 +02:00
José Valim
b41ef0a448 Merge pull request #4866 from bogdan/terminate_after_callbacks
AS::Callbacks#define_callbacks: add :terminate_after_callbacks option
2012-02-04 02:53:47 -08:00
Bogdan Gusiev
7661955634 AS::Callbacks: :skip_after_callbacks_if_terminated option 2012-02-03 17:57:53 +02:00
José Valim
d709b124d1 Merge pull request #4865 from bogdan/deprecate_per_key
AC::Callbacks: remove usage of :per_key option from filters
2012-02-03 06:23:00 -08:00
Norman Clarke
66c04431d3 Update Unicode database to recently-released 6.1.
http://www.geek.com/articles/geek-pick/unicode-6-1-released-complete-with-emoji-characters-and-a-pile-of-poo-2012022/
2012-02-03 10:09:26 -03:00
Bogdan Gusiev
1c61f7e6cb AC::Callbacks: remove usage of :per_key option from filters 2012-02-03 14:27:15 +02:00
Aaron Patterson
7bfdbeabd2 Merge pull request #4784 from semaperepelitsa/constantize
A little constantize update
2012-02-01 10:31:51 -08:00
Vijay Dev
d7a85c5c51 revise docs [ci skip] 2012-02-01 23:31:43 +05:30
Vijay Dev
d2c6400948 Merge branch 'master' of github.com:lifo/docrails 2012-02-01 22:25:52 +05:30
Arun Agrawal
74a191dfc7 Build fix when running isolated test 2012-02-01 06:49:00 -05:00
Carlos Antonio da Silva
9d25af60a2 Move escaping regexps to constants 2012-02-01 08:55:19 -02:00
Carlos Antonio da Silva
608eddc6f5 Move escape_once logic to ERB::Util, where it belongs to
All the logic is based on the HTML_ESCAPE constant available in
ERB::Util, so it seems more logic to have the entire method there and
just delegate the helper to use it.
2012-02-01 08:55:18 -02:00
Dmitriy Vorotilin
705a1d5b88 Added as_json method for multibyte strings 2012-02-01 02:06:46 +04:00
Semyon Perepelitsa
d0706c3626 There is an "inherit" option on const_get too, why not use it? 2012-01-31 18:09:11 +08:00
Sergey Nartimov
94cd8d7450 merge MRI performance methods into one file 2012-01-30 22:35:22 +03:00
Nathan Broadbent
b31eac5609 Replaced all 'for' loops with Enumerable#each 2012-01-30 03:15:49 +08:00
David Heinemeier Hansson
b495a8dba8 Inline the prefix assignment so it doesnt look so daft 2012-01-27 20:44:18 +01: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
Daniel Fone
d222211edf [ci skip] More docs for ActiveSupport::MessageEncryptor 2012-01-26 15:09:04 +13:00
brainopia
b258bec431 Deprecate DateTime.local_offset 2012-01-25 23:04:40 +04:00
Vijay Dev
203771da9e Merge branch 'master' of github.com:lifo/docrails 2012-01-26 00:00:40 +05:30
Aaron Patterson
eee5a6cfa0 Merge pull request #4646 from lest/patch-1
no need in separate MiniTest modules
2012-01-25 09:31:29 -08:00
José Valim
148f849ca5 Merge pull request #4524 from nashby/datetime-18-code
remove ruby 1.8 related code
2012-01-25 06:59:09 -08:00
Carlos Antonio da Silva
84bd203b39 Change ActiveRecord::Errors to ActiveModel::Errors in guides
Use ActiveModel::Errors in inflection example docs as well.

Also fixes wrong information and link to locale file related to
Errors#full_messages in I18n guide.
2012-01-25 10:03:19 -02:00
Sergey Nartimov
9cb00a465f no need in separate MiniTest modules 2012-01-24 23:25:51 +03:00
Aaron Patterson
8478b0ca0b Merge pull request #4514 from brainopia/update_timezone_offets
Update time zone offset information
2012-01-24 11:16:39 -08: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
a0ed45cc28 Merge pull request #4581 from kennyj/remove_unused_argument
Remove unused argument.
2012-01-23 09:24:29 -08:00
José Valim
1620df78df Merge pull request #4575 from carlosantoniodasilva/remove-test-pending
Remove ActiveSupport::TestCase#pending, use `skip` instead
2012-01-21 12:24:55 -08:00
kennyj
9d40c09ab2 Remove unused argument. 2012-01-22 04:10:53 +09:00
Carlos Antonio da Silva
c8504b1b56 Remove ActiveSupport::TestCase#pending, use skip instead 2012-01-21 14:32:28 -02:00
Vijay Dev
2d000328df Merge branch 'master' of github.com:lifo/docrails 2012-01-21 21:26:10 +05:30
Semyon Perepelitsa
bb1813cab8 Replace regexp matching with a simple string manipulation.
Using regexp looks like overkill here and is also 2x slower.

             user     system      total        real
string   0.020000   0.000000   0.020000 (  0.016256)
regexp   0.030000   0.000000   0.030000 (  0.035360)

require "benchmark"

names = ("a".."z").map { |c| c + "a" * rand(5..10) + "=" * rand(0..1) }.map(&:to_sym)
puts names

n = 1000
Benchmark.bmbm do |x|
  x.report "string" do
    n.times do
      names.each do |name|
        string_name = name.to_s
        string_name.chomp!('=')
        string_name
      end
    end
  end

  x.report "regexp" do
    n.times do
      names.each do |name|
        name.to_s =~ /(.*)=$/
        $1
      end
    end
  end
end
2012-01-21 18:32:17 +08:00
Semyon Perepelitsa
1729720871 Why do we even need a constant here? A variable is fine. 2012-01-21 17:44:05 +08:00
Semyon Perepelitsa
b7bf3c1a11 TaggedLogging wraps an object, not a class. 2012-01-21 17:37:42 +08:00
Semyon Perepelitsa
717510757d Do not use the same Logger constant for class (from stdlib) and for instance (from the example) 2012-01-21 17:34:04 +08:00
Aaron Patterson
a0da46ecaf pushed broadcasting down to a module 2012-01-20 14:18:29 -08:00
Aaron Patterson
f02cec3c49 defined the actual logger signature 2012-01-20 13:36:18 -08:00
Aaron Patterson
e7e1890c49 made the broadcast logger quack more like a logger 2012-01-20 11:57:07 -08:00
Aaron Patterson
04241f38f6 added the backtrace so errors can be found 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
Tomasz Zurkowski
665322eaab Fix indentation in code example of Delegation 2012-01-20 10:01:22 +01:00
Aaron Patterson
8129a09589 move tagged logging to a module, stop proxying every method call 2012-01-19 13:44:00 -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
Rafael Mendonça França
e89a7f5cee Test::Unit::Collector::ObjectSpace is not present anymore 2012-01-18 15:42:44 -03:00
Vasiliy Ermolovich
f54b8468c7 remove ruby 1.8 related code 2012-01-18 20:57:24 +03:00
brainopia
e58a2dff70 Update time zone offset information 2012-01-18 12:29:29 +04:00
Sergey Nartimov
ffb0c5185c simplify some TaggedLogging methods 2012-01-18 05:02:04 +03:00
Sergey Nartimov
cead2dd1f4 remove unused requires 2012-01-18 05:01:09 +03:00
Matt Williams
06ea1bad55 race_condition_ttl should be an integer 2012-01-17 13:54:09 +01:00
Bogdan Gusiev
a21b5771ad AS::Callbacks: Refactor :per_key option 2012-01-17 11:43:45 +02:00
Sergey Nartimov
6e76f8f5c0 use thread variable in TaggedLogging
previous solution can cause race conditions under GIL-free ruby implementations
2012-01-17 01:40:01 +03:00
Marcos Tapajos
e5425c8f68 Cache (FileStore) clear should keep .gitkeep 2012-01-13 13:28:16 -02:00
Santiago Pastorino
31472ba632 Merge pull request #4432 from lest/patch-1
to_date, to_time, and to_datetime Time methods present in ruby 1.9
2012-01-12 15:32:40 -08:00
Xavier Noria
a59269d999 warns against using temporary subscribers 2012-01-12 14:59:08 -08:00
Sergey Nartimov
b8e1efdf3e to_date, to_time, and to_datetime Time methods present in ruby 1.9 2012-01-13 01:05:44 +03:00
Xavier Noria
04df7bb02c deprecates Module#local_constant_names 2012-01-12 12:17:35 -08:00
Vijay Dev
0119740d91 fixes in api docs 2012-01-13 00:41:12 +05:30
Bogdan Gusiev
19357a7b02 AS::Callbacks: remove unused runner 2012-01-12 10:44:10 +02:00
Sergey Nartimov
5215eed5a3 Symbol#[] method presents in Ruby 1.9 2012-01-07 15:30:36 +03:00
Aaron Patterson
4a2035156a spec class names can possibly be nil in mt/s < 2.6.1, so work around that 2012-01-06 17:28:37 -08:00
Aaron Patterson
fec6f1ba82 Merge pull request #4360 from rafaelfranca/patch-1
Remove more references to Test::Unit
2012-01-06 16:43:18 -08:00
Aaron Patterson
1c09c29a09 register spec subclasses for people who spec 2012-01-06 15:50:47 -08:00
Aaron Patterson
b15d2c0708 require minitest rather than test/unit 2012-01-06 15:50:47 -08:00
Aaron Patterson
a58fb105e7 backport assert_not_same 2012-01-06 15:50:47 -08:00
Aaron Patterson
9342492e14 require test/unit and sort test order 2012-01-06 15:50:47 -08:00
Aaron Patterson
aa7857b617 started converting AS::TestCase to minitest 2012-01-06 15:50:47 -08:00
Rafael Mendonça França
185aa821d9 Whitespaces ✂️ 2012-01-06 20:43:12 -03:00
Aaron Patterson
579acb49df just mix the run method in for minitest 2012-01-06 14:08:23 -08:00
Santiago Pastorino
69fe594e69 Merge pull request #4358 from castlerock/remove_plus_minus_support_for_ruby18
revert "fixing some tests on ruby 1.9.3"
2012-01-06 12:12:45 -08:00
Vishnu Atrai
4f75809f04 revert "fixing some tests on ruby 1.9.3 SHA 33f222b" 2012-01-07 01:26:02 +05:30
Rafael Mendonça França
2fc3a30e17 Remove more references to Test::Unit 2012-01-06 15:36:36 -03:00
Norman Clarke
81f110657b Improve doc consistency 2012-01-06 12:06:50 -03:00
Norman Clarke
cac15643cf Implement Chars#swapcase. 2012-01-06 12:06:26 -03:00
Rafael Mendonça França
b33bd077fa Remove Array.wrap calls in ActiveSupport 2012-01-06 01:04:33 -03:00
José Valim
0e8dda7eab Merge pull request #3637 from bogdan/compile_options
AS::Callbacks::Callback refactor
2012-01-05 14:05:27 -08:00
José Valim
38b0d6d6b9 Merge pull request #4322 from castlerock/minitest_pending
ActiveSupport::Testing::Pending support for MiniTest only
2012-01-05 13:55:50 -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
db6eb1930d Use friendlier method names for upcasing/downcasing 2012-01-05 17:20:15 -03:00
Norman Clarke
4ac056c7f4 Use more descriptive method names 2012-01-05 17:16:35 -03:00
Norman Clarke
a8a8dc4a69 Move include to top of class for clarity 2012-01-05 17:15:36 -03:00
Norman Clarke
d2455bd8a5 Remove unnecessary requires/encoding comment 2012-01-05 17:15:21 -03:00