Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | removes the mutex around `changed` | Xavier Noria | 2015-11-22 | 1 | -7/+2 |
| | | | | | | | | | | | This method needs to ensure that if a change happens, it is going to be registered. With this refactor suggested by @matthewd race conditions do not matter because if no file is watched, nothing is done. And as long as some invocation sets the flag to true, it will stay true. The refactor leaves a race condition in which two simultaneous threads that watch some of the files passed do the actual work in `any?`, whereas the mutex guaranteed that was done at most once. But this is considered to be a better tradeoff. | ||||
* | reset the @updated flag before the callback invocation | Xavier Noria | 2015-11-21 | 1 | -2/+1 |
| | |||||
* | make the @updated flag atomic in the evented monitor | Xavier Noria | 2015-11-21 | 1 | -5/+11 |
| | | | | listen is calling us from its own thread, we need to synchronize reads and writes to this flag. | ||||
* | Merge pull request #22332 from grosser/grosser/deprecation | Rafael França | 2015-11-20 | 6 | -4/+72 |
|\ | | | | | add deprecations for a smooth transition after #22215 | ||||
| * | add deprecations for a smooth transition after #22215 | Michael Grosser | 2015-11-19 | 6 | -4/+72 |
| | | |||||
* | | Merge pull request #22336 from tjschuck/enumerable_sum_perf | Kasper Timm Hansen | 2015-11-19 | 1 | -1/+1 |
|\ \ | | | | | | | Change Enumerable#sum to use inject(:sym) specification | ||||
| * | | Change Enumerable#sum to use inject(:sym) specification | T.J. Schuck | 2015-11-19 | 1 | -1/+1 |
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not only does this make for simpler, more obvious code, it's also more performant: require 'benchmark/ips' module Enumerable def old_sum(identity = 0, &block) if block_given? map(&block).old_sum(identity) else inject { |sum, element| sum + element } || identity end end def new_sum(identity = 0, &block) if block_given? map(&block).new_sum(identity) else inject(:+) || identity end end end summable = (1..100).to_a # sum is 5050 Benchmark.ips do |x| x.report("old_sum") { summable.old_sum } x.report("new_sum") { summable.new_sum } x.compare! end # Calculating ------------------------------------- # old_sum 10.674k i/100ms # new_sum 14.542k i/100ms # ------------------------------------------------- # old_sum 117.350k (± 7.1%) i/s - 587.070k # new_sum 154.712k (± 3.8%) i/s - 785.268k # # Comparison: # new_sum: 154712.1 i/s # old_sum: 117350.0 i/s - 1.32x slower More benchmarks [here](https://gist.github.com/tjschuck/b3fe4e8c812712376648), including summing strings and passing blocks. The performance gains are less for those, but this version still always wins. | ||||
* / | Add missing require | Matthew Draper | 2015-11-19 | 1 | -0/+2 |
|/ | | | | Fixes #22311 | ||||
* | Using released concurrent-ruby | Rafael Mendonça França | 2015-11-16 | 1 | -1/+1 |
| | |||||
* | Merge pull request #22215 from grosser/grosser/normalize_key | Rafael França | 2015-11-16 | 5 | -39/+39 |
|\ | | | | | send normalized keys to the cache backends so they do not need to man… | ||||
| * | keep deprecated namespaced_key in case any subclass uses it | Michael Grosser | 2015-11-10 | 3 | -2/+3 |
| | | |||||
| * | send normalized keys to the cache backends so they do not need to manage ↵ | Michael Grosser | 2015-11-10 | 5 | -38/+37 |
| | | | | | | | | this themselves | ||||
| * | Merge pull request #22216 from grosser/grosser/fast-ret | Rafael França | 2015-11-10 | 1 | -9/+12 |
| |\ | | | | | | | fast and consistent return when local_cache does not exist | ||||
| | * | fast and consistent return when local_cache does not exist | Michael Grosser | 2015-11-07 | 1 | -9/+12 |
| | | | |||||
| * | | Merge pull request #22244 from pacso/time-days-in-year | Andrew White | 2015-11-10 | 3 | -0/+30 |
| |\ \ | | | | | | | | | Add days_in_year method to Time class | ||||
| | * | | Add days_in_year method | Jon Pascoe | 2015-11-10 | 3 | -0/+30 |
| | | | | |||||
| * | | | Minor fix in Module#mattr_reader documentation | Yuri Kasperovich | 2015-11-09 | 1 | -1/+1 |
| |/ / | |||||
* | | | Use proper syntax for class method reference. | Tyler Hunt | 2015-11-16 | 1 | -1/+1 |
| | | | |||||
* | | | Fix instance variable not defined warning from Active Support test suite | JuanitoFatas | 2015-11-12 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before ./Users/Juan/dev/rails/activesupport/test/file_update_checker_shared_tests.rb:20: warning: instance variable @tmpdir not initialized After No warnings | ||||
* | | | base (refined) Pathname#ascendant_of? also on Pathname#ascend | Xavier Noria | 2015-11-12 | 1 | -7/+2 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A small rewrite in a last attempt at writing obvious and portable code without manual string manipulation. Note that Pathname#== uses string comparison on Windows, so if client code passes "C:\foo" and "c:/foo/bar" the predicate won't see the former is an ascendant of the latter. Risky business. | ||||
* | | | Use the file watcher defined by the app config | Dharam Gollapudi | 2015-11-11 | 1 | -1/+1 |
| | | | | | | | | | This can make use of the FileEventedUpdateChecker, if available. | ||||
* | | | let filter_out_descendants do less passes | Xavier Noria | 2015-11-11 | 1 | -9/+9 |
| | | | | | | | | | | | | | | | | | | Whatever the inner loop selects, we already know is a descendant and can be filtered out right away from dirs_sorted_by_nparts to skip useless iterations. | ||||
* | | | revises the implementation of Pathname#ascendant_of? (in refinement) | Xavier Noria | 2015-11-11 | 2 | -1/+37 |
| | | | |||||
* | | | normalizes spacing in a CHANGELOG [ci skip] | Xavier Noria | 2015-11-11 | 1 | -6/+6 |
| | | | |||||
* | | | update docs for MessageEncryptor#new to recommend a KDF [ci skip] | Paul Kehrer | 2015-11-11 | 1 | -2/+2 |
| | | | |||||
* | | | Add days_in_year method | Jon Pascoe | 2015-11-11 | 3 | -3/+33 |
| | | | |||||
* | | | Minor fix in Module#mattr_reader documentation | Yuri Kasperovich | 2015-11-11 | 1 | -1/+1 |
| | | | |||||
* | | | fast and consistent return when local_cache does not exist | Michael Grosser | 2015-11-11 | 1 | -9/+12 |
| | | | |||||
* | | | modernizes the test definitions in the file monitors suite | Xavier Noria | 2015-11-11 | 1 | -16/+17 |
| | | | |||||
* | | | applies code style guidelines | Xavier Noria | 2015-11-11 | 5 | -14/+14 |
| | | | |||||
* | | | simplifies the implementation of #watching? | Xavier Noria | 2015-11-11 | 1 | -16/+12 |
| | | | |||||
* | | | simplifies directories_to_watch | Xavier Noria | 2015-11-11 | 1 | -7/+4 |
| | | | |||||
* | | | registers these changes in the CHANGELOGs | Xavier Noria | 2015-11-11 | 1 | -0/+11 |
| | | | |||||
* | | | adds a comment about how does filter_out_descendants preserve order | Xavier Noria | 2015-11-11 | 1 | -0/+1 |
| | | | |||||
* | | | rewrites bare loop as until | Xavier Noria | 2015-11-11 | 1 | -3/+1 |
| | | | |||||
* | | | simplifies the implementation of existing parent | Xavier Noria | 2015-11-10 | 1 | -13/+2 |
| | | | |||||
* | | | indents private methods as per our guidelines | Xavier Noria | 2015-11-10 | 1 | -28/+28 |
| | | | |||||
* | | | renames the module with shared tests for file monitors | Xavier Noria | 2015-11-10 | 3 | -5/+5 |
| | | | |||||
* | | | simplifies PathHelper with a Pathname refinement | Xavier Noria | 2015-11-10 | 1 | -22/+22 |
| | | | |||||
* | | | the evented monitor filters out descendants | Xavier Noria | 2015-11-10 | 2 | -10/+66 |
| | | | |||||
* | | | better tmp file management in the monitors suite | Xavier Noria | 2015-11-10 | 1 | -36/+88 |
| | | | |||||
* | | | adds another test case in the monitors suite | Xavier Noria | 2015-11-10 | 1 | -1/+17 |
| | | | |||||
* | | | editorial pass over test method names | Xavier Noria | 2015-11-09 | 1 | -5/+5 |
| | | | |||||
* | | | improves waiting in the file monitors suite | Xavier Noria | 2015-11-09 | 3 | -23/+21 |
| | | | |||||
* | | | adds more tests for the file monitors | Xavier Noria | 2015-11-09 | 1 | -0/+60 |
| | | | |||||
* | | | s/watcher/checker/g | Xavier Noria | 2015-11-08 | 1 | -3/+3 |
| | | | | | | | | | | | | "checker" is the name being used everywhere. | ||||
* | | | more ad-hoc sleeps | Xavier Noria | 2015-11-08 | 1 | -2/+4 |
| | | | | | | | | | | | | This sucks, but otherwise I get occasional Fs on Mac OS X. | ||||
* | | | create the tmpdir under test | Xavier Noria | 2015-11-08 | 1 | -1/+1 |
| | | | | | | | | | | | | | | | Mac OS X tries by all means to hide that /var is /private/var, and that is what FSEvents reports back. | ||||
* | | | encapsulate sleep margin when touching files | Xavier Noria | 2015-11-08 | 1 | -5/+6 |
| | | | |||||
* | | | renames the monitor creation helper | Xavier Noria | 2015-11-08 | 3 | -11/+11 |
| | | |