From 6c8e72b4108e5c671970a3965b214c8b1dda53ae Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Thu, 1 Jun 2017 11:58:34 +0200 Subject: Add 'schedules' keyword to 'only' and 'except' --- lib/ci/gitlab_ci_yaml_processor.rb | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 22af2671b18..b941a54c85a 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -20,26 +20,26 @@ module Ci raise ValidationError, e.message end - def jobs_for_ref(ref, tag = false, trigger_request = nil) + def jobs_for_ref(ref, tag = false, trigger_request = nil, pipeline_schedule = nil) @jobs.select do |_, job| - process?(job[:only], job[:except], ref, tag, trigger_request) + process?(job[:only], job[:except], ref, tag, trigger_request, pipeline_schedule) end end - def jobs_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil) - jobs_for_ref(ref, tag, trigger_request).select do |_, job| + def jobs_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil, pipeline_schedule = nil) + jobs_for_ref(ref, tag, trigger_request, pipeline_schedule).select do |_, job| job[:stage] == stage end end - def builds_for_ref(ref, tag = false, trigger_request = nil) - jobs_for_ref(ref, tag, trigger_request).map do |name, _| + def builds_for_ref(ref, tag = false, trigger_request = nil, pipeline_schedule = nil) + jobs_for_ref(ref, tag, trigger_request, pipeline_schedule).map do |name, _| build_attributes(name) end end - def builds_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil) - jobs_for_stage_and_ref(stage, ref, tag, trigger_request).map do |name, _| + def builds_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil, pipeline_schedule = nil) + jobs_for_stage_and_ref(stage, ref, tag, trigger_request, pipeline_schedule).map do |name, _| build_attributes(name) end end @@ -193,30 +193,31 @@ module Ci end end - def process?(only_params, except_params, ref, tag, trigger_request) + def process?(only_params, except_params, ref, tag, trigger_request, pipeline_schedule) if only_params.present? - return false unless matching?(only_params, ref, tag, trigger_request) + return false unless matching?(only_params, ref, tag, trigger_request, pipeline_schedule) end if except_params.present? - return false if matching?(except_params, ref, tag, trigger_request) + return false if matching?(except_params, ref, tag, trigger_request, pipeline_schedule) end true end - def matching?(patterns, ref, tag, trigger_request) + def matching?(patterns, ref, tag, trigger_request, pipeline_schedule) patterns.any? do |pattern| - match_ref?(pattern, ref, tag, trigger_request) + match_ref?(pattern, ref, tag, trigger_request, pipeline_schedule) end end - def match_ref?(pattern, ref, tag, trigger_request) + def match_ref?(pattern, ref, tag, trigger_request, pipeline_schedule) pattern, path = pattern.split('@', 2) return false if path && path != self.path return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' return true if trigger_request.present? && pattern == 'triggers' + return true if pipeline_schedule.present? && pattern == 'schedules' if pattern.first == "/" && pattern.last == "/" Regexp.new(pattern[1...-1]) =~ ref -- cgit v1.2.1 From 8db63b26284d949000316a38676ef6fad970f657 Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Thu, 1 Jun 2017 21:55:57 +0200 Subject: Use pipeline.source to determine what triggered a pipeline --- lib/ci/gitlab_ci_yaml_processor.rb | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index b941a54c85a..98600a48d0f 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -20,26 +20,26 @@ module Ci raise ValidationError, e.message end - def jobs_for_ref(ref, tag = false, trigger_request = nil, pipeline_schedule = nil) + def jobs_for_ref(ref, tag = false, source = nil) @jobs.select do |_, job| - process?(job[:only], job[:except], ref, tag, trigger_request, pipeline_schedule) + process?(job[:only], job[:except], ref, tag, source) end end - def jobs_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil, pipeline_schedule = nil) - jobs_for_ref(ref, tag, trigger_request, pipeline_schedule).select do |_, job| + def jobs_for_stage_and_ref(stage, ref, tag = false, source = nil) + jobs_for_ref(ref, tag, source).select do |_, job| job[:stage] == stage end end - def builds_for_ref(ref, tag = false, trigger_request = nil, pipeline_schedule = nil) - jobs_for_ref(ref, tag, trigger_request, pipeline_schedule).map do |name, _| + def builds_for_ref(ref, tag = false, source = nil) + jobs_for_ref(ref, tag, source).map do |name, _| build_attributes(name) end end - def builds_for_stage_and_ref(stage, ref, tag = false, trigger_request = nil, pipeline_schedule = nil) - jobs_for_stage_and_ref(stage, ref, tag, trigger_request, pipeline_schedule).map do |name, _| + def builds_for_stage_and_ref(stage, ref, tag = false, source = nil) + jobs_for_stage_and_ref(stage, ref, tag, source).map do |name, _| build_attributes(name) end end @@ -193,31 +193,31 @@ module Ci end end - def process?(only_params, except_params, ref, tag, trigger_request, pipeline_schedule) + def process?(only_params, except_params, ref, tag, source) if only_params.present? - return false unless matching?(only_params, ref, tag, trigger_request, pipeline_schedule) + return false unless matching?(only_params, ref, tag, source) end if except_params.present? - return false if matching?(except_params, ref, tag, trigger_request, pipeline_schedule) + return false if matching?(except_params, ref, tag, source) end true end - def matching?(patterns, ref, tag, trigger_request, pipeline_schedule) + def matching?(patterns, ref, tag, source) patterns.any? do |pattern| - match_ref?(pattern, ref, tag, trigger_request, pipeline_schedule) + match_ref?(pattern, ref, tag, source) end end - def match_ref?(pattern, ref, tag, trigger_request, pipeline_schedule) + def match_ref?(pattern, ref, tag, source) pattern, path = pattern.split('@', 2) return false if path && path != self.path return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' - return true if trigger_request.present? && pattern == 'triggers' - return true if pipeline_schedule.present? && pattern == 'schedules' + return true if source == 'trigger' && pattern == 'triggers' + return true if source == 'schedule' && pattern == 'schedules' if pattern.first == "/" && pattern.last == "/" Regexp.new(pattern[1...-1]) =~ ref -- cgit v1.2.1 From ecb54cddd164fbf83288d7903c4692df462bae5e Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 19:02:56 +0200 Subject: Add all sources as special keywords for only and except --- lib/ci/gitlab_ci_yaml_processor.rb | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 98600a48d0f..0b362921b06 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -207,17 +207,15 @@ module Ci def matching?(patterns, ref, tag, source) patterns.any? do |pattern| - match_ref?(pattern, ref, tag, source) + match_ref?(pattern, ref, tag) || match_source?(pattern, source) end end - def match_ref?(pattern, ref, tag, source) + def match_ref?(pattern, ref, tag) pattern, path = pattern.split('@', 2) return false if path && path != self.path return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' - return true if source == 'trigger' && pattern == 'triggers' - return true if source == 'schedule' && pattern == 'schedules' if pattern.first == "/" && pattern.last == "/" Regexp.new(pattern[1...-1]) =~ ref @@ -225,5 +223,14 @@ module Ci pattern == ref end end + + def match_source?(pattern, source) + return source_to_pattern(source) == pattern + end + + def source_to_pattern(source) + return source if ['api', 'external', 'web'].include? source + return source.pluralize + end end end -- cgit v1.2.1 From 1dd054e1788fa7b308a9088f3bb35808a027e76d Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 19:58:20 +0200 Subject: Fix static-analysis offenses --- lib/ci/gitlab_ci_yaml_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 0b362921b06..d236c42929a 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -229,7 +229,7 @@ module Ci end def source_to_pattern(source) - return source if ['api', 'external', 'web'].include? source + return source if %w(api external web).include? source return source.pluralize end end -- cgit v1.2.1 From 7457d076ceb0078e6e9b6cbd9559564bff27b7d0 Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Fri, 2 Jun 2017 20:12:44 +0200 Subject: Check if source is nil --- lib/ci/gitlab_ci_yaml_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index d236c42929a..feac7c87466 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -229,7 +229,7 @@ module Ci end def source_to_pattern(source) - return source if %w(api external web).include? source + return source if %w(api external web).include?(source) || source.nil? return source.pluralize end end -- cgit v1.2.1 From 1736a2dab6bcab8bb5632e211525bd806bef003a Mon Sep 17 00:00:00 2001 From: Filip Krakowski Date: Mon, 5 Jun 2017 17:15:15 +0200 Subject: Fix change in behavior --- lib/ci/gitlab_ci_yaml_processor.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index feac7c87466..a58af73debb 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -207,15 +207,19 @@ module Ci def matching?(patterns, ref, tag, source) patterns.any? do |pattern| - match_ref?(pattern, ref, tag) || match_source?(pattern, source) + pattern, path = pattern.split('@', 2) + match_path?(path) && match_pattern?(pattern, ref, tag, source) end end - def match_ref?(pattern, ref, tag) - pattern, path = pattern.split('@', 2) - return false if path && path != self.path + def match_path?(path) + return !(path && path != self.path) + end + + def match_pattern?(pattern, ref, tag, source) return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' + return true if source_to_pattern(source) == pattern if pattern.first == "/" && pattern.last == "/" Regexp.new(pattern[1...-1]) =~ ref @@ -224,10 +228,6 @@ module Ci end end - def match_source?(pattern, source) - return source_to_pattern(source) == pattern - end - def source_to_pattern(source) return source if %w(api external web).include?(source) || source.nil? return source.pluralize -- cgit v1.2.1 From 431d7972b6d0f492bd82004b80d426f2e2cff6a5 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:14:36 +0900 Subject: Fix unmatches_path --- lib/ci/gitlab_ci_yaml_processor.rb | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index a58af73debb..738ff474596 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -208,15 +208,15 @@ module Ci def matching?(patterns, ref, tag, source) patterns.any? do |pattern| pattern, path = pattern.split('@', 2) - match_path?(path) && match_pattern?(pattern, ref, tag, source) + unmatches_path?(path) && matches_pattern?(pattern, ref, tag, source) end end - def match_path?(path) - return !(path && path != self.path) + def unmatches_path?(path) + path && path != self.path end - def match_pattern?(pattern, ref, tag, source) + def matches_pattern?(pattern, ref, tag, source) return true if tag && pattern == 'tags' return true if !tag && pattern == 'branches' return true if source_to_pattern(source) == pattern @@ -229,8 +229,11 @@ module Ci end def source_to_pattern(source) - return source if %w(api external web).include?(source) || source.nil? - return source.pluralize + if %w(api external web).include?(source) || source.nil? + source + else + source.pluralize + end end end end -- cgit v1.2.1 From 465e5de5107da7e280902de581ee29c6f0cd1abc Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:24:11 +0900 Subject: Fix condition --- lib/ci/gitlab_ci_yaml_processor.rb | 8 +++++--- lib/gitlab/gitaly_client.rb | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 738ff474596..bd3ce40ca4b 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -208,12 +208,14 @@ module Ci def matching?(patterns, ref, tag, source) patterns.any? do |pattern| pattern, path = pattern.split('@', 2) - unmatches_path?(path) && matches_pattern?(pattern, ref, tag, source) + matches_path?(path) && matches_pattern?(pattern, ref, tag, source) end end - def unmatches_path?(path) - path && path != self.path + def matches_path?(path) + return true unless path + + path == self.path end def matches_pattern?(pattern, ref, tag, source) diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index 2343446bf22..598f642415a 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -49,7 +49,8 @@ module Gitlab end def self.enabled? - Gitlab.config.gitaly.enabled + # Gitlab.config.gitaly.enabled + false end def self.feature_enabled?(feature, status: MigrationStatus::OPT_IN) -- cgit v1.2.1 From 835f97a7e26ae7b199d886f35e33255016538134 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:26:04 +0900 Subject: Remove source.nil --- lib/ci/gitlab_ci_yaml_processor.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index bd3ce40ca4b..c3fa875bfe6 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -214,7 +214,7 @@ module Ci def matches_path?(path) return true unless path - + path == self.path end @@ -231,10 +231,10 @@ module Ci end def source_to_pattern(source) - if %w(api external web).include?(source) || source.nil? + if %w(api external web).include?(source) source else - source.pluralize + source&.pluralize end end end -- cgit v1.2.1 From 451b684d8474d5c16007d69f462f08f2191820f2 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:45:24 +0900 Subject: Use source instead of trigger_requests in stage_seeds --- lib/ci/gitlab_ci_yaml_processor.rb | 4 +--- lib/gitlab/gitaly_client.rb | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index c3fa875bfe6..9a681c65d4b 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -51,11 +51,9 @@ module Ci end def stage_seeds(pipeline) - trigger_request = pipeline.trigger_requests.first - seeds = @stages.uniq.map do |stage| builds = builds_for_stage_and_ref( - stage, pipeline.ref, pipeline.tag?, trigger_request) + stage, pipeline.ref, pipeline.tag?, pipeline.source) Gitlab::Ci::Stage::Seed.new(pipeline, stage, builds) if builds.any? end diff --git a/lib/gitlab/gitaly_client.rb b/lib/gitlab/gitaly_client.rb index 598f642415a..2343446bf22 100644 --- a/lib/gitlab/gitaly_client.rb +++ b/lib/gitlab/gitaly_client.rb @@ -49,8 +49,7 @@ module Gitlab end def self.enabled? - # Gitlab.config.gitaly.enabled - false + Gitlab.config.gitaly.enabled end def self.feature_enabled?(feature, status: MigrationStatus::OPT_IN) -- cgit v1.2.1 From 32bfa48ad0b2d930d3a95656774982afed7489f0 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Wed, 7 Jun 2017 22:59:06 +0900 Subject: use squre bracket --- lib/ci/gitlab_ci_yaml_processor.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ci/gitlab_ci_yaml_processor.rb b/lib/ci/gitlab_ci_yaml_processor.rb index 9a681c65d4b..56ad2c77c7d 100644 --- a/lib/ci/gitlab_ci_yaml_processor.rb +++ b/lib/ci/gitlab_ci_yaml_processor.rb @@ -229,7 +229,7 @@ module Ci end def source_to_pattern(source) - if %w(api external web).include?(source) + if %w[api external web].include?(source) source else source&.pluralize -- cgit v1.2.1 From 32cac597275706930b221b19fb20b29ccebc7130 Mon Sep 17 00:00:00 2001 From: "Luke \"Jared\" Bennett" Date: Wed, 7 Jun 2017 18:33:50 +0000 Subject: Added more actions and report as abuse to all notes --- lib/gitlab/url_builder.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gitlab/url_builder.rb b/lib/gitlab/url_builder.rb index ccb456bcc94..23af9318d1a 100644 --- a/lib/gitlab/url_builder.rb +++ b/lib/gitlab/url_builder.rb @@ -61,7 +61,12 @@ module Gitlab elsif object.for_snippet? snippet = Snippet.find(object.noteable_id) - project_snippet_url(snippet, anchor: dom_id(object)) + + if snippet.is_a?(PersonalSnippet) + snippet_url(snippet, anchor: dom_id(object)) + else + project_snippet_url(snippet, anchor: dom_id(object)) + end end end -- cgit v1.2.1 From bdebe849b8251f390378dd446d9022fca1b2d55c Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Wed, 7 Jun 2017 20:13:44 +0000 Subject: Translate project & repository pages --- lib/gitlab/ci/status/canceled.rb | 4 ++-- lib/gitlab/ci/status/created.rb | 4 ++-- lib/gitlab/ci/status/failed.rb | 4 ++-- lib/gitlab/ci/status/manual.rb | 4 ++-- lib/gitlab/ci/status/pending.rb | 4 ++-- lib/gitlab/ci/status/pipeline/blocked.rb | 4 ++-- lib/gitlab/ci/status/running.rb | 4 ++-- lib/gitlab/ci/status/skipped.rb | 4 ++-- lib/gitlab/ci/status/success.rb | 4 ++-- lib/gitlab/ci/status/success_warning.rb | 4 ++-- lib/gitlab/visibility_level.rb | 6 +++--- 11 files changed, 23 insertions(+), 23 deletions(-) (limited to 'lib') diff --git a/lib/gitlab/ci/status/canceled.rb b/lib/gitlab/ci/status/canceled.rb index 97c121ce7b9..e5fdc1f8136 100644 --- a/lib/gitlab/ci/status/canceled.rb +++ b/lib/gitlab/ci/status/canceled.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Canceled < Status::Core def text - 'canceled' + s_('CiStatusText|canceled') end def label - 'canceled' + s_('CiStatusLabel|canceled') end def icon diff --git a/lib/gitlab/ci/status/created.rb b/lib/gitlab/ci/status/created.rb index 0721bf6ec7c..d188bd286a6 100644 --- a/lib/gitlab/ci/status/created.rb +++ b/lib/gitlab/ci/status/created.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Created < Status::Core def text - 'created' + s_('CiStatusText|created') end def label - 'created' + s_('CiStatusLabel|created') end def icon diff --git a/lib/gitlab/ci/status/failed.rb b/lib/gitlab/ci/status/failed.rb index cb75e9383a8..38e45714c22 100644 --- a/lib/gitlab/ci/status/failed.rb +++ b/lib/gitlab/ci/status/failed.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Failed < Status::Core def text - 'failed' + s_('CiStatusText|failed') end def label - 'failed' + s_('CiStatusLabel|failed') end def icon diff --git a/lib/gitlab/ci/status/manual.rb b/lib/gitlab/ci/status/manual.rb index f8f6c2903ba..a4a7edadac9 100644 --- a/lib/gitlab/ci/status/manual.rb +++ b/lib/gitlab/ci/status/manual.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Manual < Status::Core def text - 'manual' + s_('CiStatusText|manual') end def label - 'manual action' + s_('CiStatusLabel|manual action') end def icon diff --git a/lib/gitlab/ci/status/pending.rb b/lib/gitlab/ci/status/pending.rb index f40cc1314dc..5164260b861 100644 --- a/lib/gitlab/ci/status/pending.rb +++ b/lib/gitlab/ci/status/pending.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Pending < Status::Core def text - 'pending' + s_('CiStatusText|pending') end def label - 'pending' + s_('CiStatusLabel|pending') end def icon diff --git a/lib/gitlab/ci/status/pipeline/blocked.rb b/lib/gitlab/ci/status/pipeline/blocked.rb index 37dfe43fb62..bf7e484ee9b 100644 --- a/lib/gitlab/ci/status/pipeline/blocked.rb +++ b/lib/gitlab/ci/status/pipeline/blocked.rb @@ -4,11 +4,11 @@ module Gitlab module Pipeline class Blocked < Status::Extended def text - 'blocked' + s_('CiStatusText|blocked') end def label - 'waiting for manual action' + s_('CiStatusLabel|waiting for manual action') end def self.matches?(pipeline, user) diff --git a/lib/gitlab/ci/status/running.rb b/lib/gitlab/ci/status/running.rb index 1237cd47dc8..993937e98ca 100644 --- a/lib/gitlab/ci/status/running.rb +++ b/lib/gitlab/ci/status/running.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Running < Status::Core def text - 'running' + s_('CiStatus|running') end def label - 'running' + s_('CiStatus|running') end def icon diff --git a/lib/gitlab/ci/status/skipped.rb b/lib/gitlab/ci/status/skipped.rb index 28005d91503..0c942920b02 100644 --- a/lib/gitlab/ci/status/skipped.rb +++ b/lib/gitlab/ci/status/skipped.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Skipped < Status::Core def text - 'skipped' + s_('CiStatusText|skipped') end def label - 'skipped' + s_('CiStatusLabel|skipped') end def icon diff --git a/lib/gitlab/ci/status/success.rb b/lib/gitlab/ci/status/success.rb index 88f7758a270..d7af98857b0 100644 --- a/lib/gitlab/ci/status/success.rb +++ b/lib/gitlab/ci/status/success.rb @@ -3,11 +3,11 @@ module Gitlab module Status class Success < Status::Core def text - 'passed' + s_('CiStatusText|passed') end def label - 'passed' + s_('CiStatusLabel|passed') end def icon diff --git a/lib/gitlab/ci/status/success_warning.rb b/lib/gitlab/ci/status/success_warning.rb index df6e76b0151..4d7d82e04cf 100644 --- a/lib/gitlab/ci/status/success_warning.rb +++ b/lib/gitlab/ci/status/success_warning.rb @@ -7,11 +7,11 @@ module Gitlab # class SuccessWarning < Status::Extended def text - 'passed' + s_('CiStatusText|passed') end def label - 'passed with warnings' + s_('CiStatusLabel|passed with warnings') end def icon diff --git a/lib/gitlab/visibility_level.rb b/lib/gitlab/visibility_level.rb index 85da4c8660b..2b53798e70f 100644 --- a/lib/gitlab/visibility_level.rb +++ b/lib/gitlab/visibility_level.rb @@ -41,9 +41,9 @@ module Gitlab def options { - 'Private' => PRIVATE, - 'Internal' => INTERNAL, - 'Public' => PUBLIC + N_('VisibilityLevel|Private') => PRIVATE, + N_('VisibilityLevel|Internal') => INTERNAL, + N_('VisibilityLevel|Public') => PUBLIC } end -- cgit v1.2.1 From c50cded96e5f6f0eaadf9e49ac98f722f09b8fa8 Mon Sep 17 00:00:00 2001 From: "http://jneen.net/" Date: Wed, 7 Jun 2017 17:49:03 -0700 Subject: remove the rouge copypasta and add notes to refactor --- lib/rouge/lexers/math.rb | 16 ++-------------- lib/rouge/lexers/plantuml.rb | 16 ++-------------- 2 files changed, 4 insertions(+), 28 deletions(-) (limited to 'lib') diff --git a/lib/rouge/lexers/math.rb b/lib/rouge/lexers/math.rb index 80784adfd76..939b23a3421 100644 --- a/lib/rouge/lexers/math.rb +++ b/lib/rouge/lexers/math.rb @@ -1,21 +1,9 @@ module Rouge module Lexers - class Math < Lexer + class Math < PlainText title "A passthrough lexer used for LaTeX input" - desc "A boring lexer that doesn't highlight anything" - + desc "PLEASE REFACTOR - this should be handled by SyntaxHighlightFilter" tag 'math' - mimetypes 'text/plain' - - default_options token: 'Text' - - def token - @token ||= Token[option :token] - end - - def stream_tokens(string, &b) - yield self.token, string - end end end end diff --git a/lib/rouge/lexers/plantuml.rb b/lib/rouge/lexers/plantuml.rb index 7d5700b7f6d..63c461764fc 100644 --- a/lib/rouge/lexers/plantuml.rb +++ b/lib/rouge/lexers/plantuml.rb @@ -1,21 +1,9 @@ module Rouge module Lexers - class Plantuml < Lexer + class Plantuml < PlainText title "A passthrough lexer used for PlantUML input" - desc "A boring lexer that doesn't highlight anything" - + desc "PLEASE REFACTOR - this should be handled by SyntaxHighlightFilter" tag 'plantuml' - mimetypes 'text/plain' - - default_options token: 'Text' - - def token - @token ||= Token[option :token] - end - - def stream_tokens(string, &b) - yield self.token, string - end end end end -- cgit v1.2.1