meibo 0.21.0 → 0.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/meibo/builder.rb +1 -1
- data/lib/meibo/data_model.rb +10 -4
- data/lib/meibo/errors.rb +11 -2
- data/lib/meibo/japan_profile/academic_session.rb +1 -1
- data/lib/meibo/japan_profile/classroom.rb +1 -1
- data/lib/meibo/japan_profile/course.rb +1 -1
- data/lib/meibo/japan_profile/demographic.rb +1 -1
- data/lib/meibo/japan_profile/enrollment.rb +1 -1
- data/lib/meibo/japan_profile/organization.rb +1 -1
- data/lib/meibo/japan_profile/{role.rb → role_jp_m0.rb} +2 -2
- data/lib/meibo/japan_profile/user.rb +33 -22
- data/lib/meibo/japan_profile/user_m0.rb +12 -0
- data/lib/meibo/japan_profile/user_set.rb +1 -1
- data/lib/meibo/profile.rb +1 -37
- data/lib/meibo/profiles.rb +112 -0
- data/lib/meibo/reader.rb +2 -2
- data/lib/meibo/roster.rb +3 -3
- data/lib/meibo/user.rb +2 -4
- data/lib/meibo/user_m0.rb +47 -0
- data/lib/meibo/version.rb +1 -1
- data/lib/meibo.rb +13 -1
- metadata +7 -5
- data/lib/meibo/japan_profile.rb +0 -37
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6a33eff8e804e9e53783c3362da8d3cc6808a728915cfd03f9ac11387c30f7fe
|
4
|
+
data.tar.gz: 2a981345145594726702674e49e8c471b15cf4fc915beb047428e2736289a597
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: efc2d0285dd92b3f78caf114f0457f469d1ced8fb14afc1994d0800d2d94504f5978bfab5beb6cca01e1758277245c65177e49a90c72e9ba329a37e21c82d686
|
7
|
+
data.tar.gz: 12e6995e8e4176926375b166b7cd1762f8ecc7466ee51d8faaf9808ddf81bdb99a34cc420e1ee16e880de757d3c27fe81eb71f4fccaafa916427dfa03ae5e944
|
data/Gemfile.lock
CHANGED
data/lib/meibo/builder.rb
CHANGED
@@ -11,7 +11,7 @@ module Meibo
|
|
11
11
|
def_delegators :@roster, :academic_sessions, :classes, :courses, :demographics, :enrollments, :organizations,
|
12
12
|
:roles, :users, :user_profiles
|
13
13
|
|
14
|
-
def initialize(roster:, profile: Meibo.
|
14
|
+
def initialize(roster:, profile: Meibo.current_profile)
|
15
15
|
@roster = roster
|
16
16
|
@profile = profile
|
17
17
|
end
|
data/lib/meibo/data_model.rb
CHANGED
@@ -8,16 +8,22 @@ module Meibo
|
|
8
8
|
def parse(csv)
|
9
9
|
return to_enum(:parse, csv) unless block_given?
|
10
10
|
|
11
|
-
|
12
|
-
missing_headers = header_fields - actual_headers
|
13
|
-
raise MissingHeadersError, "missing headers: #{missing_headers.join(",")}" unless missing_headers.empty?
|
14
|
-
raise ScrambledHeadersError unless actual_headers.take(header_fields.size) == header_fields
|
11
|
+
validate_header_fields(CSV.parse_line(csv))
|
15
12
|
|
16
13
|
CSV.parse(csv, encoding: Meibo::CSV_ENCODING, headers: true, converters: parser_converters,
|
17
14
|
header_converters: header_converters).each do |row|
|
18
15
|
yield new(**row.to_h)
|
19
16
|
end
|
20
17
|
end
|
18
|
+
|
19
|
+
def validate_header_fields(actual_header_fields)
|
20
|
+
missing_header_fields = header_fields - actual_header_fields
|
21
|
+
unless missing_header_fields.empty?
|
22
|
+
message = "missing header fields: #{missing_header_fields.join(",")}"
|
23
|
+
raise MissingHeaderFieldsError.new(message, missing_header_fields: missing_header_fields)
|
24
|
+
end
|
25
|
+
raise ScrambledHeaderFieldsError unless actual_header_fields.take(header_fields.size) == header_fields
|
26
|
+
end
|
21
27
|
end
|
22
28
|
|
23
29
|
def self.define(klass, attribute_name_to_header_field_map:, converters: {})
|
data/lib/meibo/errors.rb
CHANGED
@@ -6,8 +6,17 @@ module Meibo
|
|
6
6
|
class DataNotFoundError < Error; end
|
7
7
|
class InvalidDataTypeError < Error; end
|
8
8
|
class MissingDataError < Error; end
|
9
|
-
|
9
|
+
|
10
|
+
class MissingHeaderFieldsError < Error
|
11
|
+
attr_reader :missing_header_fields
|
12
|
+
|
13
|
+
def initialize(message = nil, missing_header_fields:)
|
14
|
+
super(message)
|
15
|
+
@missing_header_fields = missing_header_fields
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
10
19
|
class NotSupportedError < Error; end
|
11
|
-
class
|
20
|
+
class ScrambledHeaderFieldsError < Error; end
|
12
21
|
class SourcedIdDuplicatedError < Error; end
|
13
22
|
end
|
@@ -1,32 +1,43 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Meibo
|
4
|
-
|
4
|
+
module JapanProfile
|
5
5
|
class User < ::Meibo::User
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
home_class: nil, **other_fields)
|
20
|
-
super(enabled_user: enabled_user, **other_fields)
|
21
|
-
@kana_given_name = kana_given_name
|
22
|
-
@kana_family_name = kana_family_name
|
23
|
-
@kana_middle_name = kana_middle_name
|
24
|
-
@home_class = home_class
|
6
|
+
module ClassMethods
|
7
|
+
def define_additional_definition(klass)
|
8
|
+
DataModel.define(
|
9
|
+
klass,
|
10
|
+
attribute_name_to_header_field_map: klass.superclass.attribute_name_to_header_field_map.merge(
|
11
|
+
kana_given_name: "metadata.jp.kanaGivenName",
|
12
|
+
kana_family_name: "metadata.jp.kanaFamilyName",
|
13
|
+
kana_middle_name: "metadata.jp.kanaMiddleName",
|
14
|
+
home_class: "metadata.jp.homeClass"
|
15
|
+
).freeze,
|
16
|
+
converters: klass.superclass.converters
|
17
|
+
)
|
18
|
+
end
|
25
19
|
end
|
26
20
|
|
27
|
-
|
28
|
-
|
21
|
+
module InstanceMethods
|
22
|
+
# NOTE: enabled_userは必須ではないが固定
|
23
|
+
def initialize(enabled_user: true, kana_given_name: nil, kana_family_name: nil, kana_middle_name: nil,
|
24
|
+
home_class: nil, **other_fields)
|
25
|
+
super(enabled_user: enabled_user, **other_fields)
|
26
|
+
@kana_given_name = kana_given_name
|
27
|
+
@kana_family_name = kana_family_name
|
28
|
+
@kana_middle_name = kana_middle_name
|
29
|
+
@home_class = home_class
|
30
|
+
end
|
31
|
+
|
32
|
+
def home_classroom
|
33
|
+
home_class && Meibo.current_roster.classes.find(home_class)
|
34
|
+
end
|
29
35
|
end
|
36
|
+
|
37
|
+
include InstanceMethods
|
38
|
+
extend ClassMethods
|
39
|
+
|
40
|
+
define_additional_definition(self)
|
30
41
|
end
|
31
42
|
end
|
32
43
|
end
|
data/lib/meibo/profile.rb
CHANGED
@@ -2,45 +2,9 @@
|
|
2
2
|
|
3
3
|
module Meibo
|
4
4
|
class Profile
|
5
|
-
BUILDERS = {
|
6
|
-
academic_session: Builder::AcademicSessionBuilder.create(AcademicSession),
|
7
|
-
class: Builder::ClassroomBuilder.create(Classroom),
|
8
|
-
course: Builder::CourseBuilder.create(Course),
|
9
|
-
demographic: Builder::DemographicBuilder.create(Demographic),
|
10
|
-
enrollment: Builder::EnrollmentBuilder.create(Enrollment),
|
11
|
-
org: Builder::OrganizationBuilder.create(Organization),
|
12
|
-
role: Builder::RoleBuilder.create(Role),
|
13
|
-
user: Builder::UserBuilder.create(User),
|
14
|
-
user_profile: Builder::UserProfileBuilder.create(UserProfile)
|
15
|
-
}.freeze
|
16
|
-
|
17
|
-
DATA_MODELS = {
|
18
|
-
file_academic_sessions: Meibo::AcademicSession,
|
19
|
-
file_classes: Meibo::Classroom,
|
20
|
-
file_courses: Meibo::Course,
|
21
|
-
file_demographics: Meibo::Demographic,
|
22
|
-
file_enrollments: Meibo::Enrollment,
|
23
|
-
file_orgs: Meibo::Organization,
|
24
|
-
file_roles: Meibo::Role,
|
25
|
-
file_user_profiles: Meibo::UserProfile,
|
26
|
-
file_users: Meibo::User
|
27
|
-
}.freeze
|
28
|
-
|
29
|
-
DATA_SET = {
|
30
|
-
academic_sessions: Meibo::AcademicSessionSet,
|
31
|
-
classes: Meibo::ClassroomSet,
|
32
|
-
courses: Meibo::CourseSet,
|
33
|
-
demographics: Meibo::DemographicSet,
|
34
|
-
enrollments: Meibo::EnrollmentSet,
|
35
|
-
orgs: Meibo::OrganizationSet,
|
36
|
-
roles: Meibo::RoleSet,
|
37
|
-
user_profiles: Meibo::UserProfileSet,
|
38
|
-
users: Meibo::UserSet
|
39
|
-
}.freeze
|
40
|
-
|
41
5
|
attr_reader :builders, :data_models, :data_set
|
42
6
|
|
43
|
-
def initialize(builders
|
7
|
+
def initialize(builders:, data_models:, data_set:)
|
44
8
|
@builders = builders
|
45
9
|
@data_models = data_models
|
46
10
|
@data_set = data_set
|
@@ -0,0 +1,112 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Meibo
|
4
|
+
module Profiles
|
5
|
+
profile121 = Profile.new(
|
6
|
+
builders: {
|
7
|
+
academic_session: Builder::AcademicSessionBuilder.create(AcademicSession),
|
8
|
+
class: Builder::ClassroomBuilder.create(Classroom),
|
9
|
+
course: Builder::CourseBuilder.create(Course),
|
10
|
+
demographic: Builder::DemographicBuilder.create(Demographic),
|
11
|
+
enrollment: Builder::EnrollmentBuilder.create(Enrollment),
|
12
|
+
org: Builder::OrganizationBuilder.create(Organization),
|
13
|
+
role: Builder::RoleBuilder.create(Role),
|
14
|
+
user: Builder::UserBuilder.create(User),
|
15
|
+
user_profile: Builder::UserProfileBuilder.create(UserProfile)
|
16
|
+
},
|
17
|
+
data_models: {
|
18
|
+
file_academic_sessions: Meibo::AcademicSession,
|
19
|
+
file_classes: Meibo::Classroom,
|
20
|
+
file_courses: Meibo::Course,
|
21
|
+
file_demographics: Meibo::Demographic,
|
22
|
+
file_enrollments: Meibo::Enrollment,
|
23
|
+
file_orgs: Meibo::Organization,
|
24
|
+
file_roles: Meibo::Role,
|
25
|
+
file_user_profiles: Meibo::UserProfile,
|
26
|
+
file_users: Meibo::User
|
27
|
+
},
|
28
|
+
data_set: {
|
29
|
+
academic_sessions: Meibo::AcademicSessionSet,
|
30
|
+
classes: Meibo::ClassroomSet,
|
31
|
+
courses: Meibo::CourseSet,
|
32
|
+
demographics: Meibo::DemographicSet,
|
33
|
+
enrollments: Meibo::EnrollmentSet,
|
34
|
+
orgs: Meibo::OrganizationSet,
|
35
|
+
roles: Meibo::RoleSet,
|
36
|
+
user_profiles: Meibo::UserProfileSet,
|
37
|
+
users: Meibo::UserSet
|
38
|
+
}
|
39
|
+
)
|
40
|
+
|
41
|
+
profile120 = Profile.new(
|
42
|
+
builders: profile121.builders.merge(
|
43
|
+
user: Builder::UserBuilder.create(UserM0)
|
44
|
+
),
|
45
|
+
data_models: profile121.data_models.merge(
|
46
|
+
file_users: UserM0
|
47
|
+
),
|
48
|
+
data_set: profile121.data_set
|
49
|
+
)
|
50
|
+
|
51
|
+
japan_profile121_v11 = Profile.new(
|
52
|
+
builders: profile121.builders.merge(
|
53
|
+
academic_session: Builder::AcademicSessionBuilder.create(JapanProfile::AcademicSession),
|
54
|
+
class: Builder::ClassroomBuilder.create(JapanProfile::Classroom),
|
55
|
+
course: Builder::CourseBuilder.create(JapanProfile::Course),
|
56
|
+
demographic: Builder::DemographicBuilder.create(JapanProfile::Demographic),
|
57
|
+
enrollment: Builder::EnrollmentBuilder.create(JapanProfile::Enrollment),
|
58
|
+
org: Builder::OrganizationBuilder.create(JapanProfile::Organization),
|
59
|
+
user: Builder::UserBuilder.create(JapanProfile::User)
|
60
|
+
),
|
61
|
+
data_models: profile121.data_models.merge(
|
62
|
+
file_academic_sessions: JapanProfile::AcademicSession,
|
63
|
+
file_classes: JapanProfile::Classroom,
|
64
|
+
file_courses: JapanProfile::Course,
|
65
|
+
file_demographics: JapanProfile::Demographic,
|
66
|
+
file_enrollments: JapanProfile::Enrollment,
|
67
|
+
file_orgs: JapanProfile::Organization,
|
68
|
+
file_users: JapanProfile::User
|
69
|
+
),
|
70
|
+
data_set: profile121.data_set.merge(
|
71
|
+
users: JapanProfile::UserSet
|
72
|
+
)
|
73
|
+
)
|
74
|
+
|
75
|
+
japan_profile120_v11 = Profile.new(
|
76
|
+
builders: japan_profile121_v11.builders.merge(
|
77
|
+
user: Builder::UserBuilder.create(JapanProfile::UserM0)
|
78
|
+
),
|
79
|
+
data_models: japan_profile121_v11.data_models.merge(
|
80
|
+
file_users: JapanProfile::UserM0
|
81
|
+
),
|
82
|
+
data_set: japan_profile121_v11.data_set
|
83
|
+
)
|
84
|
+
|
85
|
+
japan_profile120_v10 = Profile.new(
|
86
|
+
builders: japan_profile120_v11.builders.merge(
|
87
|
+
role: Builder::UserBuilder.create(JapanProfile::RoleJpM0)
|
88
|
+
),
|
89
|
+
data_models: japan_profile120_v11.data_models.merge(
|
90
|
+
file_roles: JapanProfile::RoleJpM0
|
91
|
+
),
|
92
|
+
data_set: japan_profile120_v11.data_set
|
93
|
+
)
|
94
|
+
|
95
|
+
PROFILES = {
|
96
|
+
"v1.2" => profile121,
|
97
|
+
"v1.2.1" => profile121,
|
98
|
+
"v1.2.0" => profile120,
|
99
|
+
"v1.2.0 jp v1.0" => japan_profile120_v10,
|
100
|
+
"v1.2.0 jp v1.1" => japan_profile120_v11,
|
101
|
+
"v1.2.1 jp v1.1" => japan_profile121_v11
|
102
|
+
}.freeze
|
103
|
+
|
104
|
+
def self.use(profile_name, &block)
|
105
|
+
Meibo.with_profile(self[profile_name], &block)
|
106
|
+
end
|
107
|
+
|
108
|
+
def self.[](profile_name)
|
109
|
+
PROFILES.fetch(profile_name)
|
110
|
+
end
|
111
|
+
end
|
112
|
+
end
|
data/lib/meibo/reader.rb
CHANGED
@@ -5,13 +5,13 @@ require "zip"
|
|
5
5
|
|
6
6
|
module Meibo
|
7
7
|
class Reader
|
8
|
-
def self.open(file_path, profile: Meibo.
|
8
|
+
def self.open(file_path, profile: Meibo.current_profile)
|
9
9
|
Zip::File.open(file_path) do |zipfile|
|
10
10
|
yield new(zipfile: zipfile, profile: profile)
|
11
11
|
end
|
12
12
|
end
|
13
13
|
|
14
|
-
def self.open_buffer(io, profile: Meibo.
|
14
|
+
def self.open_buffer(io, profile: Meibo.current_profile)
|
15
15
|
Zip::File.open_buffer(io) do |zipfile|
|
16
16
|
yield new(zipfile: zipfile, profile: profile)
|
17
17
|
end
|
data/lib/meibo/roster.rb
CHANGED
@@ -6,13 +6,13 @@ require "csv"
|
|
6
6
|
module Meibo
|
7
7
|
class Roster
|
8
8
|
class << self
|
9
|
-
def from_file(file_path, profile: Meibo.
|
9
|
+
def from_file(file_path, profile: Meibo.current_profile)
|
10
10
|
Reader.open(file_path, profile: profile) do |reader|
|
11
11
|
return read_data(reader, profile)
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
|
-
def from_buffer(io, profile: Meibo.
|
15
|
+
def from_buffer(io, profile: Meibo.current_profile)
|
16
16
|
Reader.open_buffer(io, profile: profile) do |reader|
|
17
17
|
return read_data(reader, profile)
|
18
18
|
end
|
@@ -86,7 +86,7 @@ module Meibo
|
|
86
86
|
attr_reader :profile, :manifest_properties, :academic_sessions, :classes, :courses, :demographics, :enrollments,
|
87
87
|
:organizations, :roles, :user_profiles, :users
|
88
88
|
|
89
|
-
def initialize(profile: Meibo.
|
89
|
+
def initialize(profile: Meibo.current_profile, manifest_properties: {}, academic_sessions: [], classes: [],
|
90
90
|
courses: [], demographics: [], enrollments: [], organizations: [], roles: [], user_profiles: [], users: [])
|
91
91
|
@profile = profile
|
92
92
|
@manifest_properties = manifest_properties
|
data/lib/meibo/user.rb
CHANGED
@@ -24,7 +24,6 @@ module Meibo
|
|
24
24
|
grades: "grades",
|
25
25
|
password: "password",
|
26
26
|
user_master_identifier: "userMasterIdentifier",
|
27
|
-
resource_sourced_ids: "resourceSourcedIds",
|
28
27
|
preferred_given_name: "preferredGivenName",
|
29
28
|
preferred_middle_name: "preferredMiddleName",
|
30
29
|
preferred_family_name: "preferredFamilyName",
|
@@ -34,7 +33,7 @@ module Meibo
|
|
34
33
|
converters: {
|
35
34
|
boolean: [:enabled_user].freeze,
|
36
35
|
datetime: [:date_last_modified].freeze,
|
37
|
-
list: %i[user_ids agent_sourced_ids grades
|
36
|
+
list: %i[user_ids agent_sourced_ids grades].freeze,
|
38
37
|
required: %i[sourced_id enabled_user username given_name family_name].freeze,
|
39
38
|
status: [:status].freeze,
|
40
39
|
user_ids: [:user_ids].freeze
|
@@ -42,7 +41,7 @@ module Meibo
|
|
42
41
|
)
|
43
42
|
|
44
43
|
def initialize(sourced_id:, username:, given_name:, family_name:, status: nil, date_last_modified: nil,
|
45
|
-
enabled_user: nil, user_ids: nil, middle_name: nil, identifier: nil, email: nil, sms: nil, phone: nil, agent_sourced_ids: [], grades: nil, password: nil, user_master_identifier: nil,
|
44
|
+
enabled_user: nil, user_ids: nil, middle_name: nil, identifier: nil, email: nil, sms: nil, phone: nil, agent_sourced_ids: [], grades: nil, password: nil, user_master_identifier: nil, preferred_given_name: nil, preferred_middle_name: nil, preferred_family_name: nil, primary_org_sourced_id: nil, pronouns: nil, **extension_fields)
|
46
45
|
@sourced_id = sourced_id
|
47
46
|
@status = status
|
48
47
|
@date_last_modified = date_last_modified
|
@@ -60,7 +59,6 @@ module Meibo
|
|
60
59
|
@grades = grades
|
61
60
|
@password = password
|
62
61
|
@user_master_identifier = user_master_identifier
|
63
|
-
@resource_sourced_ids = resource_sourced_ids
|
64
62
|
@preferred_given_name = preferred_given_name
|
65
63
|
@preferred_middle_name = preferred_middle_name
|
66
64
|
@preferred_family_name = preferred_family_name
|
@@ -0,0 +1,47 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Meibo
|
4
|
+
class UserM0 < ::Meibo::User
|
5
|
+
DataModel.define(
|
6
|
+
self,
|
7
|
+
attribute_name_to_header_field_map: {
|
8
|
+
sourced_id: "sourcedId",
|
9
|
+
status: "status",
|
10
|
+
date_last_modified: "dateLastModified",
|
11
|
+
enabled_user: "enabledUser",
|
12
|
+
username: "username",
|
13
|
+
user_ids: "userIds",
|
14
|
+
given_name: "givenName",
|
15
|
+
family_name: "familyName",
|
16
|
+
middle_name: "middleName",
|
17
|
+
identifier: "identifier",
|
18
|
+
email: "email",
|
19
|
+
sms: "sms",
|
20
|
+
phone: "phone",
|
21
|
+
agent_sourced_ids: "agentSourcedIds",
|
22
|
+
grades: "grades",
|
23
|
+
password: "password",
|
24
|
+
user_master_identifier: "userMasterIdentifier",
|
25
|
+
resource_sourced_ids: "resourceSourcedIds",
|
26
|
+
preferred_given_name: "preferredGivenName",
|
27
|
+
preferred_middle_name: "preferredMiddleName",
|
28
|
+
preferred_family_name: "preferredFamilyName",
|
29
|
+
primary_org_sourced_id: "primaryOrgSourcedId",
|
30
|
+
pronouns: "pronouns"
|
31
|
+
}.freeze,
|
32
|
+
converters: superclass.converters.merge(
|
33
|
+
list: %i[user_ids agent_sourced_ids grades resource_sourced_ids].freeze
|
34
|
+
)
|
35
|
+
)
|
36
|
+
|
37
|
+
# NOTE: enabled_userは必須ではないが固定
|
38
|
+
def initialize(resource_sourced_ids: nil, **other_fields)
|
39
|
+
super(**other_fields)
|
40
|
+
@resource_sourced_ids = resource_sourced_ids
|
41
|
+
end
|
42
|
+
|
43
|
+
def home_classroom
|
44
|
+
home_class && Meibo.current_roster.classes.find(home_class)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
data/lib/meibo/version.rb
CHANGED
data/lib/meibo.rb
CHANGED
@@ -16,10 +16,22 @@ module Meibo
|
|
16
16
|
class << self
|
17
17
|
attr_accessor :default_profile
|
18
18
|
|
19
|
+
def current_profile
|
20
|
+
thread_local_data[:current_profile] || default_profile
|
21
|
+
end
|
22
|
+
|
19
23
|
def current_roster
|
20
24
|
thread_local_data[:roster]
|
21
25
|
end
|
22
26
|
|
27
|
+
def with_profile(default_profile)
|
28
|
+
orig_default_profile = thread_local_data[:current_profile]
|
29
|
+
thread_local_data[:current_profile] = default_profile
|
30
|
+
yield
|
31
|
+
ensure
|
32
|
+
thread_local_data[:current_profile] = orig_default_profile
|
33
|
+
end
|
34
|
+
|
23
35
|
def with_roster(roster)
|
24
36
|
orig_roster = thread_local_data[:roster]
|
25
37
|
thread_local_data[:roster] = roster
|
@@ -38,4 +50,4 @@ end
|
|
38
50
|
|
39
51
|
loader.eager_load
|
40
52
|
|
41
|
-
Meibo.default_profile = Meibo::
|
53
|
+
Meibo.default_profile = Meibo::Profiles["v1.2"]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meibo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Seiei Miyagi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: csv
|
@@ -107,26 +107,28 @@ files:
|
|
107
107
|
- lib/meibo/factory_bot/roster.rb
|
108
108
|
- lib/meibo/factory_bot/user.rb
|
109
109
|
- lib/meibo/factory_bot/user_profile.rb
|
110
|
-
- lib/meibo/japan_profile.rb
|
111
110
|
- lib/meibo/japan_profile/academic_session.rb
|
112
111
|
- lib/meibo/japan_profile/classroom.rb
|
113
112
|
- lib/meibo/japan_profile/course.rb
|
114
113
|
- lib/meibo/japan_profile/demographic.rb
|
115
114
|
- lib/meibo/japan_profile/enrollment.rb
|
116
115
|
- lib/meibo/japan_profile/organization.rb
|
117
|
-
- lib/meibo/japan_profile/
|
116
|
+
- lib/meibo/japan_profile/role_jp_m0.rb
|
118
117
|
- lib/meibo/japan_profile/user.rb
|
118
|
+
- lib/meibo/japan_profile/user_m0.rb
|
119
119
|
- lib/meibo/japan_profile/user_set.rb
|
120
120
|
- lib/meibo/manifest.rb
|
121
121
|
- lib/meibo/manifest/processing_mode.rb
|
122
122
|
- lib/meibo/organization.rb
|
123
123
|
- lib/meibo/organization_set.rb
|
124
124
|
- lib/meibo/profile.rb
|
125
|
+
- lib/meibo/profiles.rb
|
125
126
|
- lib/meibo/reader.rb
|
126
127
|
- lib/meibo/role.rb
|
127
128
|
- lib/meibo/role_set.rb
|
128
129
|
- lib/meibo/roster.rb
|
129
130
|
- lib/meibo/user.rb
|
131
|
+
- lib/meibo/user_m0.rb
|
130
132
|
- lib/meibo/user_profile.rb
|
131
133
|
- lib/meibo/user_profile_set.rb
|
132
134
|
- lib/meibo/user_set.rb
|
@@ -140,7 +142,7 @@ metadata:
|
|
140
142
|
allowed_push_host: https://rubygems.org/
|
141
143
|
homepage_uri: https://github.com/hanachin/meibo
|
142
144
|
source_code_uri: https://github.com/hanachin/meibo
|
143
|
-
changelog_uri: https://github.com/hanachin/meibo/blob/meibo/v0.
|
145
|
+
changelog_uri: https://github.com/hanachin/meibo/blob/meibo/v0.22.0/CHANGELOG.md
|
144
146
|
rubygems_mfa_required: 'true'
|
145
147
|
post_install_message:
|
146
148
|
rdoc_options: []
|
data/lib/meibo/japan_profile.rb
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Meibo
|
4
|
-
class JapanProfile < ::Meibo::Profile
|
5
|
-
BUILDERS = {
|
6
|
-
academic_session: Builder::AcademicSessionBuilder.create(AcademicSession),
|
7
|
-
class: Builder::ClassroomBuilder.create(Classroom),
|
8
|
-
course: Builder::CourseBuilder.create(Course),
|
9
|
-
demographic: Builder::DemographicBuilder.create(Demographic),
|
10
|
-
enrollment: Builder::EnrollmentBuilder.create(Enrollment),
|
11
|
-
org: Builder::OrganizationBuilder.create(Organization),
|
12
|
-
role: Builder::RoleBuilder.create(Role),
|
13
|
-
user: Builder::UserBuilder.create(User),
|
14
|
-
user_profile: Builder::UserProfileBuilder.create(UserProfile)
|
15
|
-
}.freeze
|
16
|
-
|
17
|
-
DATA_MODELS = {
|
18
|
-
file_academic_sessions: AcademicSession,
|
19
|
-
file_classes: Classroom,
|
20
|
-
file_courses: Course,
|
21
|
-
file_demographics: Demographic,
|
22
|
-
file_enrollments: Enrollment,
|
23
|
-
file_orgs: Organization,
|
24
|
-
file_roles: Role,
|
25
|
-
file_user_profiles: UserProfile,
|
26
|
-
file_users: User
|
27
|
-
}.freeze
|
28
|
-
|
29
|
-
DATA_SET = ::Meibo::Profile::DATA_SET.merge(
|
30
|
-
users: UserSet
|
31
|
-
)
|
32
|
-
|
33
|
-
def initialize(builders: BUILDERS, data_models: DATA_MODELS, data_set: DATA_SET)
|
34
|
-
super
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|