Commit 2331ec25 authored by Robert Speicher's avatar Robert Speicher

Merge branch 'remove-colorize-ee' into 'master'

Remove colorize methods that weren't in CE.

This is a follow-up from gitlab-org/gitlab-ce!4425, which replaced colorize methods equivalent Rainbow methods e.g. `.red` with `.color(:red)`.

The gem was replaced due to licensing conflicts. This fixes up the last few uses the gem had in EE.

See merge request !438
parents 560ad96d 6cca8974
...@@ -160,20 +160,20 @@ namespace :gitlab do ...@@ -160,20 +160,20 @@ namespace :gitlab do
namespace :pages do namespace :pages do
task create: :environment do task create: :environment do
$progress.puts "Dumping pages ... ".blue $progress.puts "Dumping pages ... ".color(:blue)
if ENV["SKIP"] && ENV["SKIP"].include?("pages") if ENV["SKIP"] && ENV["SKIP"].include?("pages")
$progress.puts "[SKIPPED]".cyan $progress.puts "[SKIPPED]".color(:cyan)
else else
Backup::Pages.new.dump Backup::Pages.new.dump
$progress.puts "done".green $progress.puts "done".color(:green)
end end
end end
task restore: :environment do task restore: :environment do
$progress.puts "Restoring pages ... ".blue $progress.puts "Restoring pages ... ".color(:blue)
Backup::Pages.new.restore Backup::Pages.new.restore
$progress.puts "done".green $progress.puts "done".color(:green)
end end
end end
......
...@@ -980,17 +980,17 @@ namespace :gitlab do ...@@ -980,17 +980,17 @@ namespace :gitlab do
version = client.info["version"]["number"] version = client.info["version"]["number"]
if version.starts_with?("2") if version.starts_with?("2")
puts "yes (#{version})".green puts "yes (#{version})".color(:green)
else else
puts "no".red puts "no".color(:red)
end end
print "Elasticsearch has plugin delete-by-query installed? ... " print "Elasticsearch has plugin delete-by-query installed? ... "
if client.cat.plugins.include?("delete-by-query") if client.cat.plugins.include?("delete-by-query")
puts "yes".green puts "yes".color(:green)
else else
puts "no".red puts "no".color(:red)
end end
end end
end end
...@@ -35,7 +35,7 @@ namespace :gitlab do ...@@ -35,7 +35,7 @@ namespace :gitlab do
head_commit = repository.commit head_commit = repository.commit
if !head_commit || index_status.last_commit == head_commit.sha if !head_commit || index_status.last_commit == head_commit.sha
puts "Skipped".yellow puts "Skipped".color(:yellow)
next next
end end
...@@ -48,7 +48,7 @@ namespace :gitlab do ...@@ -48,7 +48,7 @@ namespace :gitlab do
# During indexing the new commits can be pushed, # During indexing the new commits can be pushed,
# the last_commit parameter only indicates that at least this commit is in index # the last_commit parameter only indicates that at least this commit is in index
index_status.update(last_commit: head_commit.sha, indexed_at: DateTime.now) index_status.update(last_commit: head_commit.sha, indexed_at: DateTime.now)
puts "Done!".green puts "Done!".color(:green)
rescue StandardError => e rescue StandardError => e
puts "#{e.message}, trace - #{e.backtrace}" puts "#{e.message}, trace - #{e.backtrace}"
end end
...@@ -67,7 +67,7 @@ namespace :gitlab do ...@@ -67,7 +67,7 @@ namespace :gitlab do
puts "Indexing wiki of #{project.name_with_namespace}..." puts "Indexing wiki of #{project.name_with_namespace}..."
begin begin
project.wiki.index_blobs project.wiki.index_blobs
puts "Done!".green puts "Done!".color(:green)
rescue StandardError => e rescue StandardError => e
puts "#{e.message}, trace - #{e.backtrace}" puts "#{e.message}, trace - #{e.backtrace}"
end end
...@@ -88,7 +88,7 @@ namespace :gitlab do ...@@ -88,7 +88,7 @@ namespace :gitlab do
klass.import klass.import
end end
puts "done".green puts "done".color(:green)
end end
end end
...@@ -111,7 +111,7 @@ namespace :gitlab do ...@@ -111,7 +111,7 @@ namespace :gitlab do
klass.import klass.import
end end
puts "done".green puts "done".color(:green)
end end
desc "GitLab | Create empty Elasticsearch indexes" desc "GitLab | Create empty Elasticsearch indexes"
...@@ -130,14 +130,14 @@ namespace :gitlab do ...@@ -130,14 +130,14 @@ namespace :gitlab do
klass.__elasticsearch__.create_index! klass.__elasticsearch__.create_index!
puts "done".green puts "done".color(:green)
end end
end end
desc "GitLab | Clear Elasticsearch indexing status" desc "GitLab | Clear Elasticsearch indexing status"
task clear_index_status: :environment do task clear_index_status: :environment do
IndexStatus.destroy_all IndexStatus.destroy_all
puts "Done".green puts "Done".color(:green)
end end
desc "GitLab | Delete Elasticsearch indexes" desc "GitLab | Delete Elasticsearch indexes"
...@@ -156,7 +156,7 @@ namespace :gitlab do ...@@ -156,7 +156,7 @@ namespace :gitlab do
klass.__elasticsearch__.delete_index! klass.__elasticsearch__.delete_index!
puts "done".green puts "done".color(:green)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment