From 3d3df09713dcb70baceaeba7603fa49b89fc8007 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Tue, 4 Apr 2017 18:49:52 +0900 Subject: Dry up next_time_from. Move cron_parser_spec to appropriate location. --- lib/gitlab/ci/cron_parser.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/gitlab') diff --git a/lib/gitlab/ci/cron_parser.rb b/lib/gitlab/ci/cron_parser.rb index 01f37142510..2d9ea26faf0 100644 --- a/lib/gitlab/ci/cron_parser.rb +++ b/lib/gitlab/ci/cron_parser.rb @@ -11,11 +11,7 @@ module Gitlab def next_time_from(time) cron_line = try_parse_cron(@cron, @cron_time_zone) - if cron_line.present? - cron_line.next_time(time).in_time_zone(Time.zone) - else - nil - end + cron_line.next_time(time).in_time_zone(Time.zone) if cron_line.present? end def validation -- cgit v1.2.3