Commit Graph

1311 Commits

Author SHA1 Message Date
David Lee
94617d7da1 Optimize parts of HashWithIndifferentAccess 2011-05-17 03:01:31 -07:00
José Valim
6733721520 Deprecate attr_accessor_with_default. 2011-05-16 11:31:34 -04:00
Santiago Pastorino
c53d3929cd Add missing requires 2011-05-11 13:05:04 -03:00
Aaron Patterson
8f999a3f80 make sure log file is written in binary mode. fixes #497 2011-05-10 13:23:05 -07:00
prakashmurthy
6b31fd8070 Lighthouse ticket # 6334; added tests to verify that spaces in key are dasherized. 2011-05-08 06:13:18 -06:00
David Lee
099eb2b3fd indifferent access should recurse Hash subclasses
This commit makes Hash subclasses convert to HWIA by default for nested
objects of subclasses of Hash, but allows certain subclasses to prevent nested
conversion by introducing Hash#nested_under_indifferent_access that subclasses
can overwrite.

ActiveSupport::OrderedHash is one such subclass that overwrites
+nested_under_indifferent_access+, since implicitly converting it to HWIA would
remove the ordering of keys and values in Ruby 1.8.

This change is necessary because commit ce9456e broke nested indifferent access
conversion for all subclasses of Hash.
2011-05-08 03:40:51 -07:00
Mike Gehard
0bc91a4cf7 Rename duplicate tests. There is now one failing test that was failing before the rename but was never getting run. 2011-05-07 17:02:42 -06:00
José Valim
0ef978d1d2 Revert "Merge pull request #275 from pk-amooma/master"
Several AP tests fail after this change.

This reverts commit aaf01cd537, reversing
changes made to 9cc18c52fa.
2011-05-07 23:45:15 +02:00
José Valim
803548c46b xml_mini_test.rb now runs. 2011-05-07 22:45:06 +02:00
Jason
3880ab0d7c ordinalize negative numbers patch
Applied patch by Amir Manji
  https://github.com/rails/rails/issues/437#issuecomment-1116045

Signed-off-by: Jason <jasonmichaelroth@gmail.com>
2011-05-07 13:21:00 -06:00
José Valim
f77cd7c7b6 Merge pull request #286 from jasoncodes/marshal_subsec
Fix marshal round-tripping of fractional seconds (Time#subsec).
2011-05-07 04:39:50 -07:00
José Valim
aaf01cd537 Merge pull request #275 from pk-amooma/master
properly escape "'" to "'" for XML
2011-05-07 03:41:26 -07:00
José Valim
b011a7a938 Merge remote branch 'rolftimmermans/desc_tracker' 2011-05-07 12:26:45 +02:00
José Valim
a761d77902 Merge pull request #248 from bigfix/enumerable_as_json
Enumerable should pass encoding options to children in #as_json/#to_json
2011-05-07 03:19:56 -07:00
José Valim
a6ef255ff5 Merge pull request #349 from bradley178/master
Hash.from_xml chokes on empty CDATA
2011-05-07 02:58:16 -07:00
José Valim
894bdbd53d Move variables to underscore format, update protected instance variables list. 2011-05-06 14:57:25 +02:00
Bradley Harris
aba149d702 Fix bug with empty CDATA not being handled in Hash.from_xml 2011-04-29 14:47:49 -04:00
Bradley Harris
2450177656 Added test for empty CDATA bug in from_xml 2011-04-29 14:09:06 -04:00
José Valim
182d00897a Merged pull request #219 from panthomakos/memcache.
Character encoding issues with MemCacheStore in 1.9.2
2011-04-28 00:40:42 -07:00
José Valim
5297049e32 Merged pull request #328 from MSNexploder/fix_clear_inflector.
proper reset all inflector scopes
2011-04-28 00:19:13 -07:00
Jared McFarland
74634d452b fixing Array#from to return consistent results 2011-04-26 14:46:52 -07:00
Philipp Kempgen
474e313d02 test "Escapes special HTML/XML characters" do ... 2011-04-26 01:05:41 +02:00
Stefan Huber
ba9891f13d proper reset all inflector scopes 2011-04-25 02:17:22 +01:00
José Valim
f7538808d4 File watcher won't make the cut for 3.1. Maybe on 3.2. 2011-04-23 00:00:30 +02:00
Josh Kalderimis
1d8be7bc6f AS Json parse_error makes a return for backwards compatibility, although it will return MultiJson::DecodeError 2011-04-19 00:01:50 +02:00
Josh Kalderimis
e019587e31 removed AS backends and instead rely on MultiJson for json decoding 2011-04-18 21:39:15 +02:00
David Heinemeier Hansson
39372964d2 Add String#inquiry as a convenience method for turning a string into a StringInquirer object [DHH] 2011-04-18 10:57:38 +02:00
Jason Weathered
96546bb63b Fix marshal round-tripping of fractional seconds (Time#subsec). 2011-04-17 21:10:02 +10:00
Jared McFarland
cd233dd87e Only rescue a thrown NoMethodError, don't preemptively check for #include?; added tests 2011-04-15 00:36:07 +08:00
Andre Arko
7660e7cb4d attributes no longer disappear if a tag contains whitespace
old:
Hash.from_xml("<tag foo='bar'>\n</tag>")
=> {"tag"=>"\n"}

new:
Hash.from_xml("<tag foo='bar'>\n</tag>")
=> {"tag"=>{"foo"=>"bar", "__content__"=>"\n"}
2011-04-14 16:33:41 +08:00
Ben Orenstein
4db4f8c624 Add tests for InheritableOptions.
[#6625 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-04-13 23:30:58 -03:00
Prem Sichanugrist
733bfa63f5 Remove #among? from Active Support
After a long list of discussion about the performance problem from using varargs and the reason that we can't find a great pair for it, it would be best to remove support for it for now.

It will come back if we can find a good pair for it. For now, Bon Voyage, `#among?`.
2011-04-13 20:25:28 +08:00
Sebastian Martinez
a616e7a88c Update test name to the corresponding method name
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-04-12 21:04:00 -03:00
David Heinemeier Hansson
d1575ae1b9 Change Object#either? to Object#among? -- thanks to @jamesarosen for the suggestion! 2011-04-12 00:23:07 +02:00
Prem Sichanugrist
a9f3c9da01 Using Object#in? and Object#either? in various places
There're a lot of places in Rails source code which make a lot of sense to switching to Object#in? or Object#either? instead of using [].include?.
2011-04-11 03:17:09 +08:00
Prem Sichanugrist, Brian Morearty, John Reitano
635d991683 Add support for Object#in? and Object#either? in Active Support [#6321 state:committed]
This will allow you to check if an object is included in another object
or the list of objects or not.

This patch is derived from patch by Brian Morearty and John Reitano on
Lighthouse ticket. I've rewrite it and make sure that we support both
'another object' and 'list of objects' version, as it surely be useful
to support both.
2011-04-11 03:17:08 +08:00
Josh Kalderimis
e9020b4b5d added find_zone and find_zone! to AS timezones and changed the AS Railtie to use find_zone! as well as adding Railtie tests
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-04-05 17:12:09 -03:00
Marc-Andre Lafortune
1c4db4d7c3 Raise on invalid timezone
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-04-05 17:11:13 -03:00
John Firebaugh
080e2a7abf Enumerable should pass encoding options to children in #as_json/#to_json. 2011-04-01 12:16:54 -07:00
Rolf Timmermans
512057d386 Merge remote-tracking branch 'upstream/master' into desc_tracker 2011-03-27 17:18:32 +02:00
Diego Carrion
a1edbf7206 parse dates to yaml in json arrays
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-22 21:09:54 -03:00
Diego Carrion
7004434ad8 test json decoding with time parsing disabled with all backends and respect ActiveSupport.parse_json_times when converting to yaml
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-22 21:09:54 -03:00
Rolf Timmermans
76e4e2fa46 Refactored AS::DescendantsTracker test cases so they can be tested without AS::Dependencies. 2011-03-13 17:04:01 +01:00
Rolf Timmermans
56a0cba7be Missing dependency in MultiByte test. 2011-03-13 17:03:45 +01:00
Rolf Timmermans
e75774e216 Add missing dependency string inflection test. 2011-03-13 17:03:38 +01:00
Rolf Timmermans
36313430fa Missing dependency for duration test. 2011-03-13 17:03:31 +01:00
Rolf Timmermans
1a3fe8ce42 Prevent callbacks in child classes from being executed more than once. 2011-03-13 01:35:29 +08:00
Pan Thomakos
72759f5867 Fixed special character encoding issue with MemCacheStore in Ruby 1.9.2. 2011-03-11 17:57:28 -08:00
Aaron Pfeifer
9798ee2619 Add better test scenario for around callback return results 2011-03-08 15:01:06 +08:00
Aaron Pfeifer
df615f127e Allow access to a callback event's return result from around callbacks 2011-03-08 15:01:05 +08:00