From 2a685cf5593f17d575676e0cc852c71f790466b8 Mon Sep 17 00:00:00 2001 From: Eito Katagiri Date: Wed, 6 May 2020 09:36:54 +0900 Subject: [PATCH] remove redundant begin --- app/safecast/tasks/device_story/update_metadata.rb | 8 +++----- bin/yarn | 12 +++++------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/app/safecast/tasks/device_story/update_metadata.rb b/app/safecast/tasks/device_story/update_metadata.rb index 9865074d1..1a61014b7 100644 --- a/app/safecast/tasks/device_story/update_metadata.rb +++ b/app/safecast/tasks/device_story/update_metadata.rb @@ -11,11 +11,9 @@ def call def call each_metadata(parse(fetch(devices_uri))) do |device_urn, metadata| - begin - find_or_update_device(device_urn, metadata) - rescue ActiveRecord::RecordInvalid - warn "Could not update device metadata for #{device_urn}." - end + find_or_update_device(device_urn, metadata) + rescue ActiveRecord::RecordInvalid + warn "Could not update device metadata for #{device_urn}." end end diff --git a/bin/yarn b/bin/yarn index dd36daa7e..4cac416a1 100755 --- a/bin/yarn +++ b/bin/yarn @@ -3,11 +3,9 @@ APP_ROOT = File.expand_path('..', __dir__) Dir.chdir(APP_ROOT) do - begin - exec 'yarnpkg', *ARGV - rescue Errno::ENOENT - warn 'Yarn executable was not detected in the system.' - warn 'Download Yarn at https://yarnpkg.com/en/docs/install' - exit 1 - end + exec 'yarnpkg', *ARGV +rescue Errno::ENOENT + warn 'Yarn executable was not detected in the system.' + warn 'Download Yarn at https://yarnpkg.com/en/docs/install' + exit 1 end