diff options
author | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-04 13:14:49 +0300 |
---|---|---|
committer | Shinya Maeda <gitlab.shinyamaeda@gmail.com> | 2017-04-06 17:46:59 +0300 |
commit | 4949e2b291bc59ee3855882a29df3bff9edfd4e5 (patch) | |
tree | 09bff0657878de147016b23ee7ce7f02d6cc24ea /lib/gitlab/ci | |
parent | 3d3df09713dcb70baceaeba7603fa49b89fc8007 (diff) |
Separate cron_valid? and cron_time_zone_valid?
Diffstat (limited to 'lib/gitlab/ci')
-rw-r--r-- | lib/gitlab/ci/cron_parser.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/gitlab/ci/cron_parser.rb b/lib/gitlab/ci/cron_parser.rb index 2d9ea26faf0..521e556f769 100644 --- a/lib/gitlab/ci/cron_parser.rb +++ b/lib/gitlab/ci/cron_parser.rb @@ -14,10 +14,12 @@ module Gitlab cron_line.next_time(time).in_time_zone(Time.zone) if cron_line.present? end - def validation - is_valid_cron = try_parse_cron(@cron, VALID_SYNTAX_SAMPLE_TIME_ZONE).present? - is_valid_cron_time_zone = try_parse_cron(VALID_SYNTAX_SAMPLE_CRON, @cron_time_zone).present? - return is_valid_cron, is_valid_cron_time_zone + def cron_valid? + try_parse_cron(@cron, VALID_SYNTAX_SAMPLE_TIME_ZONE).present? + end + + def cron_time_zone_valid? + try_parse_cron(VALID_SYNTAX_SAMPLE_CRON, @cron_time_zone).present? end private |