Norman Clarke
4dbb6e3ff0
Update Unicode database to 5.2.0. [ #5011 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-30 13:22:35 +02:00
James MacAulay
16cef77d37
Fix AS::MB::Chars#+ to not alter self [ #4646 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-30 13:22:28 +02:00
Gonçalo Silva
68bd46ffb9
performance tests now working accurately on 1.9, using Ruby with the GCdata patch
2010-06-29 17:12:37 -07:00
wycats
d4c7d3fd94
Create a deprecation behavior that triggers a notification for deprecation notices, and make the behaviors independent of the environment names.
...
* In Rails 2.3 apps being upgraded, you will need to add the deprecation
configuration to each of your environments. Failing to do so will
result in the same behavior as Rails 2.3, but with an outputted warning
to provide information on how to set up the setting.
* New Rails 3 applications generate the setting
* The notification style will send deprecation notices using
ActiveSupport::Notifications. Third-party tools can listen in to
these notifications to provide a streamlined view of the
deprecation notices occurring in your app.
* The payload in the notification is the deprecation warning itself
as well as the callstack from the point that triggered the
notification.
2010-06-29 12:20:15 -07:00
Santiago Pastorino
b2633f9f93
Don't store incorrect values in zones_map
...
[#4942 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 19:35:33 +02:00
Thiago Pradi
0175c470c0
Documentation for Array#sample
2010-06-28 13:31:57 -03:00
Santiago Pastorino
6cc29ab65f
Implemented getbyte as an aliased method and RDoc added
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-28 01:45:57 +02:00
Santiago Pastorino
cfb38319bc
Makes more sense to ask about method_defined?
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 01:26:01 +02:00
Santiago Pastorino
a822ce78b3
String#[] doesn't return the byte representation on 1.9.2, we should use getbyte that was already added as a Ruby < 1.9 core_ext
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-27 20:30:29 +02:00
Santiago Pastorino
fa96638bf2
Added getbyte as a core_ext to Ruby < 1.9
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-27 20:30:24 +02:00
Santiago Pastorino
926ca9c102
Load JSON additions (as to_json) on active_support/all.
...
[#4730 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 21:15:18 +02:00
Santiago Pastorino
51be8dbded
Move constantize from conversions to inflections.
...
This removes ActiveModel dependency on TZInfo.
[#4979 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 20:49:30 +02:00
chaitanyav
9958950f78
Add OrderedHash#invert to preserve order in ruby 1.8 [ #4875 ]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 12:05:25 +02:00
José Valim
7bd85a8fc2
Work around the fact the JSON gem was overwriting to_json implementation for all Ruby core classes.
...
This is required because the JSON gem is incompatible with Rails behavior and was not allowing ActiveModel::Errors to be serialized.
So we need to ensure Rails implementation is the one triggered. [#4890 state:resolved]
2010-06-26 12:01:13 +02:00
Norman Clarke
cfaaed3f40
Move some methods into 1.8.x-only proxy. [ #4978 state:resolved]
...
These methods had been overridden because they had bugs on 1.9.1. Since
Rails now supports only 1.9.2, and these methods now work properly on
that version, there's no longer any need to override them.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 10:16:37 +02:00
rohit
cae33c4158
Remove previously defined class method logger to supress warnings in Active Support test suites. [ #4618 state:open]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-26 00:27:31 +02:00
Paul Mucur
158e22dae0
Alias ActiveSupport::OrderedHash#update to ActiveSupport::OrderedHash.merge!
...
This ensures that an OrderedHash's keys are set up appropriately when using update.
[#4973 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-25 15:02:20 -07:00
Nick Sieger
b549d93d2f
AS::Isolation functional on Windows/JRuby.
...
Doesn't make up for the fact that it's slooooooooow, though.
Signed-off-by: wycats <wycats@gmail.com>
2010-06-24 09:10:58 -07:00
José Valim
6788db824a
Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [ #4816 state:resolved]
2010-06-24 13:23:43 +02:00
José Valim
69abbe8934
Avoid using Pathname on Resolver and AS::Dependencies.
2010-06-24 01:06:37 +02:00
Xavier Noria
6f83a5036d
renames load_(once_)paths to autoload_(once_)paths in dependencies and config
2010-06-24 00:17:28 +02:00
Prem Sichanugrist
6c4bab306a
Missing require for the class/attribute.rb [4812 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 17:18:28 +02:00
David Calavera
b8330a2261
preventing memcached initialization errors with default servers list [ #4921 state:resolved]
...
As of this writing the JRuby client does not support a default port.
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-22 16:28:29 +02:00
Josh Kalderimis
fd03f1738e
removed default Formatter in logger, not needed with 1.8.7 upwards
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-22 01:19:02 +02:00
Josh Kalderimis
dad71c6099
removed 'unless const_defined?' code smell
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-21 23:34:45 +02:00
rohit
45b263cbf1
Initialize @last_update_at in file_update_checker to hide warnings in AS test suite.
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-21 11:10:19 +02:00
Hongli Lai (Phusion)
756d77622b
Allow instrumentation of cache hits and misses. [ #4888 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-21 01:09:55 +02:00
Xavier Noria
207fa59675
Merge remote branch 'rails/master'
...
Conflicts:
actionpack/lib/abstract_controller/base.rb
2010-06-20 23:13:19 +02:00
Rodrigo Rosenfeld Rosas
03216ae252
Fix comment in en.yml datime_select -> datetime_select
2010-06-20 10:41:47 -03:00
José Valim
dad80ad786
I18n.reload! is only called if any of the locale files actually changed.
2010-06-20 14:44:38 +02:00
José Valim
71703c98ba
Add ActiveSupport::FileUpdateChecker.
2010-06-20 13:26:42 +02:00
Norman Clarke
667522ca98
Adds titleize/titlecase to AS::Multibyte::Chars
...
[#2794 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:51:19 +02:00
rohit
95a8f252c0
remove executable permission from files that don't need it. [ #4802 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:50:48 +02:00
Sam Elliott and Santiago Pastorino
02ea1aa88c
<=> is defined twice on multibyte/chars.rb for Ruby < 1.9
...
[#4850 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-20 00:35:20 +02:00
José Valim
72725d7b7f
Merge branch 'master' of github.com:rails/rails
2010-06-20 00:12:54 +02:00
José Valim
d430db9fd4
Remove descendants warning while executing tests.
2010-06-19 17:16:11 +02:00
José Valim
a2b7fcb07c
Change callbacks to automatically include DescendantsTracker and rename descendents to descendants.
2010-06-19 16:58:15 +02:00
José Valim
8db8c6f4ce
Add ActiveSupport::DescendantsTracker.
2010-06-19 16:44:35 +02:00
Maxime RETY
2c2a5fe829
Fix Yajl backend discovery in ActiveSupport::JSON
...
[#4897 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-18 20:12:31 -07:00
Gonçalo Silva
113b0ec03c
enable_stats added back in since Benchmarker doesn't start RubyProf
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-17 22:15:16 -07:00
Gonçalo Silva
0cef199c8e
check if the profiler patch is applied, otherwise GC::Profiler doesn't have the 'data' method
2010-06-17 19:18:53 -07:00
Gonçalo Silva
c8019cd04a
added information about what is being used
2010-06-17 19:18:53 -07:00
Gonçalo Silva
b169d83787
heap_live_objects+heap_free_objects is broken, use heap_total_objects instead
2010-06-17 19:18:53 -07:00
Gonçalo Silva
5e5d1babb0
also use GC profiler extended patch to retrieve GC time on 1.9
2010-06-17 19:18:53 -07:00
Gonçalo Silva
f02d3f9eee
ruby's GC doesn't support the time method, removed support for it
2010-06-17 19:18:52 -07:00
Gonçalo Silva
175164397b
use GC profiler extended patch to retrieve GC runs on 1.9
2010-06-17 19:18:52 -07:00
Gonçalo Silva
555c3b5abe
ruby's GC doesn't support collections and heap_info, RubyProf can handle it
2010-06-17 19:18:52 -07:00
Gonçalo Silva
4813462eea
GC at 1.9.X doesn't have malloc_allocated_size, remove support for it
2010-06-17 19:18:52 -07:00
Gonçalo Silva
36f5d09692
removed support for 1.8's GC alternative hacks (railsbench and lloyd patches). RubyProf can handle it
2010-06-17 19:18:52 -07:00
Gonçalo Silva
cb74cfc9c1
check if the data method is defined (meaning it's correctly patched)
2010-06-17 19:18:52 -07:00
Gonçalo Silva
901452d06a
the official profiler (present in 1.9) should have the highest priority
2010-06-17 19:18:52 -07:00
Gonçalo Silva
381a30fbba
don't set cpu_frequency if RubyProf resolved it
2010-06-17 19:18:52 -07:00
Aaron Patterson
5ae7a9d31d
when the timezone is nil, a TimeWithZone object should not be constructed. [ #4881 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-17 14:14:30 -07:00
Hongli Lai (Phusion)
6f5fb13928
Remove documentation reference to AS::Notifications::Event#result because it has been removed.
2010-06-17 15:47:37 +02:00
Evgeniy Dolzhenko
ef404c771d
Fix a bunch of minor spelling mistakes
2010-06-15 12:04:22 +04:00
Xavier Noria
f17159b029
edit pass: the names of Rails components have a space, ie, "Active Record", not "ActiveRecord"
2010-06-14 23:22:04 +02:00
Xavier Noria
94de5b8cb5
edit pass in #define_callbacks rdoc
2010-06-14 22:52:47 +02:00
Neeraj Singh
e4c8bc1b34
adding to the :kind documentation for ActiveSupport callbacks
2010-06-14 16:18:29 -04:00
Neeraj Singh
ed9a183ea4
clearer documentation of how scope applies to ActiveSupport callbacks
2010-06-14 15:48:09 -04:00
Xavier Noria
50df162a2b
explains why AS::OrderedHash does not leverage inheritance
2010-06-13 22:02:29 +02:00
Santiago Pastorino
b514b4d696
removes spurious .rb in require
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-13 13:56:08 +02:00
Santiago Pastorino
6d19a4a664
Change implementation to do it without asking each time for block_given?
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-13 07:27:26 +02:00
Xavier Noria
36143d26cb
revises implementation of AS::OrderedHash#merge!
2010-06-13 06:37:54 +02:00
Xavier Noria
3359af63a5
Revert "hash merging with a block ignores non-existing keys altogether"
...
This reverts commit 72f9fec607c4a72b2e88995d0cb32b16b96e9068.
It is wrong, this feature is a little undocumented, doing some research.
2010-06-13 05:53:42 +02:00
Xavier Noria
72f9fec607
hash merging with a block ignores non-existing keys altogether
2010-06-13 05:09:31 +02:00
Paul Mucur
58e21a4a0d
Support passing a block to ActiveSupport::OrderedHash's merge and merge! [ #4838 state:committed]
...
For better consistency with Ruby's own Hash implementation.
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-13 04:19:35 +02:00
Santiago Pastorino
f802eb2f00
require conversions to use String#ord
2010-06-12 18:47:37 -07:00
José Valim
1eecd9483b
No need to call convert_key before except.
2010-06-12 09:54:18 +02:00
José Valim
50ec0d9b2e
Simplify and optimize callbacks superclass sync.
2010-06-12 09:54:18 +02:00
Geoff Buesing
4146a443b6
Date#since, #ago, #beginning_of_day, #end_of_day, #xmlschema return TimeWithZone when Time.zone_default is set
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-12 00:19:12 +02:00
Jeremy Kemper
ed61c3b640
Remove String#constantize deps
2010-06-11 10:33:43 -07:00
Jeremy Kemper
cfc9439454
Explicitly delegate Chars#<=> to work around Kernel#<=> possibly ignoring method_missing
2010-06-11 10:03:23 -07:00
Evgeniy Dolzhenko
ccf9577aee
Fix a bunch of minor spelling mistakes
2010-06-11 14:15:34 +04:00
David Heinemeier Hansson
32d4330b81
Get ready for beta 4
2010-06-08 14:47:02 -04:00
wycats
6b49a71ab7
Missing require restored
2010-06-08 14:24:35 -04:00
wycats
068f8d6e85
Require encoding.rb
2010-06-08 14:09:34 -04:00
wycats
8d576b51a1
Move the undef into the 1.9 only branch
2010-06-07 23:32:20 -04:00
wycats
b97a3f33a3
Merge remote branch 'rsim/oracle_enhanced_rails3'
2010-06-07 23:03:59 -04:00
wycats
0042f4166f
If we undef <=>, it solves a problem involving comparison. Please figure out the root cause.
2010-06-07 22:31:42 -04:00
Rizwan Reza
3adb395da4
Fixed Load Error failures in 1.9.2-head
2010-06-07 14:53:37 -04:00
Jeremy Kemper
9d0d6f7d26
Clear const references all at once
2010-06-05 22:08:02 -07:00
Jeremy Kemper
fd1a504136
ActiveSupport::Dependencies.constantize shortcut for caching named constant lookups
2010-06-05 22:05:58 -07:00
wycats
a6b3942843
Optimize LookupContext
2010-06-04 20:11:06 -07:00
wycats
16ee4b4d1b
Small optimization of 1.9 unescape. We should make sure that inbound ASCII always means UTF-8. It seems so based on a quick survey of common browsers, but let's be sure
2010-06-04 20:11:06 -07:00
wycats
8b05c5207d
Improve performance of MessageVerifier while keeping it constant time
2010-06-04 20:11:05 -07:00
wycats
220603ee70
Eliminate the need to check for superclass changes to the callback stack each time through the callbacks
2010-06-04 20:11:05 -07:00
Xavier Noria
67a43554f1
removes Array#random_element and backports Array#sample from Ruby 1.9, thanks to Marc-Andre Lafortune
2010-06-05 01:15:17 +02:00
Raimonds Simanovskis
5fcaf91761
fix conditions when DateTime#to_date and DateTime#xmlschema methods are defined
2010-06-04 22:44:03 +03:00
David Heinemeier Hansson
942fe6514c
Merge branch 'master' of github.com:rails/rails
2010-06-02 16:18:03 -05:00
David Heinemeier Hansson
02512914ae
You need the ruby-debug available in your Gemfile for debugger to work
2010-06-02 16:17:05 -05:00
Xavier Noria
315e8952df
revises the documentation of String#truncate and the truncate helper
2010-06-02 01:35:04 +02:00
David Heinemeier Hansson
cae2519900
Merge branch 'master' of github.com:rails/rails
2010-06-01 16:39:05 -05:00
David Heinemeier Hansson
d57397c4b6
Extracted String#truncate from TextHelper#truncate [DHH]
2010-06-01 16:38:42 -05:00
Santiago Pastorino
57144388f0
Unforce memcache from AS
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-01 10:46:05 +02:00
Santiago Pastorino
31e1445a81
Unforce builder from AS
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-01 10:45:51 +02:00
Santiago Pastorino
0bed93be25
Unforce tzinfo from AS
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-01 09:16:19 +02:00
Santiago Pastorino
1854209bb3
Unforce i18n from AS
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-31 12:56:25 +02:00
Xavier Noria
ddec74fb3a
Merge remote branch 'rails/master'
2010-05-27 10:57:05 +02:00
jacortinas
6602fb62a0
A small rdoc change made on lines 39 and 41 on activesupport/lib/active_support/core_ext/object/to_param.rb. It looks like the method name might have been changed, and the comments were never changed to coincide with the new method name.
2010-05-25 19:09:11 +10:00
José Valim
8d5939c096
Fix a bug where I18n fallbacks modules where not included in the proper backend if it was set through config.i18n.backend.
2010-05-23 13:22:19 +02:00
Norman Clarke
f3abc8ac36
Use multibyte proxy class on 1.9, refactor Unicode.
...
Makes String#mb_chars on Ruby 1.9 return an instance of ActiveSupport::Multibyte::Chars to work around 1.9's lack of Unicode case folding.
Refactors class methods from ActiveSupport::Multibyte::Chars into new Unicode module, adding other related functionality for consistency.
[#4594 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-21 12:24:54 -07:00
Neeraj Singh
cc45a1068f
1.day should respond_to kind_of too
...
[#4656 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-21 16:00:55 +02:00
Santiago Pastorino
aacf2581cd
refactor evals and adds some __FILE__ and __LINE__
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-20 15:18:57 +02:00
Xavier Noria
7f07cc364a
Merge remote branch 'rails/master'
2010-05-19 23:29:39 +02:00
Xavier Noria
b9fcd8d71f
in Ruby things in general happen at runtime, no need to specify that
2010-05-19 23:27:09 +02:00
Neeraj Singh
1c3d2a5a60
Updating the doc with the info that class_inheritable_accessor
...
copies properties to child at runtime
2010-05-19 01:29:15 -04:00
Xavier Noria
b753b4a076
removes deprecations of last_(month|year) from master, they will be deprecated in 2.3 instead
2010-05-19 00:20:10 +02:00
Rizwan Reza
8c5e1652c7
Renames Array#rand -> Array#random_element
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-05-17 23:03:16 +02:00
wycats
80b60671f7
Revert "Moved encoding work in progress to a feature branch."
...
This reverts commit ade756fe42423033bae8e5aea8f58782f7a6c517.
2010-05-17 19:41:54 +04:00
Jeremy Kemper
ade756fe42
Moved encoding work in progress to a feature branch.
...
This reverts commits af0d1a88157942c6e6398dbf73891cff1e152405 and 64d109e3539ad600f58536d3ecabd2f87b67fd1c.
2010-05-16 13:55:29 -07:00
Santiago Pastorino
821e15e5f2
Change on Array extension from rand => random_element [ #4555 state:committed]
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-05-16 22:23:44 +02:00
wycats
af0d1a8815
Initial work to improve the state of encodings for templates
2010-05-16 22:43:35 +04:00
wycats
9cfeefb637
Reorganized initializers a bit to enable better hooks for common cases without the need for Railtie. Specifically, the following hooks were added:
...
* before_configuration: this hook is run immediately after the Application class
comes into existence, but before the user has added any configuration. This is
the appropriate place to set configuration for your plugin
* before_initialize: This is run after all of the user's configuration has completed,
but before any initializers have begun (in other words, it runs right after
config/environments/{development,production,test}.rb)
* after_initialize: This is run after all of the initializers have run. It is an
appropriate place for forking in a preforking setup
Each of these hooks may be used via ActiveSupport.on_load(name) { }. In all these cases, the context inside the block will be the Application object. This means that for simple cases, you can use these hooks without needing to create a Railtie.
2010-05-15 06:09:07 -07:00
Carlos Antonio da Silva
c77794a924
Add missing require to with_options [ #4601 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-15 14:54:07 +02:00
Neeraj Singh
a0621c1086
Better code formatting and proper line numbers for stack traces
...
[#4596 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-05-14 12:24:01 -07:00
Xavier Noria
2203c781a7
defines prev_(month|year) in Date and Time to ease transition to 1.9, and deprecates last_(month|year)
2010-05-12 23:04:17 +02:00
Xavier Noria
df508bd970
aliases Date#sunday to Date#end_of_week, for symmetry with existing alias Date#monday -> Date#beginning_of_week
2010-05-09 11:16:34 +02:00
Xavier Noria
636ffa1f08
Backports Date#>> from 1.9 so that calculations do the right thing around the calendar reform
...
Our next_month gives November for some late dates in September of 1582.
Related methods, last_*, and in general advance have the same issues.
This commit fixes those, see the test suite for expected behavior, which
we still run in 1.9 to ensure it matches as we do with other methods
defined in Date in 1.9.
2010-05-09 01:20:23 +02:00
Xavier Noria
53c1cd6cde
let Time.time_with_datetime_fallback handle properly years in the range 0..138
2010-05-05 00:35:06 +02:00
Xavier Noria
6704d8c994
date/conversions needs time/calculations for (utc|local)_time
2010-05-03 23:11:09 +02:00
Xavier Noria
9e085a9f33
adds a comment explaining why BigDecimal#as_json returns a JSON string
2010-05-03 22:04:47 +02:00
Xavier Noria
34d5725167
fixes colon in previous YAML example
2010-05-03 15:25:28 +02:00
Norman Clarke
756f762cdb
Fix transliteration rule example in docs. [ #4526 state:resolved]
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-05-03 15:22:52 +02:00
José Valim
a76c7e68d5
Event should be aware if yielded block failed or not.
2010-05-02 22:45:54 +02:00
Justin George
731d4392e4
Change event namespace ordering to most-significant first [ #4504 state:resolved]
...
More work still needs to be done on some of these names
(render_template.action_view and render_template!.action_view particularly)
but this allows (for example) /^sql/ to subscribe to all
the various ORMs without further modification
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:54 +02:00
Justin George
109d3ee38d
Make notifications go off even when an error is raised, so that we capture the underlying performance data [ #4505 state:resolved]
...
This is important when trying to keep track of many layers of interrelated calls
i.e.:
ActiveRecord::Base.transaction do
MyModel.find(1) #ActiveRecord::NotFound
end # should capture the full time until the error propagation
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-02 22:45:53 +02:00
Santiago Pastorino
02028e529c
Missing require added make pass activesupport/test/json/encoding_test.rb in isolation
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-05-02 22:05:40 +02:00
Xavier Noria
7aaabea517
let Date.yesterday and Date.tomorrow be based on Date.current rather than Date.today
2010-05-02 01:12:31 +02:00
Norman Clarke
f0e754e713
Delegate Inflector.transliterate to i18n. [ #4508 state:resolved]
...
Ancillary changes: Moved Chars#normalize into a class method; removed
unused UTF_PAT constant.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-30 16:18:12 +02:00
José Valim
2e9af3638d
Move several configuration values from Hash to ActiveSupport::XmlMini, which both Hash and Array depends on.
...
Also, refactored ActiveModel serializers to just use ActiveSupport::XmlMini.to_tag. As consequence, if a serialized attribute is an array or a hash, it's not encoded as yaml, but as a hash or array.
2010-04-29 12:42:42 +02:00
Neeraj Singh
580dd3b052
array.to_xml should be able to handle all types of data elements [ #4490 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-29 09:04:34 +02:00
José Valim
1b816d5024
The rake task :environment now loads config/environment.rb instead of initializing the application on its own. This fixes [ #4492 state:resolved] and also avoids the application being initialized twice in some rake tasks.
2010-04-29 08:39:52 +02:00
Jeremy Kemper
4e75cc59e7
object_id may be negative, producing an invalid symbol. h/t Markus Schirp
2010-04-28 15:20:35 -07:00
Brian Durand
ee51b51b60
ActiveSupport::Cache refactoring
...
All Caches
* Add default options to initializer that will be sent to all read, write, fetch, exist?, increment, and decrement
* Add support for the :expires_in option to fetch and write for all caches. Cache entries are stored with the create timestamp and a ttl so that expiration can be handled independently of the implementation.
* Add support for a :namespace option. This can be used to set a global prefix for cache entries.
* Deprecate expand_cache_key on ActiveSupport::Cache and move it to ActionController::Caching and ActionDispatch::Http::Cache since the logic in the method used some Rails specific environment variables and was only used by ActionPack classes. Not very DRY but there didn't seem to be a good shared spot and ActiveSupport really shouldn't be Rails specific.
* Add support for :race_condition_ttl to fetch. This setting can prevent race conditions on fetch calls where several processes try to regenerate a recently expired entry at once.
* Add support for :compress option to fetch and write which will compress any data over a configurable threshold.
* Nil values can now be stored in the cache and are distinct from cache misses for fetch.
* Easier API to create new implementations. Just need to implement the methods read_entry, write_entry, and delete_entry instead of overwriting existing methods.
* Since all cache implementations support storing objects, update the docs to state that ActiveCache::Cache::Store implementations should store objects. Keys, however, must be strings since some implementations require that.
* Increase test coverage.
* Document methods which are provided as convenience but which may not be universally available.
MemoryStore
* MemoryStore can now safely be used as the cache for single server sites.
* Make thread safe so that the default cache implementation used by Rails is thread safe. The overhead is minimal and it is still the fastest store available.
* Provide :size initialization option indicating the maximum size of the cache in memory (defaults to 32Mb).
* Add prune logic that removes the least recently used cache entries to keep the cache size from exceeding the max.
* Deprecated SynchronizedMemoryStore since it isn't needed anymore.
FileStore
* Escape key values so they will work as file names on all file systems, be consistent, and case sensitive
* Use a hash algorithm to segment the cache into sub directories so that a large cache doesn't exceed file system limits.
* FileStore can be slow so implement the LocalCache strategy to cache reads for the duration of a request.
* Add cleanup method to keep the disk from filling up with expired entries.
* Fix increment and decrement to use file system locks so they are consistent between processes.
MemCacheStore
* Support all keys. Previously keys with spaces in them would fail
* Deprecate CompressedMemCacheStore since it isn't needed anymore (use :compress => true)
[#4452 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-27 11:13:37 -07:00
Xavier Noria
1d63129eff
use ordinary syntax for options to be well-formed in 1.8
2010-04-27 02:36:34 -07:00
Jeremy Kemper
c1d7327071
JSON: encode objects that don't have a native JSON representation using to_hash, if available, instead of instance_values (the old fallback) or to_s (other encoders' default). Encode BigDecimal and Regexp encode as strings to conform with other encoders. Try to transcode non-UTF-8 strings.
2010-04-26 19:55:39 -07:00
Santiago Pastorino
76d6a99364
Use explicit source encoding rather than forced UTF-8 from US-ASCII.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-26 14:45:23 -07:00
Anil Wadghule
53c13f1aca
Use Config::CONFIG['host_os'] instead of RUBY_PLATFORM [ #4477 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-26 11:12:52 -07:00
Cezary Baginski
490a3335d5
Action Pack: fix tests with -K*, work around Ruby 1.9.1 constant lookup.
...
[#4473 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-25 17:00:20 -07:00
David Chelimsky
864bd9c21f
allow unsubscribe by name or subscription [ #4433 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-24 22:06:24 -07:00
Santiago Pastorino
19cecc907f
HWIA relies on Hash#symbolize_keys and #stringify_keys extensions.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-22 11:02:15 -07:00
Jeremy Kemper
c976784381
Change HWIA#stringify_keys to return a HWIA not a Hash
2010-04-22 10:07:33 -07:00
Jeremy Kemper
d692e6be30
Restore HWIA#stringify_keys! and update changelog
2010-04-22 10:00:23 -07:00
Santiago Pastorino
2472f1026a
HWIA delegates to to_hash symbolize_keys and stringify_keys and bang methods are not in the api
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-22 09:06:44 -07:00
José Valim
4163ccec23
Clean up the config object in ActionPack. Create config_accessor which just delegates to the config object, reducing the number of deprecations and add specific tests.
2010-04-22 12:00:13 +02:00
Daniel Neighman
726b5d7984
updates String#to_(date|date_time|time) to return nil for blank strings
2010-04-21 16:54:33 -07:00
Santiago Pastorino
d1911a0707
TimeZones lazy load
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-20 21:40:24 -07:00
Jeremy Kemper
9934738ed5
Switch to TimezoneProxy for later support of deferred TZ loading
2010-04-20 10:54:37 -07:00
Santiago Pastorino
a90a076613
Missing requires added
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-04-20 07:45:54 -07:00
Xavier Noria
bb19f20876
much complete rdoc for String#ord
2010-04-19 05:04:18 -07:00
Xavier Noria
0f0b40d3b6
revises the rdoc of String#ord
2010-04-19 05:04:18 -07:00
Jeremy Kemper
03aa7877f7
MemoryStore#read_multi(*keys) for dev-mode compatibility with memcache store
2010-04-19 00:19:10 -07:00
Santiago Pastorino
b7ea64a86c
remove code for Ruby < 1.8.7
2010-04-18 03:46:01 -03:00
Xavier Noria
afcd252205
removes code written for Ruby < 1.8.7
2010-04-17 15:16:38 -07:00
Sven Fuchs
9a3a4d6aef
Make i18n fallbacks configurable and fallback to the default locale by default in production [ #4428 state:resolved]
...
Allows to configure locale fallbacks through config.i18n.fallbacks. The default setting
config.i18n.fallbacks = true in production.rb will make I18n.t lookup fallback to the
I18n.default_locale if a translation could not be found for the current or given locale.
config.fallbacks = true
config.fallbacks.map = { :ca => :es }
config.fallbacks.defaults = [:'es-ES', :es]
config.fallbacks = [:'es-ES', :es]
config.fallbacks = { :ca => :es }
config.fallbacks = [:'es-ES', :es, { :ca => :es }]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2010-04-17 19:26:46 +01:00
Aaron Patterson
dc94d813e2
fixing invalid yaml [ #4418 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-16 14:19:31 -07:00
Mislav Marohnić
8a91ccf976
add missing requires to Rescuable and RouteSet [ #4415 state:committed]
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-04-16 06:11:38 -07:00
Santiago Pastorino
a0cc94b32e
utc_offset returns nil for unknown zones
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-14 21:15:15 -07:00
Santiago Pastorino
7fa6c16b70
Added missing require and delete unused one on proc.rb
2010-04-13 13:33:16 -03:00
Norman Clarke
dceef0828a
Improve reliability of Inflector.transliterate. [ #4374 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-12 23:19:39 -07:00
Joe Van Dyk
ccf33660a1
Avoid unnecessary allocations in Inflector.underscore [ #3626 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-12 11:09:49 +02:00
wycats
76e0a9eb5b
Not using class_eval wasn't adding clarity here
2010-04-10 16:16:31 -07:00
mfoster
5850edf104
Made arrays of ActiveRecords, and any classes, with namespaces convert to valid xml. [ #3824 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-10 18:12:43 +02:00
Doug Alcorn
dc97430630
ActiveSupport::BacktraceCleaner#remove_filters! allows for completely untouched backtrace [ #4079 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-10 14:06:10 +02:00
José Valim
ee309d506c
Update versions (otherwise you install a gem from source as beta3 but internally it's beta2) and update CHANGELOG.
2010-04-10 12:17:34 +02:00
Jeremy Kemper
e77a0311e5
Refactor for readability
2010-04-09 19:33:55 -07:00
Santiago Pastorino
c09744bec9
Fixed method sign error
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-09 23:05:26 +02:00
Santiago Pastorino
13e00ce606
fix stack trace lines on class_eval
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-09 21:28:49 +02:00
Norman Clarke
e416f1d0ab
Make tidy_bytes work on 1.9 and improve its performance. [ #4350 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-09 10:30:37 -07:00
Aaron Patterson
0e44eb35d6
fisting stack trace [ #4349 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-08 12:03:57 -07:00
Joshua Peek
eed89e65b6
Make sure MemCacheStore logger exists
2010-04-07 15:08:23 -05:00
Rolf Bjaanes
4eab983b95
Changed the way inflections for uncountables work for 'funky jeans' [ #3576 state:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-05 23:54:42 +02:00
Xavier Noria
89978f10af
moves Object#singleton_class to Kernel#singleton_class to match Ruby also there, same for #class_eval to simplify, and adds coverage for class_eval
2010-04-05 12:15:08 -07:00
Kristopher Murata
ef84e691ff
Parameterize should accept malformed utf8 characters [ #4323 state:resolved]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-04-04 09:37:26 -07:00
Santiago Pastorino
1b742ea9b1
delegate unknown timezones to TZInfo
2010-04-02 17:43:48 -03:00
Santiago Pastorino
90e3343ae5
utc_offset is no longer required on TimeZone and if it's not supplied we delegate to TZInfo
2010-04-02 16:46:56 -03:00
Carl Lerche
ab281f511c
Fix class_attribute so that it works with singleton classes.
2010-04-01 17:18:42 -07:00
David Heinemeier Hansson
d868cb4f8a
Prep for beta2, depend on latest Bundler
2010-04-01 13:36:45 -07:00
Xavier Noria
607f945b1d
adds missing require for blank? and present?
2010-03-31 04:40:51 -07:00
Santiago Pastorino
7d0eea179b
Don't cache the utc_offset we are already caching the timezone [ #4301 state:committed]
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-03-30 16:36:16 -07:00
Juanjo Bazan
589deb39c7
New assertion: assert_present [ #4299 state:committed]
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-03-30 15:25:38 -07:00
Juanjo Bazan
7212c29802
new assertion: assert_blank
...
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-03-30 15:25:38 -07:00
wycats
4aded43b73
Replace the placeholder base_hook API with on_load. To specify some code that
...
should run during framework load do:
ActiveSupport.on_load(:action_controller) do
# Code run in the context of AC::Base
end
2010-03-29 17:08:50 -07:00
Jeremy Kemper
e30363617c
Revert "Hash#symbolize_keys(!) optimizations"
...
Was slower in common case.
[#3891 state:open]
This reverts commit 2060977b767061a42eb8db2d5c3a30d205a94123.
2010-03-29 15:48:36 -07:00
wycats
48c1d8c341
Provide a better error if the parsed REXML document has no root [ #3803 state:resolved]
2010-03-28 23:21:35 -07:00
Jeremy Kemper
41e7c68d87
Ruby 1.9.2: marshaling round-trips Time#zone
2010-03-28 22:52:08 -07:00
Vladimir Andrijevik
edaf92f5ab
Drop expires argument from call to @data in MemCacheStore so it works with memcache-client and memcached gems, as advertised [ #3672 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com>
2010-03-28 13:57:14 -07:00
Xavier Noria
76f024ac8d
adds missing requires for Object#blank? and Object#present?
2010-03-28 14:15:02 +02:00
wycats
4b9f167231
Actually check the value of the ivar
2010-03-27 12:17:17 -07:00
Santiago Pastorino
820e3a8491
LINE on class_eval need + 1, also removed comments [ #4281 state:committed]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-27 16:42:52 +01:00
Santiago Pastorino
edbb9526d3
flatten not needed here
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-27 16:42:51 +01:00
wycats
26e714d26e
Remove stray instance variable to resolve serialization problem [ #3769 state:resolved] (ht: Joe Rafaniello)
2010-03-27 04:32:08 -07:00
wycats
bc4cdae3d9
Don't write to /dev/null on mingw. [#3921 state:resolved] (ht: Patrick Daryll Glandien)
2010-03-27 04:15:41 -07:00
wycats
a24a888afe
Limit Array#extract_options! to directl instances of Hash and HWIA. Add extractable_options? to Hash so that subclasses of Hash can opt-into extractable behavior. This fixes an issue where respond_with wasn't working with subclasses of Hash that were provided by other libraries (such as CouchDB or Mashie) [ #4145 state:resolved]
2010-03-27 02:59:10 -07:00
Kabari Hendrick
b081948bb3
fixing inconsistency with cattr_reader and matter_reader [ #4172 state:resolved]
...
Signed-off-by: wycats <wycats@gmail.com>
2010-03-27 02:07:04 -07:00
wycats
197904341f
Merge branch 'master' into docrails
2010-03-26 15:10:24 -07:00
José Valim
395d6648ce
Move application configuration to the application configuration object, remove railtie_name and engine_name and allow to set the configuration object.
2010-03-26 18:47:55 +01:00
José Valim
5231e4e8c5
Ensure to reference the proper TZInfo namespace [ #4268 state:resolved].
2010-03-26 13:24:08 +01:00
Josh Franklin
c7cc958368
Add support for a type=binary with an optional encoding=base64. If the encoding attribute is absent, the data is considered unencoded.
...
[#2966 state:resolved]
2010-03-26 12:44:12 +01:00
Santiago Pastorino
16cad60fd3
avoid active_support/core_ext/time/conversions.rb warnings
...
[#4250 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-03-21 18:16:18 -07:00