From f3516f171b7a975e1d3d8aaa37f721476fe49806 Mon Sep 17 00:00:00 2001 From: Xavier Noria Date: Wed, 11 Nov 2015 06:38:18 +0100 Subject: applies code style guidelines --- .../lib/active_support/file_evented_update_checker.rb | 12 ++++++------ activesupport/lib/active_support/file_update_checker.rb | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'activesupport/lib') 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 -- cgit v1.2.3