aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/file_update_checker.rb
diff options
context:
space:
mode:
authorkenta-s <knt01222@gmail.com>2017-01-28 00:53:21 +0900
committerkenta-s <knt01222@gmail.com>2017-01-28 00:53:32 +0900
commit3585155f1b1150a027af26434ab96aedd686ca66 (patch)
treed8c4699e1bda703fcfd53ff8fea56d19aefdddfb /activesupport/lib/active_support/file_update_checker.rb
parentd506f3def1c56e40be0262a5d34560655faa9180 (diff)
downloadrails-3585155f1b1150a027af26434ab96aedd686ca66.tar.gz
rails-3585155f1b1150a027af26434ab96aedd686ca66.tar.bz2
rails-3585155f1b1150a027af26434ab96aedd686ca66.zip
Raise an error if FileUpdateChecker#execute is called with no block
Diffstat (limited to 'activesupport/lib/active_support/file_update_checker.rb')
-rw-r--r--activesupport/lib/active_support/file_update_checker.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/file_update_checker.rb b/activesupport/lib/active_support/file_update_checker.rb
index 2dbbfadac1..1af18541e3 100644
--- a/activesupport/lib/active_support/file_update_checker.rb
+++ b/activesupport/lib/active_support/file_update_checker.rb
@@ -74,7 +74,11 @@ module ActiveSupport
def execute
@last_watched = watched
@last_update_at = updated_at(@last_watched)
- @block.call
+ if @block.nil?
+ raise ArgumentError, "no block given: #{self.inspect}, please pass a block when you initialize #{self.class}"
+ else
+ @block.call
+ end
ensure
@watched = nil
@updated_at = nil