Commit Graph

3454 Commits

Author SHA1 Message Date
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 2bc8e5713764b2276036fecfd7f297132597fddb.

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
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 a10606c490471d8e1483acb3b31d7f2d51e9ebbe (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 8896b4fdc8a543157cdf4dfc378607ebf6c10ab0.

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 45dad592e47944704ab6951351b2fa29d4a2385f.
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 20cbf8eddc3844126d20f1218f068889d17b0dcf.
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 : 
a8f2860d0e7db86c61bb70935006100b04667ab1
80ac4dc6d0632937ccf61b38bc15fc2f6e27b18b
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