Commit 57fc46ecae5e94850c3e236a29e25e5960c1aaf9

Authored by Rodrigo Souto
2 parents 25998f5a c7c171bb

Merge branch 'spaminator-progressbar' into 'master'

spaminator: replaces progressbar with ruby-progressbar

spaminator plugin complains about missing gem.

progressbar is not maintained anymore and debian now packages only ruby-progressbar, so i replaced progressbar with ruby-progressbar on spaminator plugin.

See merge request !857
plugins/spaminator/Gemfile
1 -gem "progressbar" 1 +gem "ruby-progressbar"
plugins/spaminator/lib/spaminator_plugin/spaminator.rb
@@ -72,14 +72,14 @@ class SpaminatorPlugin::Spaminator @@ -72,14 +72,14 @@ class SpaminatorPlugin::Spaminator
72 self.class.log("Starting to process all comments") 72 self.class.log("Starting to process all comments")
73 comments = comments_to_process 73 comments = comments_to_process
74 total = comments.count 74 total = comments.count
75 - pbar = ProgressBar.new("☢ Comments", total) if Rails.env.development? 75 + pbar = ProgressBar.create(title: "☢ Comments", total: total, format: '%t: |%B| %E') if Rails.env.development?
76 comments.each do |comment| 76 comments.each do |comment|
77 begin 77 begin
78 process_comment(comment) 78 process_comment(comment)
79 rescue 79 rescue
80 register_fail(:comments, comment) 80 register_fail(:comments, comment)
81 end 81 end
82 - pbar.inc if Rails.env.development? 82 + pbar.increment if Rails.env.development?
83 end 83 end
84 @report.processed_comments = total 84 @report.processed_comments = total
85 pbar.finish if Rails.env.development? 85 pbar.finish if Rails.env.development?
@@ -90,11 +90,11 @@ class SpaminatorPlugin::Spaminator @@ -90,11 +90,11 @@ class SpaminatorPlugin::Spaminator
90 self.class.log("Starting to process all people") 90 self.class.log("Starting to process all people")
91 people = people_to_process 91 people = people_to_process
92 total = people.count 92 total = people.count
93 - pbar = ProgressBar.new("☢ People", total) if Rails.env.development? 93 + pbar = ProgressBar.create(title: "☢ People", total: total, format: '%t: |%B| %E') if Rails.env.development?
94 people.find_each do |person| 94 people.find_each do |person|
95 process_person_by_comments(person) 95 process_person_by_comments(person)
96 process_person_by_no_network(person) 96 process_person_by_no_network(person)
97 - pbar.inc if Rails.env.development? 97 + pbar.increment if Rails.env.development?
98 end 98 end
99 @report.processed_people = total 99 @report.processed_people = total
100 pbar.finish if Rails.env.development? 100 pbar.finish if Rails.env.development?