Michael Koziarski
d39f397dc6
Missing requires
2009-10-15 10:42:18 +13:00
Yehuda Katz
a41c6c35ca
Start adding configuration to ActionView instead of using constants.
...
By using config rather than hardcoded constants, we can evolve the
configuration system over time (we'd just need to update the config
method with more robust capabilities and all consumers would get
the capabilities with no code changes)
2009-10-14 13:36:41 -07:00
Carl Lerche
ff8be66f24
Finish porting over the initializers to the app object and fix all the tests
2009-10-14 11:47:37 -07:00
Joshua Peek
7ec947d59c
Refactor AS concern to avoid hacking the "include" method.
...
Ruby Magic!
2009-10-13 23:32:32 -05:00
Joshua Peek
7b169ed1bb
Extend Callbacks and Rescuable with AS concern
2009-10-13 23:30:06 -05:00
Yehuda Katz
9cd50e7752
Make logger work again (h/t Sam Ruby)
2009-10-13 10:43:28 -07:00
Joshua Peek
610e94c097
Rewrite AS::TestCase setup/teardown as a single callback chain
2009-10-12 23:23:02 -05:00
Joshua Peek
29b280666b
Get AS TestCase off deprecated callbacks
2009-10-12 23:03:02 -05:00
Joshua Peek
eff61fcfa8
Insert a deprecation warn notice when using AS::DeprecatedCallbacks.
...
We are still using DeprecatedCallbacks in AS and AR. This is meant to annoy the
shit out of Rails core until we fix it.
2009-10-12 22:18:41 -05:00
Joshua Peek
21e7b84621
Callbacks, DeprecatedCallbacks = NewCallbacks, Callbacks
2009-10-12 22:15:43 -05:00
Joshua Peek
9bc8defe38
Use "run_callbacks :foo" since it is the public api for callbacks [ #3329
...
state:resolved]
2009-10-12 21:58:49 -05:00
Joshua Peek
2a5c92c101
Kill unused SafelyMemoizable [ #3323 state:resolved]
2009-10-12 21:44:30 -05:00
Jeremy Kemper
c23d28e2b3
To unmarshal MissingSourceFile from child
2009-10-09 18:31:30 -07:00
Pratik Naik
987d501182
Mute log info coming from the local_cache strategy
2009-10-09 15:03:18 +01:00
Pratik Naik
69aa5e8a86
Ensure MessageVerifier raises appropriate exception on tampered data
2009-10-09 02:26:18 +01:00
Michael Koziarski
9415935902
Switch to on-by-default XSS escaping for rails.
...
This consists of:
* String#html_safe! a method to mark a string as 'safe'
* ActionView::SafeBuffer a string subclass which escapes anything unsafe which is concatenated to it
* Calls to String#html_safe! throughout the rails helpers
* a 'raw' helper which lets you concatenate trusted HTML from non-safety-aware sources (e.g. presantized strings in the DB)
* New ERB implementation based on erubis which uses a SafeBuffer instead of a String
Hat tip to Django for the inspiration.
2009-10-08 09:31:20 +13:00
Jeffrey Hardy
9212138ad0
MessageVerifier#verify raises InvalidSignature if the signature is blank
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-10-05 13:38:26 -07:00
Carl Lerche
6b086449be
Fix the broken railties isolation tests
2009-09-29 16:07:29 -07:00
Jay Pignata
d48ebeade2
Escaping symbol passed into Memoizable's flush_cache for query methods to allow them to be cleared
...
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#3138 state:committed]
2009-09-28 14:48:13 +13:00
Joshua Peek
24ac3a8d8e
Wrap isolated test runner in a test suite
2009-09-25 01:16:52 -05:00
Jeremy Kemper
a6a0904fcb
Nah, test SHA1, but skip the test and whine if OpenSSL is borked up
2009-09-24 23:13:56 -07:00
Jeremy Kemper
55f132ab82
Test with MD5 digest in an attempt to mollify CI
2009-09-24 23:10:05 -07:00
Jeremy Kemper
0a692e48ae
Use OpenSSL::Digest.const(...).new instead of OpenSSL::Digest::Digest.new(...)
2009-09-24 22:44:40 -07:00
Jeremy Kemper
5d24827e39
Explicitly require String#bytesize extension
2009-09-24 22:44:40 -07:00
Joshua Peek
897b9ac43b
Make activesupport.gemspec the authoritative source instead of generating it from the Rakefile
2009-09-25 00:24:34 -05:00
Joshua Peek
bb6ca25d03
Check if the lib is in the load path and requirable before attempting to activate the gem version
2009-09-24 23:57:14 -05:00
Jeremy Kemper
018ba27701
Skip addition to load path if an externally-provided lib is already in place. Just to keep the path shorter.
2009-09-24 19:10:31 -07:00
Jeremy Kemper
0bd6e933c0
Restore split between require-time and runtime load path mungery. Simplifies vendor requires.
2009-09-24 18:38:18 -07:00
Jeremy Kemper
772a32a22d
Convert the other vendored libs to avoid pulling in old gems. Works even if rubygems isn't loaded.
2009-09-24 17:29:59 -07:00
Jeremy Kemper
0039c0344c
Avoid inadvertently loading an old tzinfo gem
2009-09-24 17:21:14 -07:00
José Valim
2407479603
Fixes Sam Ruby tests suite.
...
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-09-21 17:56:24 -07:00
José Valim
4215e9ab93
Instrumenting cache stores.
2009-09-20 12:07:21 -03:00
José Valim
a0233dd3b2
Use NewCallbacks on ActionDispatch::Callbacks.
2009-09-20 10:56:38 -03:00
José Valim
3c9a37c9c4
Added Orchestra.
2009-09-20 10:56:38 -03:00
Aaron Patterson
636624fbf2
making nokogiri to hash less clever, more fast O_o
...
[#2243 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-17 11:50:58 -07:00
Developer
0d762646c4
Allow Nokogiri XmlMini backend to process cdata elements
...
[#3219 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-17 10:28:10 -07:00
Jeremy Kemper
51d202e6f3
Remove premature active_support/mini
2009-09-14 13:04:43 -07:00
Joshua Peek
181cd109d9
Lookup ruby bin name too
2009-09-14 00:51:31 -05:00
Joshua Peek
c5a6de50bb
Use rbconfig instead of rubygem detection
2009-09-14 00:47:09 -05:00
Joshua Peek
ec01cc4510
For testing, only load rubygems if mocha is missing
2009-09-14 00:41:04 -05:00
Joshua Peek
27458464d6
Forgot to update load path dir for vendored memcache
2009-09-14 00:09:34 -05:00
Jeremy Kemper
fa1e6dc577
Skip parent isolation tests too
2009-09-13 21:37:31 -07:00
Joshua Peek
a42c8958f9
Bump vendored memcache to 1.7.5
2009-09-13 23:30:32 -05:00
Joshua Peek
b2f0b8cbda
Rollback AS bundler work and improve activation of vendored dependencies
2009-09-13 22:55:46 -05:00
Joshua Peek
6f9e449830
Callbacks need to require reporting
2009-09-13 21:56:10 -05:00
Joshua Peek
8c8e09c305
Restore AS vendor file until we get things sorted out in railties
2009-09-13 21:07:35 -05:00
Joshua Peek
199a423f42
Don't eager require mocha, AS unit needs to set stuff up first
2009-09-13 16:12:33 -05:00
Joshua Peek
fff3f0ae0c
Detect missing dependencies and automatically run bundler
2009-09-13 15:10:29 -05:00
Joshua Peek
5b8373da29
Shush interpolation warnings
2009-09-13 14:34:59 -05:00
Joshua Peek
3b6bb4664f
Forget about old memoize immutable behavior
2009-09-13 13:08:12 -05:00
Joshua Peek
870bf8950f
Load vendored i18n if its not found since its a real requirement
2009-09-13 12:49:22 -05:00
Joshua Peek
ec0d4efd79
Avoid referencing rubygems
2009-09-13 12:47:37 -05:00
Joshua Peek
f3f2e0b00d
Move AS vendor support into bundler.
...
Run `rake bundle` before running tests.
2009-09-13 12:24:50 -05:00
Joshua Peek
3b325d624c
require reporting before attempting to "shush"
2009-09-13 10:53:12 -05:00
Jeremy Kemper
941e990410
Shush, new_callbacks
2009-09-13 06:06:20 -07:00
Jeremy Kemper
c2018b4b7b
Shush, rexml
2009-09-13 05:57:44 -07:00
Jeremy Kemper
7e6652edbf
Prefer not to shadow a local
2009-09-13 05:56:21 -07:00
Jeremy Kemper
98f96a0809
Ignore isolation test tests for test-unit 2 also
2009-09-13 05:52:18 -07:00
Jeremy Kemper
053a0f6ac4
Clean up spurious JSON decoding test failure
2009-09-13 05:43:02 -07:00
Jeremy Kemper
7d2add8c96
Ruby 1.9 compat: fix regexp slice test
2009-09-13 05:31:43 -07:00
Jeremy Kemper
cce2112f12
Silence warning for Encoding.default_external=
2009-09-13 04:48:40 -07:00
Jeremy Kemper
91ffddca57
Use Encoding.default_external, not _internal
2009-09-13 04:43:41 -07:00
Jeremy Kemper
091486fb98
activesupport -> active_support
2009-09-13 02:45:37 -07:00
Aaron Patterson
f959758687
making secure_compare faster
...
[#3195 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-13 02:44:52 -07:00
Michael Koziarski
e590508a9b
Dup the arguments to string compare so we can use force_encoding.
2009-09-13 10:36:04 +12:00
Yehuda Katz
a8a336cbfc
Revert "ruby 1.9 friendly secure_compare" because it breaks CI and Sam Ruby's suite
...
This reverts commit 5de75398c495f109772b622291362a98bc6c21d1.
2009-09-12 14:35:03 -05:00
Jeremy Kemper
8682d76cc9
Revert "Allow frameworks to be required by their gem name"
...
This has just been confusing. Better to educate than band-aid.
This reverts commit 18a24274ec823ded4ffa29bf33fd3d76816aab7e.
Originally from http://dev.rubyonrails.org/ticket/8845 [drnic]
2009-09-12 02:41:01 -07:00
Jakub Kuźma
b22c951e7a
ruby 1.9 friendly secure_compare
...
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-09-12 12:48:34 +12:00
Beau Harrington
38d65b03d6
Remove redundant checks for valid character regexp in ActiveSupport::Multibyte#clean and #verify.
...
[#3181 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-09-10 17:36:54 -07:00
José Valim
2ea1d684d9
Refactor new callbacks and AR implementation.
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-08 10:26:39 -05:00
José Valim
4f37b97033
Changed ActiveRecord to use new callbacks and speed up observers by only notifying events that are actually being consumed.
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-09-08 10:26:39 -05:00
Jeremy Kemper
aeab739bd5
Ruby 1.9: fix MessageVerifier#secure_compare
2009-09-08 14:05:33 +09:00
Joshua Peek
47aebacd51
Please 1.8.6 CI
2009-09-07 21:56:53 -05:00
Joshua Peek
fe68cf2784
Fix failing AS isolated tests
2009-09-05 18:31:10 -05:00
Joshua Peek
ca2f2d1800
Turn warnings on for AS isolated tests
2009-09-05 18:24:58 -05:00
Michael Koziarski
87c93da440
Fix a messed up merge commit
2009-09-04 14:28:32 +12:00
Michael Koziarski
9a73630d93
Add verify and clean methods to ActiveSupport::Multibyte.
...
When accepting character input from outside of your application you can't
blindly trust that all strings are properly encoded. With these methods
you can check incoming strings and clean them up if necessary.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
Conflicts:
activesupport/lib/active_support/multibyte.rb
2009-09-04 09:25:38 +12:00
Coda Hale
5e6dab8b34
Fix timing attack vulnerability in ActiveSupport::MessageVerifier.
...
Use a constant-time comparison algorithm to compare the candidate HMAC with the calculated HMAC to prevent leaking information about the calculated HMAC.
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-09-04 09:25:38 +12:00
Carl Lerche
bd53ebde72
Add required dependencies on activemodel
2009-09-01 12:26:00 -07:00
Yehuda Katz
67f5d611f5
Add rake gemspec and gemspecs to the repo
2009-08-31 17:20:44 -07:00
Jay Pignata
7316d029e6
Duplicating the options hash in Date#advance to prevent modification of the original [ #1133 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-31 13:02:19 -05:00
Jeffrey Hardy
0821941598
Eliminate warnings from Regexp multiline extension tests
...
[#3103 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 14:47:29 -07:00
Jeffrey Hardy
66d8063c91
Correct Regexp#un/optionalize assertions and fix uncovered failures
...
[#3102 state:incomplete]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-26 14:46:38 -07:00
Jeremy Kemper
e93d0a50c0
Ruby 1.9: fix Time#beginning_of_day inaccuracy due to subtracting a Float
2009-08-22 15:53:19 -07:00
Jeremy Kemper
26e4d688ac
Skip isolation test tests when using MiniTest
2009-08-15 12:28:09 -07:00
Yehuda Katz
ccd1c5e521
Allow superclass_delegating_accessor to take a block for initial set.
2009-08-11 15:03:53 -07:00
Yehuda Katz
4bf516e072
More perf work:
...
* Move #set_cookie and #delete_cookie inline to optimize. These optimizations should
almost certainly be sent back upstream to Rack. The optimization involves using
an ivar for cookies instead of indexing into the headers each time.
* Was able to use a bare Hash for headers now that cookies have their own joining
semantics (some code assumed that the raw cookies were an Array).
* Cache blankness of body on body=
* Improve expand_cache_key for Arrays of a single element (common in our case)
* Use a simple layout condition check unless conditions are used
* Cache visible actions
* Lazily load the UrlRewriter
* Make etag an ivar that is set on prepare!
2009-08-11 15:03:53 -07:00
Yehuda Katz
0adbeeb0c9
Got overhead down from 127 to 85. All tests pass:
...
* Tentatively replaced HeaderHash with SimpleHeaderHash, which does not preserve
case but does handle converting Arrays to Strings in to_hash. This requires
further discussion.
* Moved default_charset to ActionDispatch::Response to avoid having to hop over
to ActionController. Ideally, this would be a constant on AD::Response, but
some tests expect to be able to change it dynamically and I didn't want to change
them yet.
* Completely override #initialize from Rack::Response. Previously, it was creating
a HeaderHash, and then we were creating an entirely new one. There is no way to
call super without incurring the overhead of creating a HeaderHash.
* Override #write from Rack::Response. Its implementation tracks Content-Length,
and doing so adds additional overhead that could be mooted if other middleware
changes the body. It is more efficiently done at the top-level server.
* Change sending_file to an instance_variable instead of header inspection. In
general, if a state is important, it should be set as a property of the response
not reconstructed later.
* Set the Etag to @body instead of .body. AS::Cache.expand_cache_key handles
Arrays fine, and it's more efficient to let it handle the body parts, since
it is not forced to create a joined String.
* If we detect the default cache control case, just set it, rather than setting
the constituent parts and then running the normal (expensive) code to generate
the string.
2009-08-11 15:03:53 -07:00
Bryan Helmkamp
d15ddf04ec
Allow delegating to nil, because the method might actually exist on it
2009-08-10 18:48:38 -05:00
Erik Ostrom
7d16e94d82
Correctly handle offsets in Multibyte::Chars#index and #rindex.
...
The offset in codepoints was being passed directly to the wrapped string's index/rindex method. Now we translate the offset into bytes first.
[#3028 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 23:30:41 -07:00
Jay Pignata
793a9f122f
Fixing isolation test
...
[#3022 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:33:23 -07:00
Daniel Sheppard
b3381cacaf
Fix that JSON parser fails to read escaped backslashes.
...
[#973 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 22:30:44 -07:00
Prem Sichanugrist
82dd725fc1
Fix that irregular plural inflections should not be double-pluralized: 'people'.pluralize should return 'people' not 'peoples'.
...
[#1183 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 20:28:57 -07:00
Jeremy Kemper
279b785839
pare down core_ext dependency
2009-08-09 19:32:38 -07:00
Erik Ostrom
4dda9b644d
Add rindex to ActiveSupport::Multibyte::Chars.
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 19:05:19 -07:00
jeem
e4ceea3795
make private_and_public_methods unmemoizable [ #2372 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-09 20:04:48 -05:00
Andrew Moreland
ca92d44e76
Support deep-merging HashWithIndifferentAccess.
...
[#2732 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-09 17:32:04 -07:00
José Valim
ae47f7575d
Improving test coverage for Range#sum [ #2489 ]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 21:46:52 +01:00
David Burger
1382f4de1f
Fix that Hash#to_xml and Array#to_xml shouldn't modify their options hashes [ #672 state:resolved]
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 21:46:52 +01:00
Jeremy Kemper
87e2c1895f
Fix failing dependencies test relying on . being in LOAD_PATH
2009-08-09 12:40:16 -07:00
Jeremy Kemper
d0bcf51191
Extract repetitive method
2009-08-09 12:14:25 -07:00
Jeremy Kemper
635f68dca9
Uses &:foo
2009-08-09 12:11:50 -07:00
Pratik Naik
60bed59fbf
Remove unnecessary &block from Range#sum and add tests for (num..float).sum
2009-08-09 18:15:20 +01:00
Pratik Naik
97a5c7a516
Make enumerable test run stand alone
2009-08-09 18:13:03 +01:00
José Valim
e0adfa82c0
Optimize Range#sum only for integers [ #2489 ]
2009-08-09 18:05:58 +01:00
Hugo Peixoto
3545d6b0b2
Setting usec (and nsec for Ruby 1.9) on Time#end_of_* methods [ #1255 status:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2009-08-09 15:56:37 +01:00
José Valim
1bd4d1c674
Optimize Range#sum to use arithmetic progression when a block is not given [ #2489 ].
...
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-09 15:56:10 +01:00
Michael Siebert
d811864e88
Fix deprecating =-methods by using send [ #2431 status:resolved]
...
Signed-off-by: José Valim <jose.valim@gmail.com>
2009-08-09 15:54:56 +01:00
Yehuda Katz
b05c951907
Temporary fix to get our LoadError monkey-patch working with newer JRuby. We should probably remove MissingSourceFile and just monkey-patch LoadError instead of overriding LoadError.new.
2009-08-09 04:12:09 -03:00
Marc-Andre Lafortune
29096268cc
Enumerable#sum now works will all enumerables, even if they don't respond to :size
...
[#2489 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-08 17:51:09 -07:00
Bas Van Klinkenberg
0fbeaa98e4
Fixed a bug in JSON decoding with Yaml backend, where a combination of dates, escaped or unicode encoded data and arrays would make the parser fail with a ParseError exception. [ #2831 state:resolved]
...
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-08-08 12:44:41 -03:00
Jeremy Kemper
a606727606
Extract String#bytesize shim
2009-08-01 18:34:41 -07:00
José Valim
d9aae2b56e
Merge branch 'master' of git://github.com/rails/rails
2009-07-28 09:00:33 +02:00
Pratik Naik
e033b5d037
Merge docrails
2009-07-25 16:03:58 +01:00
José Valim
33048b6e27
Solving merge conflicts.
2009-07-21 12:51:53 +02:00
Akira Matsuda
9d7aae7103
Ruby 1.9.2 compat: name method was renamed to __name__ since MiniTest 1.4.x [ #2922 state:resolved]
...
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-21 01:15:51 -07:00
Sven Fuchs
17d5cc12b9
* don't include String#% for Ruby 1.9
...
* raise a KeyError exception for missing named interpolation args (like Ruby 1.9 does)
* raise an ArgumentError when mixing named and unnamed placeholders (like Ruby 1.9 does)
* improve docs and comply a bit more w/ Rails names/conventions
[#2870 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-07-18 11:27:27 -07:00
José Valim
fa5f7f7087
Merge branch 'master' of git://github.com/rails/rails
2009-07-16 00:28:33 +02:00
Lourens Naude
0920e69244
ActiveSupport Hash optimizations [ #2902 state:resolved]
...
Signed-off-by: Carl Lerche <carllerche@mac.com>
2009-07-15 13:23:05 -07:00
José Valim
c07746cbdf
Merge branch 'master' of git://github.com/rails/rails
2009-07-08 12:53:13 +02:00
Lawrence Pit
579250ea46
Use the i18n gem if present instead of vendor code. [ #2871 state:resolved]
...
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-07 18:36:42 -07:00
Lawrence Pit
da635394c1
Ruby 1.9 style String interpolation support for lower ruby versions. Thanks to code from Masao Mutoh's GetText gem. [ #2870 state:resolved]
...
Signed-off-by: Yehuda Katz <wycats@yehuda-katzs-macbookpro41.local>
2009-07-07 16:21:57 -07:00
Yehuda Katz + Carl Lerche
61604feec0
Get Initializer tests running without requiring parts of Rails being loaded first
2009-07-06 12:25:34 -07:00
José Valim
dd7ee082be
Use active_support/mini since we just need inflections.
2009-07-06 18:38:27 +02:00
José Valim
3bf45890b3
Merge branch 'master' of git://github.com/rails/rails
2009-07-03 14:56:19 +02:00
Yehuda Katz + Carl Lerche
1d280e21a1
Adds support for def self.setup in isolation tests for setup that should be run only once in the parent
2009-07-02 16:03:41 -07:00
Brian Abreu
d036899717
Fixed ActiveSupport::OrderedHash::[] work identically to ::Hash::[] in ruby 1.8.7 [ #2832 state:resolved]
...
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-02 12:01:05 -07:00
Aaron Patterson
49bdbebca6
wycats forgot a +1, so I added it [ #2749 state:resolved]
...
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-02 11:39:06 -07:00
Levin Alexander
ab2d6abb55
make #inspect if zero length duration return '0 seconds' instead of empty string [ #2838 state:resolved]
...
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-02 11:22:25 -07:00
José Valim
1c265da1db
Merge branch 'master' of git://github.com/rails/rails
2009-07-02 10:25:18 +02:00
Yehuda Katz + Carl Lerche
ee7d4c47e7
Fixes bug where Memcached connections get corrupted when an invalid expire is passed in [ #2854 state:resolved]
2009-07-01 16:56:43 -07:00
Jeremy Kemper
49824e8ad6
JSON.escape returns UTF-8 strings
...
[#2849 state:resolved]
2009-07-01 16:22:19 -07:00
Jeremy Kemper
f37a2ea84c
uses Hash#except/slice
2009-07-01 16:01:20 -07:00
Yehuda Katz + Carl Lerche
8e3e362aed
Forgot to commit the new file. This is slightly embarrassing.
2009-07-01 15:26:14 -07:00
Yehuda Katz + Carl Lerche
1a6f4d424a
Apparently stdlib isn't std enough
2009-07-01 15:20:02 -07:00
Yehuda Katz + Carl Lerche
3990c128ef
Modify isolation test to require a file not in use anywhere in Rails
2009-07-01 15:06:11 -07:00
Jeremy Kemper
e7312105c7
Merge branch 'master' of git@github.com:rails/rails
2009-07-01 12:55:19 -07:00
Yehuda Katz + Carl Lerche
1026d7706f
Original cache objects should not be immutable [ #2860 state:resolved]
...
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-01 12:16:55 -07:00
Yehuda Katz + Carl Lerche
882dd4e605
ensure Inflector.camelize works with symbols [ #2856 state:resolved]
...
Signed-off-by: Yehuda Katz + Carl Lerche <ykatz+clerche@engineyard.com>
2009-07-01 12:14:34 -07:00
Yehuda Katz + Carl Lerche
7583a24ee0
Move mocha down below initial T::U require and bump version to 0.9.7 [ #2858 state:resolved]
2009-07-01 11:53:17 -07:00
Yehuda Katz + Carl Lerche
eea7b5db1d
Crazy hacks to get the Isolation testing module to work on non forking environments
2009-06-30 17:39:32 -07:00
Carl Lerche
db3de78a83
Bump up the version to 3.0.pre
2009-06-30 14:37:12 -07:00
Yehuda Katz + Carl Lerche
575b95ea0b
Created AS::Testing::Isolation which runs each test case in a separate process.
...
This allows for testing rails bootup (files are required, correct constants are
set, etc...). Currently, this is implemented via forking only, but we will add
support for jruby and windows shortly.
2009-06-30 12:00:50 -07:00
Carl Lerche
4954379283
Remove stray checks for Rspec in the testing setup.
2009-06-30 08:41:17 -07:00
José Valim
915f108d6a
Merge branch 'master' of git://github.com/rails/rails
2009-06-26 11:58:02 +02:00
Yehuda Katz + Carl Lerche
8ee60660ce
Try speeding up rails booting
2009-06-25 14:32:15 -07:00
José Valim
0744900861
Merge branch 'master' of git://github.com/rails/rails
2009-06-23 16:52:39 +02:00
Pratik Naik
66eb05821b
Use stubbing instead of sleep() in File store cache tests
2009-06-21 15:25:28 +01:00
Pratik Naik
b5775c2b3e
Add expiry support File cache store [ #1693 state:resolved] [Roman Shterenzon, Pratik Naik]
2009-06-21 15:25:28 +01:00
José Valim
8037fee9ff
Merge branch 'master' of git://github.com/rails/rails
2009-06-19 16:10:24 +02:00
Jeremy Kemper
63cc6b7242
Friendlier runtime exception if delegatee is nil
2009-06-18 20:00:35 -04:00
Jeremy Kemper
50fe928c15
Delegated methods report the expected file/line in backtraces
2009-06-18 18:07:55 -04:00
Joshua Peek
fbdf706fff
Add basic JSON serializer to AMo
2009-06-17 21:27:54 -05:00
Joshua Peek
1c4d28ba31
Move model naming into ActiveModel
2009-06-17 10:37:39 -05:00
José Valim
908b5305d4
Convert line breaks.
2009-06-17 11:26:32 +02:00
Yehuda Katz + Carl Lerche
614374b3e5
Require missing file in AS
2009-06-15 11:31:52 -07:00
Yehuda Katz + Carl Lerche
64ae5b56ff
Fix failing tests in new callbacks
2009-06-15 11:26:47 -07:00
Xavier Noria
b56169c262
moves reopening of core classes to add generic stuff from Action Pack to AS/core_ext and adds tests
...
[#2798 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-06-13 15:01:14 -07:00
Luca Guidi
9eeb5fed2f
Bytes calculation speed up
...
[#2800 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-06-13 14:03:45 -07:00
Xavier Noria
d32965399c
uses Object#metaclass and Object#class_eval in a few spots
...
[#2797 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-06-12 16:14:06 -07:00
Yehuda Katz + Carl Lerche
4fc0778123
Simplify helper use of ActiveSupport::Dependencies, and use super better for in #helpers
2009-06-10 12:15:30 -07:00
Brian Lopez
69bc2043f9
enable *real* IO parsing for the libxml, nokogiri and rexml backends [ #2659 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-06-09 09:01:50 -05:00
Yehuda Katz
114e25e735
Further cleanup of callbacks
2009-06-09 19:47:53 +12:00
Yehuda Katz
8cae3cd0cf
More pruning of NewCallbacks
2009-06-09 19:47:53 +12:00
Jeremy Kemper
e1f679a020
Simplify json decoder backend lazy load
2009-06-08 19:37:51 -07:00
Jeremy Kemper
99cf77be27
Add #element and #collection to ModelName
2009-06-08 19:37:50 -07:00
Jeremy Kemper
30a3b6b4fc
Ruby 1.9: fix json encoding
2009-06-08 15:16:47 -07:00
Jeremy Kemper
00ee990443
JSON: split encoding and coercion
2009-06-08 13:21:30 -07:00
Jeremy Kemper
5e1b46d4c2
Don't rely on Rails.logger
2009-06-08 01:40:14 -07:00
Geoff Buesing
7fe8b630ce
Add notes to TZInfo bundling task
2009-06-07 22:09:21 -05:00
Geoff Buesing
71b1a4b39d
Kathmandu TimeZone: reference Asia/Kathmandu zone directly instead of through linked timezone
2009-06-07 21:43:44 -05:00
Geoff Buesing
184986067a
Load correct version of TZInfo
2009-06-07 21:36:09 -05:00
Jason Frey (Fryguy)
1d9346428b
String #to_time and #to_datetime: handle fractional seconds [ #864 state:resolved]
2009-06-07 20:16:08 -05:00
Geoff Buesing
04eb2b72b4
Update bundled TZInfo to v0.3.13
2009-06-07 20:00:25 -05:00
Jeremy Kemper
ccf70b9570
Pull in time extensions also
2009-06-05 18:27:27 -07:00
Yehuda Katz
d6e4113c83
YAGNI Method references. Deprecated
2009-06-02 22:06:21 -07:00
Yehuda Katz
1126a85aed
Further cleaning up new callbacks
2009-06-02 21:41:31 -07:00
Yehuda Katz
971e2438d9
Simplify callbacks to use less metaprogramming
2009-06-02 19:00:59 -07:00
Yehuda Katz + Carl Lerche
196f780e30
Get all the callback tests to work on new base
2009-06-01 15:40:40 -07:00
Pratik Naik
63992e8f3a
Support Object#filter method for before/after filters
2009-05-30 15:14:23 +01:00
Joshua Peek
669fd84910
AS::Concern redefines "include" to lazy include modules as dependencies
2009-05-29 17:03:23 -05:00
Joshua Peek
c7c35be8fe
AS::Concern includes InstanceMethods module if it exists
2009-05-29 16:28:54 -05:00
Joshua Peek
4e50a35fa2
Break up DependencyModule's dual function of providing a "depend_on" DSL and "included" block DSL into separate modules. But, unify both approaches under AS::Concern.
2009-05-28 11:35:36 -05:00
Yehuda Katz + Carl Lerche
f2f58f5355
Fix failing ActionCacheFilter tests due to around filter changes.
2009-05-27 17:31:48 -07:00
Yehuda Katz + Carl Lerche
1e2628431a
Added support to new callbacks for around filter object that respond to :before & :after used in before|after callbacks
2009-05-27 16:50:40 -07:00
Yehuda Katz + Carl Lerche
2b166d306c
Added support to new callbacks for around filter object that respond to :before & :after
2009-05-27 16:49:23 -07:00
Carl Lerche
a5688fa907
Add the ability to prepend filters to new callbacks
2009-05-27 16:15:53 -07:00
Joshua Peek
6ef329d325
Ensure Memcache local cache returns duplicated values [ #2302 state:resolved]
2009-05-27 14:54:58 -05:00
Pratik Naik
2f59066470
Support Method callbacks
2009-05-26 13:09:33 +02:00
Pratik Naik
10085114ce
Make Filter#filter work with around filters
2009-05-25 18:09:12 +02:00
Jeremy Kemper
e9a7545123
Avoid uninitialized instance variable warning
2009-05-20 18:12:45 -07:00
Jeremy Kemper
428829fc38
Single-require forward compatibility with new Ruby features like Object#tap, Enumerable#group_by, and Process.daemon. Code with the latest but run anywhere.
2009-05-20 18:12:45 -07:00
Jeremy Kemper
886aa2f0e1
Extract autoloads
2009-05-20 18:12:45 -07:00
Jeremy Kemper
5f222c524e
Remove 'core' fluff. Hookable ActiveSupport.load_all!
2009-05-20 18:12:44 -07:00
Jeremy Kemper
3694227f24
Break out Symbol#to_proc as a future-ruby extension
2009-05-20 18:12:44 -07:00
Jeremy Kemper
6839883854
Break up misc Object extensions
2009-05-20 18:12:44 -07:00
Jeremy Kemper
429a00f225
Remove bad add
2009-05-20 18:12:44 -07:00
Pratik Naik
5a03645762
Allow Module#depends_on to accept multiple modules
2009-05-21 03:04:17 +02:00
Yehuda Katz + Carl Lerche
c4a6109286
Got controller/mime_responds_test.rb running on the new base
2009-05-20 16:54:21 -07:00
Yehuda Katz + Carl Lerche
67247ca8ee
Corrected new callbacks semantics with regards to using objects for around filters.
2009-05-19 18:11:44 -07:00
Bryan Helmkamp
36058f4504
Use duck typing to also allow MemCache-like object when initializing a MemCacheStore
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-05-19 16:58:04 -07:00
Bryan Helmkamp
e2ed1a1ca4
Allow MemCacheStore to be initialized with a MemCache object instead of addresses and options
2009-05-19 10:54:56 -07:00
Jeremy Kemper
41e9414b60
Include acts_as_string?
2009-05-18 15:01:13 -07:00
Joe Van Dyk
29550cc91f
Add ability to get multiple memcached keys at the same time (via MemCacheStore#read_multi).
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-05-18 13:43:56 -07:00
rick
e89241c92f
load the JSON Backend lazily. If the JSON gem is already loaded, use the JSONGem backend by default.
2009-05-17 19:18:00 -07:00
Brian Lopez
53dda29f8b
Add support for parsing XML and JSON from an IO as well as a string [ #2659 state:resolved]
...
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-05-17 10:37:52 -05:00
Jeremy Kemper
5dd29c466c
Cherry-picking Active Support extensions
2009-05-14 02:01:08 -07:00
Jeremy Kemper
e8550ee032
Cherry-pick core extensions
2009-05-13 12:00:15 -07:00
Yehuda Katz + Carl Lerche
00a9d4b91c
Merge branch 'master' into wip_abstract_controller
...
Conflicts:
actionpack/lib/action_controller/abstract/callbacks.rb
actionpack/lib/action_controller/abstract/renderer.rb
actionpack/lib/action_controller/base/base.rb
actionpack/lib/action_controller/dispatch/dispatcher.rb
actionpack/lib/action_controller/routing/route_set.rb
actionpack/lib/action_controller/testing/process.rb
actionpack/test/abstract_controller/layouts_test.rb
actionpack/test/controller/filters_test.rb
actionpack/test/controller/helper_test.rb
actionpack/test/controller/render_test.rb
actionpack/test/new_base/test_helper.rb
2009-05-11 17:07:05 -07:00
Yehuda Katz + Carl Lerche
c1d120a71e
Don't run the action if callbacks are halted.
...
In AbstractController, this means that response_body is not empty
2009-05-11 11:48:38 -07:00
Douglas F Shearer
e1854e0b19
ActiveSupport::OrderedHash[1,2,3,4] creates an OrderedHash instead of a Hash.
...
[#2615 state:committed]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-05-11 11:45:57 -07:00
Jeremy Kemper
d45d0a1864
Merge branch 'master' of git@github.com:rails/rails
2009-05-11 11:43:30 -07:00
Alexander Dymo
2e7409f035
Change spelling of Kyev timezone to Kyiv [ #2613 state:resolved]
2009-05-10 11:59:03 -05:00
Ken Collins
9e0cfdb7f9
ActiveSupport::OrderedHash#to_a method returns an ordered set of arrays. Matches ruby1.9's Hash#to_a.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com>
[#2629 state:committed]
2009-05-10 13:04:46 +12:00
Jeremy Kemper
4817bf94d1
Check for date/time methods that moved upstream in 1.9
2009-05-07 18:39:03 -07:00
Joshua Peek
af40fa6d03
Prefer "included" language over "setup"
2009-05-07 10:38:57 -05:00
Joshua Peek
2854535b02
Make module dependency DSL opt in
2009-05-07 10:29:22 -05:00
Joshua Peek
783deae99a
Add test coverage to module setup extensions
2009-05-07 10:03:39 -05:00
codebrulee
eb201e64c0
Fixed Hash#from_xml with keys that are all caps.
...
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2009-05-04 10:01:01 -07:00
Yehuda Katz + Carl Lerche
059afb3a3a
Removed a stray method_missing in the new callbacks system
2009-05-01 17:31:01 -07:00
Yehuda Katz + Carl Lerche
34509777fd
Makes new callbacks support keys with special characters
2009-05-01 17:31:01 -07:00
Jeremy Kemper
79420e71e0
Work around Float faux precision
2009-04-30 01:33:07 -07:00
Jeremy Kemper
091965c0fc
Prefer behavior check to RUBY_VERSION to catch 1.8 backports
2009-04-29 23:12:34 -07:00
Yehuda Katz + Carl Lerche
cecafc52ee
Refactor ActionView::Template
...
ActionView::Template is now completely independent from template
storage, which allows different back ends such as the database.
ActionView::Template's only responsibility is to take in the
template source (passed in from ActionView::Path), compile it,
and render it.
2009-04-27 11:49:11 -07:00
Jeremy Kemper
f58c322e7e
Use __send__ for BasicObject friendliness
2009-04-26 20:05:17 -07:00
Jeremy Kemper
ee46ffedb8
Now that we have a separate internal rails_to_json, use a separate circular reference stack instead of sticking it in the options hash
2009-04-26 20:04:47 -07:00
Jeremy Kemper
8aaed3d456
Convert encoding before escaping
2009-04-26 16:21:57 -07:00
Stephen Bannasch
1d71a34afa
add JRuby-JDOM backend for XmlMini
...
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-04-26 16:13:55 -07:00
Jeremy Kemper
ea712364e2
Don't undefine object_id
2009-04-26 15:56:08 -07:00
Jeremy Kemper
3bd32754e2
Privatize rails_to_json
2009-04-26 15:54:28 -07:00
Jeremy Kemper
4a8d2ef0a5
Extract json string escaping
2009-04-26 15:53:59 -07:00
Jeremy Kemper
8d64085138
Only Object to_json alias is needed. Prefer nil options.
2009-04-26 15:18:33 -07:00
Jeremy Kemper
da3a80dd4f
Track object ids so the objects needn't respond to ==
2009-04-26 15:04:02 -07:00
rick
3c4c6bd0df
* Add pluggable JSON backends with support for the JSON gem. [rick]
...
Example: ActiveSupport::JSON.backend = "JSONGem"
All internal Rails JSON encoding is now handled by ActiveSupport::JSON.encode(). Use of #to_json is not recommended, as it may clash with other libraries that overwrite it. However, you can recover Rails specific functionality
if you really want to use #to_json.
gem 'json'
ActiveSupport::JSON.backend = "JSONGem"
class ActiveRecord::Base
alias to_json rails_to_json
end
2009-04-23 00:08:40 -07:00
Jeremy Kemper
f28bd9557c
Fix dependencies revealed by testing in isolation
2009-04-22 18:54:13 -07:00
Jeremy Kemper
5c4ba6e3fc
new_callbacks core extensions
2009-04-22 17:17:31 -07:00
Jeremy Kemper
b2d6fdae35
Fix tests on 1.9
2009-04-22 17:07:04 -07:00
Jeremy Kemper
7f6779c1d5
Merge branch 'master' into cherry
...
Conflicts:
activesupport/lib/active_support.rb
2009-04-22 16:53:58 -07:00
Jeremy Kemper
6fee981fa4
Opt in to JSON
2009-04-22 16:48:58 -07:00
Jeremy Kemper
f5d720fb96
Opt in to Dependencies
2009-04-22 16:42:14 -07:00
Jeremy Kemper
ab321268f8
No more free lunch
2009-04-22 16:10:49 -07:00
Jeremy Kemper
42a06d2d62
stdlib autoloads were hanging on 1.9.1
2009-04-22 09:10:48 -07:00
Jeremy Kemper
a27192f49a
Divert CoreExtensions mention in docs
2009-04-22 00:47:25 -07:00
Jeremy Kemper
b70239b0cf
Convert string extension modules to class reopens
2009-04-22 00:45:39 -07:00
Jeremy Kemper
35afad620b
ActiveSupport.core_ext bridge util no longer used
2009-04-22 00:34:24 -07:00
Jeremy Kemper
e6eb941d1b
Switch last module core extension to class reopen
2009-04-22 00:33:00 -07:00
Jeremy Kemper
685a53a360
Merge branch 'master' into cherry
...
Conflicts:
activesupport/CHANGELOG
activesupport/lib/active_support/core_ext/class/delegating_attributes.rb
activesupport/lib/active_support/core_ext/hash/conversions.rb
activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
activesupport/lib/active_support/core_ext/string/multibyte.rb
activesupport/lib/active_support/core_ext/time/calculations.rb
activesupport/lib/active_support/deprecation.rb
2009-04-20 18:31:40 -07:00
Jeremy Kemper
db05c73fb6
Move AS::Duration autoload to core/time/autoload
2009-04-20 18:14:39 -07:00
Jeremy Kemper
164a94d0bc
Clearer String#first and #last edge cases. Fix that 'foo'.first(0) == 'foo' instead of ''
2009-04-20 00:40:15 -07:00
Jeremy Kemper
5d84c732ee
Treating strings as enumerable is deprecated
2009-04-20 00:32:14 -07:00