Add rubocop to our build. (#5004)

This commit is contained in:
Guo Xiang Tan
2017-07-28 10:20:09 +09:00
committed by GitHub
parent ff4e295c4f
commit 5012d46cbd
871 changed files with 5480 additions and 6056 deletions

View File

@ -1,6 +1,4 @@
###
###
### The output of this importer is bad.
@ -12,14 +10,6 @@
###
###
# Import from Zoho.
# Be sure to get the posts CSV file, AND the user list csv file with people's email addresses.
# You may need to contact Zoho support for the user list.
@ -64,7 +54,7 @@ class ImportScripts::Zoho < ImportScripts::Base
def import_users
puts "", "Importing users"
create_users( CSV.parse(File.read(File.join(@path, 'users.csv'))) ) do |u|
create_users(CSV.parse(File.read(File.join(@path, 'users.csv')))) do |u|
username = cleanup_zoho_username(u[0])
{
id: username,
@ -105,10 +95,10 @@ class ImportScripts::Zoho < ImportScripts::Base
# Create categories
@categories.each do |parent, subcats|
c = create_category({name: parent}, parent)
c = create_category({ name: parent }, parent)
subcats.each do |subcat|
next if subcat == "Uncategorized" || subcat == "Uncategorised"
create_category({name: subcat, parent_category_id: c.id}, "#{parent}:#{subcat}")
create_category({ name: subcat, parent_category_id: c.id }, "#{parent}:#{subcat}")
end
end
@ -217,7 +207,6 @@ class ImportScripts::Zoho < ImportScripts::Base
CGI.unescapeHTML(x)
end
def import_post_id(row)
# Try to make up a unique id based on the data Zoho gives us.
# The posted_time seems to be the same for all posts in a topic, so we can't use that.