aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2015-11-11 06:38:18 +0100
committerXavier Noria <fxn@hashref.com>2015-11-11 06:42:49 +0100
commitf3516f171b7a975e1d3d8aaa37f721476fe49806 (patch)
tree52fdbca73f67ea5d5176dda1410f89a2dbb98eac
parent40a1945d67869f660e7b07120a74106b0150ff23 (diff)
downloadrails-f3516f171b7a975e1d3d8aaa37f721476fe49806.tar.gz
rails-f3516f171b7a975e1d3d8aaa37f721476fe49806.tar.bz2
rails-f3516f171b7a975e1d3d8aaa37f721476fe49806.zip
applies code style guidelines
-rw-r--r--activesupport/lib/active_support/file_evented_update_checker.rb12
-rw-r--r--activesupport/lib/active_support/file_update_checker.rb2
-rw-r--r--activesupport/test/file_evented_update_checker_test.rb10
-rw-r--r--activesupport/test/file_update_checker_shared_tests.rb2
-rw-r--r--activesupport/test/file_update_checker_test.rb2
5 files changed, 14 insertions, 14 deletions
diff --git a/activesupport/lib/active_support/file_evented_update_checker.rb b/activesupport/lib/active_support/file_evented_update_checker.rb
index 6375de4a7d..ae500d697f 100644
--- a/activesupport/lib/active_support/file_evented_update_checker.rb
+++ b/activesupport/lib/active_support/file_evented_update_checker.rb
@@ -4,13 +4,13 @@ require 'pathname'
module ActiveSupport
class FileEventedUpdateChecker #:nodoc: all
- def initialize(files, dirs={}, &block)
+ def initialize(files, dirs = {}, &block)
@ph = PathHelper.new
- @files = files.map {|f| @ph.xpath(f)}.to_set
+ @files = files.map { |f| @ph.xpath(f) }.to_set
@dirs = {}
dirs.each do |dir, exts|
- @dirs[@ph.xpath(dir)] = Array(exts).map {|ext| @ph.normalize_extension(ext)}
+ @dirs[@ph.xpath(dir)] = Array(exts).map { |ext| @ph.normalize_extension(ext) }
end
@block = block
@@ -43,7 +43,7 @@ module ActiveSupport
def changed(modified, added, removed)
unless updated?
- @updated = (modified + added + removed).any? {|f| watching?(f)}
+ @updated = (modified + added + removed).any? { |f| watching?(f) }
end
end
@@ -68,7 +68,7 @@ module ActiveSupport
end
def directories_to_watch
- dtw = (@files + @dirs.keys).map {|f| @ph.existing_parent(f)}
+ dtw = (@files + @dirs.keys).map { |f| @ph.existing_parent(f) }
dtw.compact!
dtw.uniq!
@@ -126,7 +126,7 @@ module ActiveSupport
def filter_out_descendants(directories)
return directories if directories.length < 2
- sorted_by_nparts = directories.sort_by {|dir| dir.each_filename.to_a.length}
+ sorted_by_nparts = directories.sort_by { |dir| dir.each_filename.to_a.length }
descendants = []
until sorted_by_nparts.empty?
diff --git a/activesupport/lib/active_support/file_update_checker.rb b/activesupport/lib/active_support/file_update_checker.rb
index 78b627c286..1fa9335080 100644
--- a/activesupport/lib/active_support/file_update_checker.rb
+++ b/activesupport/lib/active_support/file_update_checker.rb
@@ -35,7 +35,7 @@ module ActiveSupport
# This method must also receive a block that will be called once a path
# changes. The array of files and list of directories cannot be changed
# after FileUpdateChecker has been initialized.
- def initialize(files, dirs={}, &block)
+ def initialize(files, dirs = {}, &block)
@files = files.freeze
@glob = compile_glob(dirs)
@block = block
diff --git a/activesupport/test/file_evented_update_checker_test.rb b/activesupport/test/file_evented_update_checker_test.rb
index f98b656d10..9d09cbca8f 100644
--- a/activesupport/test/file_evented_update_checker_test.rb
+++ b/activesupport/test/file_evented_update_checker_test.rb
@@ -5,7 +5,7 @@ require 'file_update_checker_shared_tests'
class FileEventedUpdateCheckerTest < ActiveSupport::TestCase
include FileUpdateCheckerSharedTests
- def new_checker(files=[], dirs={}, &block)
+ def new_checker(files = [], dirs = {}, &block)
ActiveSupport::FileEventedUpdateChecker.new(files, dirs, &block).tap do
wait
end
@@ -61,7 +61,7 @@ class FileEventedUpdateCheckerPathHelperTest < ActiveSupport::TestCase
/foo/bar
/foo/baz
/foo/bar/baz/woo/zoo
- ).map {|path| pn(path)}
+ ).map { |path| pn(path) }
assert_equal pn('/foo'), @ph.longest_common_subpath(paths)
end
@@ -72,7 +72,7 @@ class FileEventedUpdateCheckerPathHelperTest < ActiveSupport::TestCase
/foo/baz
/foo/bar/baz/woo/zoo
/wadus
- ).map {|path| pn(path)}
+ ).map { |path| pn(path) }
assert_equal pn('/'), @ph.longest_common_subpath(paths)
end
@@ -102,7 +102,7 @@ class FileEventedUpdateCheckerPathHelperTest < ActiveSupport::TestCase
/Rails.root/app/controllers
/Rails.root/app/models
/Rails.root/app/helpers
- ).map {|path| pn(path)}
+ ).map { |path| pn(path) }
assert_equal paths, @ph.filter_out_descendants(paths)
end
@@ -114,7 +114,7 @@ class FileEventedUpdateCheckerPathHelperTest < ActiveSupport::TestCase
/Rails.root/app/models
/Rails.root/app/models/concerns
/Rails.root/app/helpers
- ).map {|path| pn(path)}
+ ).map { |path| pn(path) }
assert_equal paths.values_at(0, 2, 4), @ph.filter_out_descendants(paths)
end
diff --git a/activesupport/test/file_update_checker_shared_tests.rb b/activesupport/test/file_update_checker_shared_tests.rb
index caa4d6191d..72955bba8a 100644
--- a/activesupport/test/file_update_checker_shared_tests.rb
+++ b/activesupport/test/file_update_checker_shared_tests.rb
@@ -12,7 +12,7 @@ module FileUpdateCheckerSharedTests
end
def tmpfiles
- @tmpfiles ||= %w(foo.rb bar.rb baz.rb).map {|f| tmpfile(f)}
+ @tmpfiles ||= %w(foo.rb bar.rb baz.rb).map { |f| tmpfile(f) }
end
def teardown
diff --git a/activesupport/test/file_update_checker_test.rb b/activesupport/test/file_update_checker_test.rb
index bf376f75bc..752f7836cd 100644
--- a/activesupport/test/file_update_checker_test.rb
+++ b/activesupport/test/file_update_checker_test.rb
@@ -4,7 +4,7 @@ require 'file_update_checker_shared_tests'
class FileUpdateCheckerTest < ActiveSupport::TestCase
include FileUpdateCheckerSharedTests
- def new_checker(files=[], dirs={}, &block)
+ def new_checker(files = [], dirs = {}, &block)
ActiveSupport::FileUpdateChecker.new(files, dirs, &block)
end