Skip to content

Fix CSV generation for find_inactive_members.rb #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions api/ruby/find-inactive-members/find_inactive_members.rb
Original file line number Diff line number Diff line change
Expand Up @@ -210,21 +210,27 @@ def member_activity

# open a new csv for output
CSV.open("inactive_users.csv", "wb") do |csv|
csv << ["login", "email"]
# iterate and print inactive members
@members.each do |member|
if member[:active] == false
member_detail = "#{member[:login]},#{member[:email] unless member[:email].nil?}"
member_detail = []
member_detail << member[:login]
member_detail << member[:email] unless member[:email].nil?
info "#{member_detail} is inactive\n"
csv << [member_detail]
csv << member_detail
end
end
end

CSV.open("unrecognized_authors.csv", "wb") do |csv|
csv << ["name", "email"]
@unrecognized_authors.each do |author|
author_detail = "#{author[:name]},#{author[:email]}"
author_detail = []
author_detail << author[:name]
author_detail << author[:email]
info "#{author_detail} is unrecognized\n"
csv << [author_detail]
csv << author_detail
end
end
end
Expand Down