Skip to content

Commit 666ecf7

Browse files
committed
rename SIS::CSV::BaseImporter to SIS::CSV::CSVBaseImporter
There is also a SIS::BaseImporter in the outer module/namespace, which makes having the same class name in a nested module really error prone. Change-Id: Ia61f87088748212f855577570a28871c06fe87d9 Reviewed-on: https://gerrit.instructure.com/19292 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Duane Johnson <duane@instructure.com> QA-Review: Clare Hetherington <clare@instructure.com> Reviewed-by: Jacob Fugal <jacob@instructure.com> Product-Review: Brian Palmer <brianp@instructure.com>
1 parent 14368ab commit 666ecf7

13 files changed

Lines changed: 15 additions & 15 deletions

lib/sis/csv/abstract_course_importer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
module SIS
2020
module CSV
21-
class AbstractCourseImporter < BaseImporter
21+
class AbstractCourseImporter < CSVBaseImporter
2222

2323
def self.is_abstract_course_csv?(row)
2424
row.include?('abstract_course_id') && !row.include?('course_id') && row.include?('short_name')

lib/sis/csv/account_importer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
module SIS
2020
module CSV
21-
class AccountImporter < BaseImporter
21+
class AccountImporter < CSVBaseImporter
2222

2323
def self.is_account_csv?(row)
2424
row.include?('account_id') && row.include?('parent_account_id')

lib/sis/csv/course_importer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
module SIS
2020
module CSV
21-
class CourseImporter < BaseImporter
21+
class CourseImporter < CSVBaseImporter
2222

2323
def self.is_course_csv?(row)
2424
row.include?('course_id') && row.include?('short_name')
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
module SIS
2222
module CSV
23-
class BaseImporter
23+
class CSVBaseImporter
2424
PARSE_ARGS = {:headers => :first_row,
2525
:skip_blanks => true,
2626
:header_converters => :downcase,

lib/sis/csv/enrollment_importer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
module SIS
2020
module CSV
21-
class EnrollmentImporter < BaseImporter
21+
class EnrollmentImporter < CSVBaseImporter
2222

2323
def self.is_enrollment_csv?(row)
2424
(row.include?('section_id') || row.include?('course_id')) && row.include?('user_id')

lib/sis/csv/grade_publishing_results_importer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
module SIS
2020
module CSV
21-
class GradePublishingResultsImporter < BaseImporter
21+
class GradePublishingResultsImporter < CSVBaseImporter
2222

2323
def self.is_grade_publishing_results_csv?(row)
2424
row.include?('enrollment_id') && row.include?('grade_publishing_status')

lib/sis/csv/group_importer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
module SIS
2020
module CSV
2121
# note these are account-level groups, not course groups
22-
class GroupImporter < BaseImporter
22+
class GroupImporter < CSVBaseImporter
2323
def self.is_group_csv?(row)
2424
row.include?('group_id') && row.include?('name')
2525
end

lib/sis/csv/group_membership_importer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
module SIS
2020
module CSV
21-
class GroupMembershipImporter < BaseImporter
21+
class GroupMembershipImporter < CSVBaseImporter
2222
def self.is_group_membership_csv?(row)
2323
row.include?('group_id') && row.include?('user_id')
2424
end

lib/sis/csv/import.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def process
108108
@csvs[importer].reject! do |csv|
109109
begin
110110
rows = 0
111-
FasterCSV.open(csv[:fullpath], "rb", BaseImporter::PARSE_ARGS) do |faster_csv|
111+
FasterCSV.open(csv[:fullpath], "rb", CSVBaseImporter::PARSE_ARGS) do |faster_csv|
112112
rows += 1 while faster_csv.shift
113113
end
114114
@rows[importer] += rows
@@ -336,7 +336,7 @@ def rebalance_csvs(importer)
336336
Attachment.skip_3rd_party_submits
337337
@csvs[importer].each do |csv|
338338
remaining_in_batch = 0
339-
FasterCSV.foreach(csv[:fullpath], BaseImporter::PARSE_ARGS) do |row|
339+
FasterCSV.foreach(csv[:fullpath], CSVBaseImporter::PARSE_ARGS) do |row|
340340
if remaining_in_batch == 0
341341
temp_file += 1
342342
if out_csv
@@ -399,7 +399,7 @@ def process_file(base, file)
399399
return
400400
end
401401
begin
402-
FasterCSV.foreach(csv[:fullpath], BaseImporter::PARSE_ARGS.merge(:headers => false)) do |row|
402+
FasterCSV.foreach(csv[:fullpath], CSVBaseImporter::PARSE_ARGS.merge(:headers => false)) do |row|
403403
row.each(&:downcase!)
404404
importer = IMPORTERS.index do |importer|
405405
if SIS::CSV.const_get(importer.to_s.camelcase + 'Importer').send('is_' + importer.to_s + '_csv?', row)

lib/sis/csv/section_importer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
module SIS
2020
module CSV
21-
class SectionImporter < BaseImporter
21+
class SectionImporter < CSVBaseImporter
2222

2323
def self.is_section_csv?(row)
2424
#This matcher works because an enrollment doesn't have name

0 commit comments

Comments
 (0)