Commit Graph

3777 Commits

Author SHA1 Message Date
Norman Clarke c973161c38 Remove unused code. 2012-01-05 16:36:21 -03:00
Norman Clarke 262af66d05 Document method definition 2012-01-05 16:36:09 -03:00
Norman Clarke b81bef531c Just use Ruby's String#[]= 2012-01-05 16:26:24 -03:00
Norman Clarke 46579340c0 Assume Encoding support 2012-01-05 16:21:59 -03:00
Norman Clarke d2a4acdbe3 Update to Unicode 6.0 2012-01-05 16:17:12 -03:00
Norman Clarke 4b5a3d7367 Remove useless parens 2012-01-05 16:14:39 -03:00
Karunakar (Ruby) 0023643522 Moved all the logger methods to active support logger
minor
2012-01-06 00:38:46 +05:30
Norman Clarke 60bbdf7d83 Just delegate a few methods directly to @wrapped_string 2012-01-05 15:43:06 -03:00
Norman Clarke f49febe1db Merge branch 'refactor-multibyte-chars' of https://github.com/lest/rails into multibyte
Conflicts:
	activesupport/lib/active_support/multibyte/chars.rb
2012-01-05 15:19:00 -03:00
Aaron Patterson f4ef09c154 Merge pull request #4304 from lest/refactor-truncate
refactor String#truncate not to use mb_chars
2012-01-05 09:23:16 -08:00
Aaron Patterson 1dbbe7b663 Merge pull request #4316 from wrozka/time_advance_nsec
Time advance nsec bug
2012-01-05 09:08:30 -08:00
Santiago Pastorino 3040940ab5 Merge pull request #4320 from castlerock/include_only_minitest
support only MiniTest run with Isolation test
2012-01-05 08:52:29 -08:00
Vishnu Atrai f04af7cf01 ActiveSupport::Testing::Pending support for MiniTest only 2012-01-05 21:33:45 +05:30
Vishnu Atrai 46761b88f0 support only MiniTest run with Isolation test 2012-01-05 21:19:24 +05:30
Vishnu Atrai c776075add parse only minitest results in isolation test 2012-01-05 21:05:13 +05:30
Sergey Nartimov 7301aa2e0d refactor AS::Multibyte::Chars 2012-01-05 18:25:27 +03:00
Norman Clarke c4b522d3c8 Make return value from bang methods match Ruby docs
The docs for the String class indicate that methods like `rstrip!` and
others should return nil when they do not have an effect on the string.
2012-01-05 11:51:10 -03:00
Norman Clarke 4387f97242 Override #slice! to ensure proper return value.
The default pass-through to `method_missing` makes `#slice!` return
`self` rather than the string that was sliced off.
2012-01-05 11:42:03 -03:00
Norman Clarke 5fb5ced0cb Remove overidden slice and slice! methods. 2012-01-05 11:39:45 -03:00
Norman Clarke 963c36004c Fix incorrect behavior specified in test.
This test was actually specifying the opposite of what it should.
2012-01-05 10:50:25 -03:00
Pawel Pierzchala c766f3e4b0 Nano seconds fraction of time is copied properly in Time#advance
When day, month or year was passed, advance created a new time
ignoring previous nsec fraction. Now nsec is passed through
usec as a Rational number.
2012-01-05 13:23:13 +01:00
José Valim f28fc9349b Revert "AS::Callbacks: remove __define_runner"
Runners are used internally.

This reverts commit 40c8aa706a.
2012-01-04 21:26:50 +01:00
Sergey Nartimov 5a7513593f refactor String#truncate not to use mb_chars 2012-01-04 22:30:07 +03:00
Sergey Nartimov ce2c4c977c simplify Class#descendants using singleton_class method 2012-01-04 21:51:39 +03:00
Aaron Patterson cf32a59ed6 Merge pull request #4298 from rafaelfranca/patch-2
Remove rescue block to require psych gem
2012-01-04 09:35:20 -08:00
Rafael Mendonça França 7d26fad384 No need to require psych since require yaml does that. 2012-01-04 14:29:13 -03:00
Rafael Mendonça França b65bdb1527 No need to override to_yaml method in ActiveSupport::TimeWithZone 2012-01-04 14:16:48 -03:00
Rafael Mendonça França 25c76ec8e2 No need to override to_yaml method in ActiveSupport::OrderedHash 2012-01-04 14:15:11 -03:00
Rafael Mendonça França ae7dcb4bec No need to override the to_yaml method in ActiveSupporte::SafeBuffer 2012-01-04 14:14:16 -03:00
Rafael Mendonça França d8ed247c7f No need to override the to_yaml method in BigDecimal 2012-01-04 14:10:55 -03:00
Karunakar (Ruby) a19f8b5ca0 using the active support logger 2012-01-04 22:12:25 +05:30
Rafael Mendonça França 761b049b2e No need to use rescue block to require psych 2012-01-04 13:30:57 -03:00
Rafael Mendonça França 0bf51e9805 No need to check if YAML::ENGINE is defined since ruby 1.9 does that 2012-01-04 13:21:54 -03:00
Rafael Mendonça França 38b9fbf1d9 Whitespaces ✂️ 2012-01-04 12:39:28 -03:00
Rafael Mendonça França 73a0f9df47 Add test to make sure that add two safe buffers always return a safe buffer 2012-01-04 12:37:20 -03:00
Sergey Nartimov 2f8a7edadb use correct variant of checking whether class is a singleton 2012-01-03 23:44:56 +03:00
Xavier Noria e04232e904 Merge pull request #4250 from lest/range-json
use #to_s to convert Range to json
2012-01-02 13:53:52 -08:00
José Valim 44df252382 Merge pull request #4252 from lest/deprecate-activesupport-base64
remove ActiveSupport::Base64 in favor of ::Base64
2012-01-02 11:54:00 -08:00
Sergey Nartimov 0f2f8003d2 remove ActiveSupport::Base64 in favor of ::Base64 2012-01-02 22:48:15 +03:00
José Valim 6f44fa0a8a Merge pull request #4251 from castlerock/rename_ruby_debug_to_ruby_debug19
rename ruby-debug to ruby-debug19
2012-01-01 10:35:28 -08:00
Vijay Dev 881ca628b0 fix a warning about grouped expressions 2012-01-01 23:01:28 +05:30
Sergey Nartimov dc05914be7 use #to_s to convert Range to json 2012-01-01 20:16:10 +03:00
Vishnu Atrai 423dd88d62 rename ruby-debug to ruby-debug19 2012-01-01 22:40:23 +05:30
Vijay Dev f3e079e8b5 Merge pull request #4248 from andrew/2012
Updated copyright notices for 2012
2011-12-31 12:48:19 -08:00
Andrew Nesbitt 1b413510fe Updated copyright notices for 2012 2011-12-31 20:30:08 +00:00
Vishnu Atrai c20a74da4f MiniTest condition removed 2011-12-31 13:52:37 +05:30
José Valim 7c55d6977c Merge pull request #4235 from castlerock/remove_ruby_18_BasicObject
ruby 1.8 ActiveSupport BasicObject no longer available
2011-12-30 10:59:14 -08:00
Vishnu Atrai 7249f94e6c remove condition since to_time always available in ruby19 DateTime 2011-12-31 00:15:21 +05:30
Vishnu Atrai e734f001d3 ruby 1.8 ActiveSupport BasicObject no longer available 2011-12-30 23:45:57 +05:30
José Valim 4b99732552 Merge pull request #4233 from bogdan/remove_define_runner
AS::Callbacks: remove __define_runner
2011-12-30 04:43:45 -08:00
Xavier Noria 9fa59ca208 adds a comments that clarifies why Range#include? chooses the comparison operator 2011-12-30 02:18:07 -08:00
Xavier Noria edfe7d8013 Merge pull request #4229 from lest/range-include
refactor Range#include? to handle ranges with floats
2011-12-30 02:13:37 -08:00
Bogdan Gusiev 2a78886a1d AS::Callbacks: remove __define_runner 2011-12-30 10:53:46 +02:00
Vasiliy Ermolovich 6e5ab54b60 remove ruby 1.8 checking in constantize method 2011-12-29 16:01:10 +03:00
Sergey Nartimov 952e9d9005 refactor Range#include? to handle ranges with floats 2011-12-29 13:26:52 +03:00
Jon Leighton 9bae926ff2 Revert "Merge pull request #4220 from bensie/singleton-class-master"
This reverts commit 90df0d4f68, reversing
changes made to 5e6fc81d63.

Reason: build breakage
2011-12-28 18:27:41 +00:00
Aaron Patterson afe6e059ea Merge pull request #4207 from nashby/deprecate-base64-encode64s
deprecate Base64.encode64s from AS
2011-12-28 10:22:48 -08:00
James Miller cdf7a6013d Further simplify singleton_class checking in class_attribute 2011-12-28 09:19:46 -08:00
Bogdan Gusiev 99433e4ce5 Refactor AS::Callbacks
Extracted `__reset_runner` from `__define_runner`
And call it in proper places
2011-12-28 18:03:18 +02:00
Vasiliy Ermolovich a19d0f5a66 deprecate Base64.encode64s from AS. Use Base64.strict_encode64 instead 2011-12-27 22:46:44 +03:00
Santiago Pastorino 01cde1da6c Merge pull request #4198 from castlerock/remove_GC_checks_for_ruby19
remove conditions for GC::Profiler in ruby19
2011-12-27 04:39:22 -08:00
Miguel Camba 971d257cdd Removed RUBY_ENGINE checks for ruby18 2011-12-27 07:52:41 +01:00
Vishnu Atrai af404acf9f remove conditions for GC::Profiler in ruby19 2011-12-27 08:46:03 +05:30
Santiago Pastorino 3e4d0daedf Merge pull request #4195 from castlerock/remove_19_condition_for_GC_Profiler
GC::Profiler available in ruby19
2011-12-26 14:03:56 -08:00
José Valim 28b008bae3 Merge pull request #4197 from nashby/refactor-range-include
refactor Range#include? for range value
2011-12-26 12:23:36 -08:00
Vasiliy Ermolovich 3f642c9d18 refactor Range#include? for range value 2011-12-26 23:07:27 +03:00
Vishnu Atrai 2443b65101 GC::Profiler available in ruby19 2011-12-27 00:00:22 +05:30
Vishnu Atrai 306c44d284 remove ForClassicTestUnit support for ruby 1.8 2011-12-26 23:32:56 +05:30
Vasiliy Ermolovich 2ba1f46000 remove rexml security fix for rubies 1.8 2011-12-26 19:50:29 +03:00
Xavier Noria 63e14a7969 Merge pull request #4118 from nashby/remove-file-to-path
remove File#to_path alias
2011-12-26 01:28:12 -08:00
Bogdan Gusiev 7e75dc5d86 AS::Callbacks: improved __define_runner performance 2011-12-25 22:23:16 +02:00
Vasiliy Ermolovich a7ba8e1fb3 remove File#to_path alias 2011-12-25 22:22:22 +03:00
Xavier Noria 748725e9ce removes the compatibility method Module#method_names 2011-12-25 11:11:50 -08:00
Xavier Noria 40bda76067 removes the compatibility method Module#instance_method_names 2011-12-25 11:11:49 -08:00
Vishnu Atrai 3f967dc5f9 ::BasicObject always defined in ruby 19 2011-12-26 00:34:48 +05:30
Sergey Nartimov 33fb719667 ruby 1.9 returns method names as symbols 2011-12-25 21:17:48 +03:00
Vasiliy Ermolovich 9e0f5ac7fc Module#name returns nil for anonymous class in ruby 1.9 2011-12-25 20:36:01 +03:00
Sergey Nartimov 8f0d7c8973 remove date methods that are present in 1.9 ruby 2011-12-25 19:03:24 +03:00
José Valim b0a4487b0e Merge pull request #4183 from nashby/blockless-step-range
remove useless 1.8 ruby code from Range#step
2011-12-25 07:56:17 -08:00
José Valim d04428df49 Merge pull request #4182 from bogdan/non_keyed_callbacks
AS::Callbacks: improve __define_runner perfomance for non-keyed callbacks.
2011-12-25 07:55:24 -08:00
Vasiliy Ermolovich 434c691df6 remove useless 1.8 ruby code from Range#step, because Range#step without block always returns enumerator 2011-12-25 18:22:54 +03:00
Bogdan Gusiev 66a587cf55 AS::Callbacks: improve __define_runner perfomance 2011-12-25 16:44:19 +02:00
Vijay Dev 54e522a388 Merge branch 'master' of github.com:lifo/docrails 2011-12-25 19:33:33 +05:30
Sergey Nartimov 1e9e88fcd3 remove checks for encodings availability 2011-12-25 14:34:58 +03:00
Vasiliy Ermolovich daef51ee0a remove Time._dump and Time._load patching for ruby 1.8 2011-12-25 00:09:22 +03:00
Sergey Nartimov 40566dc19b remove deprecated Module#synchronize from ActiveSupport 2011-12-24 21:42:43 +03:00
Sergey Nartimov 5ca86ac8f9 deprecate String#encoding_aware? and remove its usage 2011-12-24 15:57:54 +03:00
Vijay Dev cd2c31a1c4 A few doc changes 2011-12-24 17:29:43 +05:30
Kristian Freeman 2315e96a17 Finished implementation of MIT license linking. 2011-12-23 13:03:21 -08:00
Sergey Nartimov 1922283177 remove Enumerable#each_with_object again
it come back occasionally in 367741ef
2011-12-23 10:20:24 +03:00
Uģis Ozols ee69ef62a8 Remove some of the ActiveSupport core extensions related to 1.8. 2011-12-21 09:29:59 +02:00
Rahul P. Chaudhari e883c06a4f Updated gemspec for ruby 1.9.3 2011-12-21 11:09:01 +05:30
José Valim 9bcd52ffca Merge pull request #4070 from lest/remove-require-enumerator
requiring enumerator is not nessessary in ruby 1.9
2011-12-20 10:18:49 -08:00
Sergey Nartimov e7d827ec50 requiring enumerator is not nessessary in ruby 1.9 2011-12-20 21:14:57 +03:00
Vijay Dev 10a5497f2e NullStore cache belongs in Active Support 2011-12-20 23:44:47 +05:30
José Valim fb1c06a694 Remove more dead code from AS. 2011-12-20 18:38:20 +01:00
José Valim 7ab4775106 Initial pass at removing dead 1.8.x code from Active Support.
There are a bunch of other implicit branches that adds
1.8.x specific code that still needs to be removed. Pull
requests for those cases are welcome.
2011-12-20 18:22:21 +01:00
Vijay Dev 500ca98fef Merge branch 'master' of github.com:lifo/docrails 2011-12-20 22:18:42 +05:30
Xavier Noria 173eacadf1 adds deprecation warnings to the RDoc of Array#uniq_by(!) 2011-12-20 08:08:27 -08:00
Vijay Dev 1a18198af0 remove conflict marker 2011-12-23 01:08:53 +05:30
Aaron Patterson 367741ef22 Revert "Added Enumerable#pluck to wrap the common pattern of collect(&:method) *DHH*"
This reverts commit 4d20de8a50.

Conflicts:

	activesupport/CHANGELOG.md
	activesupport/lib/active_support/core_ext/enumerable.rb
	activesupport/test/core_ext/enumerable_test.rb
2011-12-22 12:21:18 -07:00
José Valim e003bafc11 Merge pull request #4135 from nashby/deprecate-uniq-by
deprecate Array#uniq_by and Array#uniq_by!
2011-12-22 09:22:32 -08:00
Vasiliy Ermolovich c4df2d0b6e deprecate Array#uniq_by and Array#uniq_by! in favor of Array#uniq and Array#uniq! from ruby 1.9 2011-12-22 19:34:39 +03:00
Sergey Nartimov 9d97173c5a no more need to make Time#to_date and Time#to_datetime public
they are public in actual 1.9 ruby version (tested at least in 1.9.2-p180)
2011-12-22 18:53:07 +03:00
José Valim fa5adfb1e8 Update activesupport/lib/active_support.rb 2011-12-22 09:35:22 +01:00
Sergey Nartimov 4f6af26a88 remove AS whiny nil extension and deprecate config.whiny_nils 2011-12-22 10:28:36 +03:00
Vasiliy Ermolovich 7bfaa979e4 remove Proces.daemon from core_ext 2011-12-22 08:43:42 +03:00
José Valim fccc952ccd Merge pull request #4104 from lest/remove-1-8-code
remove Enumerable#each_with_object from core_ext as it is present in ruby 1.9
2011-12-21 11:26:19 -08:00
Aaron Patterson 78ea731a76 Merge pull request #4097 from guilleiguaran/safebuffer-html-escape
We don't need a special html_escape for 1.8 anymore
2011-12-21 09:33:03 -08:00
lest f1b4cacbae remove Enumerable#each_with_object from core_ext as it is present in ruby 1.9 2011-12-21 19:07:00 +03:00
lest a57c6441a8 remove Kernel#singleton_class from core_ext as it is present in ruby 1.9 2011-12-21 18:53:38 +03:00
Vasiliy Ermolovich c52ce1dae2 remove Array#sample from core_ext 2011-12-21 17:31:40 +03:00
Guillermo Iguaran ba7ef5365e We don't need a special html_escape for 1.8 anymore 2011-12-21 08:34:25 -05:00
lest 55943873cd remove dead code as ruby 1.9.3 has Base64 module 2011-12-21 11:48:46 +03:00
Sergey Nartimov b7cfd09466 remove support for ruby 1.8 in AS String extensions 2011-12-21 11:29:10 +03:00
David Heinemeier Hansson 632fa15fa4 rails/master is now 4.0.0.beta and will only support Ruby 1.9.3+ 2011-12-20 09:30:37 -06:00
José Valim 6a6fc4e1db Remove deprecations from Active Support. 2011-12-20 15:18:42 +01:00
Aaron Patterson 572c3d5178 * BufferedLogger is deprecated. Use ActiveSupport::Logger, or the logger
from Ruby stdlib.
2011-12-19 18:41:37 -08:00
David Heinemeier Hansson 9d6e52b55e Party like its R-C-UNO! 2011-12-19 18:34:57 -06:00
Semyon Perepelitsa 2aedb202c1 Fix syntax error in rdocs.
Ruby assumes curly braces in foo {} as a block, for hash we need to put parentheses or omit braces
2011-12-20 01:35:43 +08:00
Vijay Dev aa0286ecbc Revert "Update master changelogs with rails 3.0-stable branch info"
This reverts commit 2bc8e57137.

Reason: Changelogs are not meant to be changed in docrails.
2011-12-18 19:36:32 +05:30
Paco Guzman 2bc8e57137 Update master changelogs with rails 3.0-stable branch info 2011-12-18 11:17:13 +01:00
José Valim 4f35d5a18b Merge pull request #4007 from exviva/expand_cache_key_for_one_element_array
Fix expanding cache key for single element arrays
2011-12-16 14:40:09 -08:00
Olek Janiszewski abe915f237 Fix expanding cache key for single element arrays
In short:
expand_cache_key(element) should not equal expand_cache_key([element])

This way a fragment cache key for an index page with only a single
element in the collection is different than a fragment cache for a
typical show page for that element.
2011-12-16 17:58:25 +01:00
José Valim 1668b900b5 Merge pull request #3963 from lest/logger-missing-require
missing require in buffered logger
2011-12-13 02:33:05 -08:00
José Valim 80256abb39 FileUpdateChecker should be able to handle deleted files. 2011-12-13 11:23:21 +01:00
lest d060d6d131 missing require in buffered logger 2011-12-13 12:36:32 +03:00
José Valim 1f5b9bbdb3 Clean up FileUpdateChecker API. 2011-12-13 10:07:02 +01:00
lest 8a9cf790db missing require in activesupport test 2011-12-13 10:33:58 +03:00
José Valim ffa8bfeed9 Merge pull request #3954 from bdurand/null_store_2
Add ActiveSupport::Cache::NullStore for testing and development
2011-12-12 14:03:50 -08:00
José Valim fa1d9a884c Speed up development by only reloading classes if dependencies files changed.
This can be turned off by setting `config.reload_classes_only_on_change` to false.

Extensions like Active Record should add their respective files like db/schema.rb and db/structure.sql to `config.watchable_files` if they want their changes to affect classes reloading.

Thanks to https://github.com/paneq/active_reload and Pastorino for the inspiration. <3
2011-12-12 22:54:04 +01:00
José Valim 62cda03fa8 Provide a dir => extension API to file update checker. 2011-12-12 22:54:04 +01:00
Brian Durand 04d5eae4e8 Add ActiveSupport::Cache::NullStore to expose caching interface without actually caching for development and test environments. 2011-12-12 13:40:29 -06:00
José Valim 9a51053c1d Update checker returns a boolean if callback was executed or not. 2011-12-12 19:41:17 +01:00
José Valim 57e0c038d6 Allow FileUpdateChecker to work with globs. 2011-12-12 14:57:09 +01:00
Jeremy Kemper 9147613ce0 Remove duplicate html_escape docs 2011-12-11 15:56:21 -07:00
Jeremy Kemper 63cd943226 Use 1.9 native XML escaping to speed up html_escape and shush regexp warnings
length      user     system      total        real
before  6      0.010000   0.000000   0.010000 (  0.012378)
after   6      0.010000   0.000000   0.010000 (  0.012866)
before  60     0.040000   0.000000   0.040000 (  0.046273)
after   60     0.040000   0.000000   0.040000 (  0.036421)
before  600    0.390000   0.000000   0.390000 (  0.390670)
after   600    0.210000   0.000000   0.210000 (  0.209094)
before  6000   3.750000   0.000000   3.750000 (  3.751008)
after   6000   1.860000   0.000000   1.860000 (  1.857901)
2011-12-11 15:51:43 -07:00
Miles Georgi 3d6eafe32e Overrode Hash#nested_under_indifferent_access in HashWithIndifferentAccess
to return self.
2011-12-11 13:08:50 -08:00
Aaron Patterson 4beaa9b839 Try to keep people from calling the deprecated flush method. 2011-12-10 16:31:59 -08:00
José Valim cd7fbcbba8 Fix AS test suite. 2011-12-10 11:17:00 +01:00
Aaron Patterson 04ef93dae6 * ActiveSupport::BufferedLogger#silence is deprecated. If you want to squelch
logs for a certain block, change the log level for that block.

*   ActiveSupport::BufferedLogger#open_log is deprecated.  This method should
    not have been public in the first place.

*   ActiveSupport::BufferedLogger's behavior of automatically creating the
    directory for your log file is deprecated.  Please make sure to create the
    directory for your log file before instantiating.

*   ActiveSupport::BufferedLogger#auto_flushing is deprecated.  Either set the
    sync level on the underlying file handle like this:

        f = File.open('foo.log', 'w')
        f.sync = true
        ActiveSupport::BufferedLogger.new f

    Or tune your filesystem.  The FS cache is now what controls flushing.

*   ActiveSupport::BufferedLogger#flush is deprecated.  Set sync on your
    filehandle, or tune your filesystem.
2011-12-09 16:05:57 -08:00
Vijay Dev 94dcbe8115 fix nodocs 2011-12-09 01:15:54 +05:30
José Valim d1abf29e79 Remove NilClass whiners feature.
Removing this feature causes boost in performance when using Ruby 1.9.

Ruby 1.9 started to do implicit conversions using `to_ary` and `to_str`
in some STDLIB methods (like Array#join). To do such implicit conversions,
Ruby 1.9 always dispatches the method and rescues the NoMethodError exception
in case one is raised.

Therefore, since the whiners feature defined NilClass#method_missing, such
implicit conversions for nil became much, much slower. In fact, just defining
NilClass#method_missing (even without the whiners feature) already causes a
massive slow down. Here is a snippet that shows such slow down:

    require "benchmark"
    Benchmark.realtime { 1_000.times { [nil,nil,nil].join } }

    class NilClass
      def method_missing(*args)
        raise NoMethodError
      end
    end

    Benchmark.realtime { 1_000.times { [nil,nil,nil].join } }
2011-12-08 20:28:09 +01:00
Mark Rushakoff 6f253fb440 Fix inflection regexes for mouse, mice 2011-12-07 23:14:02 -08:00
José Valim 885a599303 Just track "require" if we have something in the watching stack.
A patch has been provided earlier and we have asked for feedback:

    https://gist.github.com/1437939

Except one case, all other cases showed improvements in boot time.
2011-12-06 21:09:44 +01:00
Aaron Patterson a2f7c1dc67 make method signatures match the superclass signature 2011-12-05 18:36:27 -08:00
Aaron Patterson b942ae836e return value is never tested, so stop calling `presence` 2011-12-05 18:36:08 -08:00
Aaron Patterson c24928c3ad Merge pull request #3845 from sumbach/test-return-value-from-require
Add tests for the return value of require
2011-12-04 11:22:09 -08:00
Sam Umbach cfc467f73e Simplify load and require tests
- These tests don't use autoloading so there's no need to add anything to autoload_paths
2011-12-03 13:11:02 -05:00
Sam Umbach 2a9f063082 Test that require and load raise LoadError if file not found 2011-12-03 13:08:18 -05:00
Sam Umbach 0a485309a0 Test return value of ActiveSupport::Dependencies::Loadable#load 2011-12-03 12:58:41 -05:00
Sam Umbach 93580f4936 Test return value of ActiveSupport::Dependencies::Loadable#require
- Add tests to protect from regressions in require's return value behavior
- See a10606c490 (require needs to return true or false) for the original bug fix
2011-12-03 11:52:25 -05:00
Jon Jensen 0e17cf17eb Restore performance of ERB::Util.html_escape
Revert html_escape to do a single gsub again, but add the "n" flag (no
language, i.e. not multi-byte) to protect against XSS via invalid utf8

Signed-off-by: José Valim <jose.valim@gmail.com>
2011-12-03 10:36:52 +01:00
David Heinemeier Hansson 4d20de8a50 Added Enumerable#pluck to wrap the common pattern of collect(&:method) *DHH* 2011-12-02 13:00:56 +01:00
Aaron Patterson 5b3d4f0785 switch WatchStack to use composition, tighten up API 2011-11-30 10:17:27 -08:00
José Valim 5b2eb64ceb Revert "Implement ArraySerializer and move old serialization API to a new namespace."
This reverts commit 8896b4fdc8.

Conflicts:

	activemodel/lib/active_model.rb
	activemodel/lib/active_model/serializable.rb
	activemodel/lib/active_model/serializer.rb
	activemodel/test/cases/serializer_test.rb
2011-11-30 18:48:17 +01:00
Aaron Patterson be99f0c7eb Revert "avoid hundreds of thousands of calls to (Symbol|String)#to_s"
Test coverage isn't comprehensive enough to catch what this breaks. :(
This reverts commit 45dad592e4.
2011-11-30 09:46:35 -08:00
Aaron Patterson 45dad592e4 avoid hundreds of thousands of calls to (Symbol|String)#to_s 2011-11-30 09:08:30 -08:00
José Valim 38ab982cff Log 'Filter chain halted as CALLBACKNAME rendered or redirected' every time a before callback halts. 2011-11-30 09:53:09 +01:00
Aaron Patterson d9c2882077 Module#synchronize is deprecated with no replacement. Please use `monitor` from ruby's standard library. 2011-11-29 15:40:46 -08:00
Claudio Poli 2a76f33b51 Fix typo in AS::TaggedLogging 2011-11-29 00:26:58 +01:00
Xavier Noria 152bd3c510 Revert "Used any? instead of length call"
Reason: This is slower, and any? is not equivalent in the
general case.

See discussion in https://github.com/rails/rails/pull/3779

This reverts commit 20cbf8eddc.
2011-11-28 11:07:01 +01:00
Rahul P. Chaudhari 20cbf8eddc Used any? instead of length call 2011-11-28 12:07:31 +05:30
Yehuda Katz 3c81fc3b91 Merge pull request #3767 from tadast/object_in
Object#in? also accepts multiple parameters
2011-11-26 18:10:48 -08:00
Tadas Tamošauskas ebf69ab163 Object#in? also accepts multiple parameters 2011-11-26 23:51:09 +00:00
Vijay Dev d157ca881b add more tests for monday and sunday methods 2011-11-26 23:53:57 +05:30
Arun Agrawal cd6c5677fb Tests added for monday and sunday
Reference commits : 
a8f2860d0e
80ac4dc6d0
2011-11-26 23:37:01 +05:30
Vijay Dev 80ac4dc6d0 Adds Time#sunday method 2011-11-26 23:15:11 +05:30
Vijay Dev a8f2860d0e Convert aliases monday and sunday to methods
A recent change to beginning_of_week and end_of_week added an argument
that can be used to specify the week's starting day as a symbol. Now
these methods were aliased as monday and sunday respectively which as a
consequence of the argument addition, made calls like obj.monday(:sunday)
possible. This commit makes them methods on their own.
2011-11-26 23:08:58 +05:30
Vijay Dev 99ff8fdab5 minor doc changes 2011-11-26 22:06:47 +05:30
Xavier Noria a5b362df56 some tweaks to PR#3547. [Closes #3547] 2011-11-25 12:02:49 -08:00
gregolsen 7a33a005d7 API docstrings updated with default value info 2011-11-25 12:02:49 -08:00
gregolsen 3f1a4c3415 beginning_of_week extended in both Time and Date so that to return week start based on start day that is monday by default 2011-11-25 12:02:49 -08:00
José Valim 7fcc8c0a1f Rely solely on active_model_serializer and remove the fancy constant lookup. 2011-11-23 23:45:27 +00:00
José Valim 8896b4fdc8 Implement ArraySerializer and move old serialization API to a new namespace.
The following constants were renamed:

  ActiveModel::Serialization     => ActiveModel::Serializable
  ActiveModel::Serializers::JSON => ActiveModel::Serializable::JSON
  ActiveModel::Serializers::Xml  => ActiveModel::Serializable::XML

The main motivation for such a change is that `ActiveModel::Serializers::JSON`
was not actually a serializer, but a module that when included allows the target to be serializable to JSON.

With such changes, we were able to clean up the namespace to add true serializers as the ArraySerializer.
2011-11-23 23:18:15 +00:00
José Valim 0536ea8c78 Add safe_constantize to ActiveSupport::Dependencies. 2011-11-23 21:43:03 +00:00
José Valim e62de52aa3 Merge branch 'master' into serializers 2011-11-23 20:43:06 +00:00
José Valim 3ee0116c94 Optimize cache expansion by skipping rails cache id in nested keys. 2011-11-23 18:22:09 +00:00
Olek Janiszewski a650dd05f8 Fix #3737 AS::expand_cache_key generates wrong key in certain situations (part 2)
`nil` and `false` both expand to `""` (empty string), while `true` expands to
`"true"`; `false` should expand to `"false"`
2011-11-23 18:11:38 +01:00
Olek Janiszewski d8e6dc9cf1 Fix #3737 AS::expand_cache_key generates wrong key in certain situations
`cache_key` method is never called when the argument is a 1-element array
with something that responds to `cache_key`
2011-11-23 18:06:16 +01:00
Yehuda Katz a93ee92da2 Merge pull request #3725 from marcandre/twz_eql
Fix inconsistencies with Time{WithZone}#{hash,eql?}
2011-11-22 13:01:37 -08:00
Marc-Andre Lafortune a4912078c7 Fix inconsistencies with Time{WithZone}#{hash,eql?} 2011-11-22 15:37:16 -05:00
Vijay Dev 8cae31c800 remove nodoc on OrderedHash 2011-11-22 17:12:37 +05:30
Xavier Noria 8f57bf207f tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false
Respecting Genuine assert_equal false Edition
2011-11-21 14:22:16 -08:00
José Valim 401393b656 Deprecate InstanceMethods namespace handling in ActiveSupport::Concern.
This avoids the unnecessary "yo dawg, I heard you like include, so I put a module that includes your module when it is included" approach when building extensions.
2011-11-21 22:17:35 +00:00
Xavier Noria f312e2142b Revert "tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false"
Reason: there were some genuine tests for false when
reading values, going to revise those ones.

This reverts commit a539a5e3f3.
2011-11-21 14:14:11 -08:00
Xavier Noria a539a5e3f3 tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false 2011-11-21 14:11:40 -08:00
Xavier Noria f3554777b2 cache entry: options[:compressed] is a regular flag, no need for !! 2011-11-21 14:01:53 -08:00
Xavier Noria 91678a5b29 adds a comment to clarify an edge case 2011-11-21 13:53:40 -08:00
Xavier Noria 60e3e218c2 a couple of spurious spaces I saw in passing 2011-11-21 22:11:31 +01:00
Santiago Pastorino 4cdd44e3e0 Merge pull request #3668 from gregolsen/api_docstring_fix
updating API docstring so that user can infer default value
2011-11-19 11:52:44 -08:00
Philip Arndt e375970725 Fixed typo: expect -> expected 2011-11-18 10:17:16 +13:00
gregolsen 8d83e339fc updating API docstring so that user can infer default value 2011-11-17 22:17:33 +02:00
Vijay Dev 83bf0b626c refactor test_multiple_of 2011-11-16 02:36:36 +05:30
Bogdan Gusiev 3dc80b7fdf AS::Callbacks::Callback refactor
In order to make Callbacks code always operate on valid peaces of code
Concatenated Callback#start and Callback#end method into #apply
method.
2011-11-15 10:33:25 +02:00
Vijay Dev e0efe48c45 Merge branch 'master' of github.com:lifo/docrails 2011-11-13 22:29:26 +05:30
Cheah Chu Yeow a02b40a3d2 Fix "in memory" where it should be "in-memory". 2011-11-13 13:18:55 +08:00
Bogdan Gusiev 8483c7c0a6 AS::Callbacks::Callback#_compile_option refactored 2011-11-11 14:27:40 +02:00
Vijay Dev 9fd0cd3a12 Revert "Fix "in memory" where it should be "in-memory"."
This reverts commit e34e4d4330.

Reason: code changes are not allowed in docrails.
2011-11-11 17:12:42 +05:30
Cheah Chu Yeow df5c9fd9f4 Update Memcached website to its new one at http://memcached.org/. 2011-11-11 17:07:02 +08:00
Cheah Chu Yeow e34e4d4330 Fix "in memory" where it should be "in-memory". 2011-11-11 17:04:50 +08:00
Bogdan Gusiev 08cc49b919 AS::Callbacks.__run_keyed_callback: remove unused cache 2011-11-10 16:42:27 +02:00
José Valim 80f96ebcf5 self.class.name -> self.name (we are already inside a class). 2011-11-10 08:57:09 -02:00
José Valim c778f4e84b Merge pull request #3593 from bogdan/callbacks
AS::Callbacks._define_runner better abstraction
2011-11-10 02:50:46 -08:00
Bogdan Gusiev bf6e29e007 AS::Callbacks#_define_runner refactored
Incapsulate the logic of keyed callback method definition and execution
in the separated method.
2011-11-10 10:25:27 +02:00
José Valim a625523e75 Don't marshal dump twice when using encryptor. 2011-11-09 20:21:52 -02:00
José Valim 71e84a3b51 Deprecated ActiveSupport::MessageEncryptor#encrypt and decrypt. 2011-11-09 20:04:42 -02:00
Vijay Dev f5ca190bd3 fix typo again (Thanks Phillip Oertel) 2011-11-08 10:37:06 +05:30
Aaron Patterson 6a29ea04ae Merge pull request #3549 from luckydev/rmethod
remove_method tests and changes
2011-11-07 03:02:26 -08:00
Anand aabd61af8e added remove_method core_ext tests 2011-11-07 16:22:52 +05:30
Aaron Patterson bcdc2c00d3 Merge pull request #3541 from dvyjones/fix-datetime-warnings
Removed argument throwing warnings when running tests
2011-11-06 19:00:07 -08:00
Henrik Hodne 9a7d916ceb Removed argument throwing warnings when running tests.
The last argument to DateTime.new/civil is the Julian day number for
when the calendar reform occured. DateTime ignores it if it's 0, and
sets it to the default of DateTime::ITALY instead, so we could just
leave it out. This also removes the warnings while running the
ActiveSupport tests (there still are some for the setup though).
2011-11-06 17:35:02 +01:00
Vijay Dev 4db1bd37cb fix typo 2011-11-06 22:03:30 +05:30
Pavan Kumar Sunkara 1934b77406 Added the test case for #3537 2011-11-06 19:22:46 +05:30
José Valim a02bb72cf7 Merge pull request #3537 from dvyjones/refactor-pluralize-singularize
Refactored pluralize and singularize into a common method
2011-11-06 02:20:06 -08:00
Henrik Hodne 52fa34faee Refactored pluralize and singularize into a common method.
See diff discussion on rails/#3536.
2011-11-06 11:13:51 +01:00
Xavier Noria 56f16e25e9 fixes typo 2011-11-05 12:09:18 -07:00
Xavier Noria d287e90870 implements AS::Notifications.subscribed, which provides subscriptions to events while a block runs 2011-11-05 12:02:54 -07:00
Xavier Noria b33232f1b2 expands the documentation of AS::Notifications 2011-11-05 10:29:41 -07:00
Vijay Dev 55621504b0 make class name consistent with the filename 2011-11-05 22:31:39 +05:30
Franck Verrot 1679aa56f3 Synchronize the gemspecs since CHANGELOG has been renamed to CHANGELOG.md 2011-11-04 14:46:39 +01:00
Jon Leighton 281272ad36 Convert CHANGELOGs to Markdown format.
Reasons:

 * Markdown reads well as plain text, but can also be formatted.
 * It will make it easier for people to read on the web as Github
   formats the Markdown nicely.
 * It will encourage a level of consistency when people are writing
   CHANGELOG entries.

The script used to perform the conversion is at
https://gist.github.com/1339263
2011-11-04 12:55:17 +00:00
kennyj 7670a5187d Refactor ActiveSupport::Cache::FileStore. used method and deleted duplicate code. 2011-10-30 21:50:17 +09:00
kennyj 38da6249f0 fix a document for :compress_threshold. DEFAULT_COMPRESS_LIMIT is 16K. 2011-10-30 19:18:23 +09:00
Xavier Noria 9d1ba3755e fixes a typo (thanks to Alexey Vakhov) 2011-10-30 02:08:59 -07:00
Santiago Pastorino 75ee4d97ef Merge pull request #3464 from kennyj/avoid_to_call_twice
avoided to call `Marshal.dump` twice
2011-10-29 19:18:46 -07:00
Xavier Noria 11f6795b23 defines Module#qualified_const_(defined?|get|set) and String#deconstantize
This commit also implements a faster version of #demodulize I was unable
to isolate with git add --patch.

Not a big fan of the name #deconstantize. It complements #demodulize
getting rid of the rightmost constant, hence the name, but it is
unrelated to the well-known #constantize. So unsure. Could not come
with anything better, please feel free to rename.
2011-10-29 18:10:45 -07:00
Santiago Pastorino 8ef1bd9b29 Merge pull request #3463 from kennyj/fix_document_for_cache
fix a document for race_condition_ttl. ActiveSupport::Cache::MemoryCache isn't exist.
2011-10-29 17:53:00 -07:00
kennyj 3b546afd04 avoided to call twice 2011-10-30 03:14:35 +09:00
kennyj 7b65d12db5 fix a document for race_condition_ttl. ActiveSupport::Cache::MemoryCache isn't exist 2011-10-30 01:55:09 +09:00
kennyj 596d625c9b removed reference to SynchronizedMemoryStore and CompressedMemCacheStore (the remaining code from 9cafc28874) 2011-10-30 01:32:02 +09:00
Xavier Noria 0fc531392d let demodulize do less work, and add tests
This is also faster on 1.9.
2011-10-29 01:07:54 -07:00
José Valim 771ca79f74 Revert "Merge pull request #3395 from bdurand/fix_file_store_cleanup"
Tests were failing on Travis-CI.

This reverts commit 79d01a8f16, reversing
changes made to b838570bd6.
2011-10-25 22:23:25 +02:00
Arun Agrawal b6fc41275c Unused variable removed 2011-10-24 21:56:27 +05:30
José Valim 79d01a8f16 Merge pull request #3395 from bdurand/fix_file_store_cleanup
Fix ActiveSupport::Cache::FileStore.cleanup to actually work.
2011-10-21 12:42:06 -07:00
Brian Durand ec93f363ca Fix ActiveSupport::Cache::FileStore.cleanup to actually work. 2011-10-21 13:28:24 -05:00
Brian Durand d565fda5f2 Fix threading issues with BufferedLogger. 2011-10-21 12:43:52 -05:00
Arun Agrawal c495cbcda9 Checking blank if tag might coming nil or blank
In log it should not show the empty array.
2011-10-21 16:11:09 +05:30
Vijay Dev af1b5c54cf Merge branch 'master' of github.com:lifo/docrails 2011-10-20 23:20:44 +05:30
Martin Svalin 274c3fad50 Fixed misleading docs for String#to_formatted_s(:db) 2011-10-20 16:31:23 +02:00
José Valim 6c126015a6 Ensure TaggegLogging is thread safe. 2011-10-19 22:26:56 +02:00
David Heinemeier Hansson 18dbfcb363 Programatically define the log level methods and use the Logger constants instead (SyslogLogger didnt define them as I expected) 2011-10-19 14:54:00 -05:00
David Heinemeier Hansson afde6fdd5e Added X-Request-Id tracking and TaggedLogging to easily log that and other production concerns 2011-10-19 12:59:33 -05:00
José Valim 59d6df5c69 Merge pull request #3151 from zenprogrammer/pluralize_without_count
Added include_count parameter to pluralize.
2011-10-17 07:02:39 -07:00
Jose and Yehuda 598fc578fb Don't unnecessarily use String eval. 2011-10-15 18:40:37 +02:00
Yasuo Honda 281b8caf80 Fixed test_nonexisting_method_with_arguments to revert commit 29a5aea 2011-10-06 07:44:48 -04:00
José Valim 82d41c9698 Revert "don't raise NoMethodError the tried method doesn't exists"
This reverts commit 29a5aeaae9.
2011-10-06 00:37:15 +02:00
Akira Matsuda 87eab595d8 ruby193: String#prepend is also unsafe 2011-10-05 15:26:29 +09:00
Akira Matsuda 9c4fe308b6 override unsafe methods only if defined on String 2011-10-05 15:26:28 +09:00
Ayrton De Craene 02b0f8d9ff to_formatted_s is an instance method for a Range not an Array 2011-10-04 15:21:23 +03:00