Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-08-09 15:11:57 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-09 15:11:57 +0300
commit1f229cdc22b5b32989bcff2037d8925c75703671 (patch)
treec92e9dff7737e78d7331518cdf69f90403af09ea /lib/gitlab/quick_actions
parent7a98d989740ec85982cdb6c1d57c8f24270e455e (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/quick_actions')
-rw-r--r--lib/gitlab/quick_actions/command_definition.rb18
-rw-r--r--lib/gitlab/quick_actions/spend_time_and_date_separator.rb6
2 files changed, 20 insertions, 4 deletions
diff --git a/lib/gitlab/quick_actions/command_definition.rb b/lib/gitlab/quick_actions/command_definition.rb
index fcb7bc967ca..d9135d1bacb 100644
--- a/lib/gitlab/quick_actions/command_definition.rb
+++ b/lib/gitlab/quick_actions/command_definition.rb
@@ -89,17 +89,29 @@ module Gitlab
def to_h(context)
desc = description
if desc.respond_to?(:call)
- desc = context.instance_exec(&desc) rescue ''
+ desc = begin
+ context.instance_exec(&desc)
+ rescue StandardError
+ ''
+ end
end
warn = warning
if warn.respond_to?(:call)
- warn = context.instance_exec(&warn) rescue ''
+ warn = begin
+ context.instance_exec(&warn)
+ rescue StandardError
+ ''
+ end
end
prms = params
if prms.respond_to?(:call)
- prms = Array(context.instance_exec(&prms)) rescue params
+ prms = begin
+ Array(context.instance_exec(&prms))
+ rescue StandardError
+ params
+ end
end
{
diff --git a/lib/gitlab/quick_actions/spend_time_and_date_separator.rb b/lib/gitlab/quick_actions/spend_time_and_date_separator.rb
index 03b2a1086bb..3794f2f8818 100644
--- a/lib/gitlab/quick_actions/spend_time_and_date_separator.rb
+++ b/lib/gitlab/quick_actions/spend_time_and_date_separator.rb
@@ -43,7 +43,11 @@ module Gitlab
def valid_date?
string_date = @spend_arg.match(DATE_REGEX)[0]
- date = Date.parse(string_date) rescue nil
+ date = begin
+ Date.parse(string_date)
+ rescue StandardError
+ nil
+ end
date_past_or_today?(date)
end