diff options
Diffstat (limited to 'app/helpers/ci_variables_helper.rb')
-rw-r--r-- | app/helpers/ci_variables_helper.rb | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/app/helpers/ci_variables_helper.rb b/app/helpers/ci_variables_helper.rb index e3728804c2a..fc51f00d052 100644 --- a/app/helpers/ci_variables_helper.rb +++ b/app/helpers/ci_variables_helper.rb @@ -12,4 +12,23 @@ module CiVariablesHelper ci_variable_protected_by_default? end end + + def ci_variable_masked?(variable, only_key_value) + if variable && !only_key_value + variable.masked + else + false + end + end + + def ci_variable_type_options + [ + %w(Variable env_var), + %w(File file) + ] + end + + def ci_variable_maskable_regex + Maskable::REGEX.inspect.sub('\\A', '^').sub('\\z', '$').sub(/^\//, '').sub(/\/[a-z]*$/, '').gsub('\/', '/') + end end |