Commit c7c171bbefce268140938458c369780a4ab47cf9
1 parent
25033623
Exists in
staging
and in
32 other branches
spaminator: replaces progressbar with ruby-progressbar
progressbar is not maintained anymore and debian now packages only ruby-progressbar
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
plugins/spaminator/Gemfile
plugins/spaminator/lib/spaminator_plugin/spaminator.rb
... | ... | @@ -72,14 +72,14 @@ class SpaminatorPlugin::Spaminator |
72 | 72 | self.class.log("Starting to process all comments") |
73 | 73 | comments = comments_to_process |
74 | 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 | 76 | comments.each do |comment| |
77 | 77 | begin |
78 | 78 | process_comment(comment) |
79 | 79 | rescue |
80 | 80 | register_fail(:comments, comment) |
81 | 81 | end |
82 | - pbar.inc if Rails.env.development? | |
82 | + pbar.increment if Rails.env.development? | |
83 | 83 | end |
84 | 84 | @report.processed_comments = total |
85 | 85 | pbar.finish if Rails.env.development? |
... | ... | @@ -90,11 +90,11 @@ class SpaminatorPlugin::Spaminator |
90 | 90 | self.class.log("Starting to process all people") |
91 | 91 | people = people_to_process |
92 | 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 | 94 | people.find_each do |person| |
95 | 95 | process_person_by_comments(person) |
96 | 96 | process_person_by_no_network(person) |
97 | - pbar.inc if Rails.env.development? | |
97 | + pbar.increment if Rails.env.development? | |
98 | 98 | end |
99 | 99 | @report.processed_people = total |
100 | 100 | pbar.finish if Rails.env.development? | ... | ... |