meibo 0.22.0 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a33eff8e804e9e53783c3362da8d3cc6808a728915cfd03f9ac11387c30f7fe
4
- data.tar.gz: 2a981345145594726702674e49e8c471b15cf4fc915beb047428e2736289a597
3
+ metadata.gz: 00f82e2a36647d4e79e1bc9df6a1a69b0c3bbc9a09d77fe89fa05680d8cf2998
4
+ data.tar.gz: 5c363d7995a6e8c57afe83e6e77635ca7011c7c62528c486e5973b5c8a01ecbf
5
5
  SHA512:
6
- metadata.gz: efc2d0285dd92b3f78caf114f0457f469d1ced8fb14afc1994d0800d2d94504f5978bfab5beb6cca01e1758277245c65177e49a90c72e9ba329a37e21c82d686
7
- data.tar.gz: 12e6995e8e4176926375b166b7cd1762f8ecc7466ee51d8faaf9808ddf81bdb99a34cc420e1ee16e880de757d3c27fe81eb71f4fccaafa916427dfa03ae5e944
6
+ metadata.gz: c2960714575f4ea47e52851b183245e775d043a9a02bd5eed559843a98abbcc303c74496693c999fa0bc5dc3ac421b626983e1bc75b54510f805b4087826a899
7
+ data.tar.gz: f809d3d5e3149c35cd2f43af3bc4795664cd59a7d458f955e33d6ea00dd481ba3d9270365167ab1b27b48fd2f6b983a361915789109cc5c447c4753590b977d4
data/.rubocop_todo.yml CHANGED
@@ -29,7 +29,8 @@ Metrics/AbcSize:
29
29
  # Configuration parameters: CountComments, CountAsOne, ExcludedMethods, AllowedMethods, AllowedPatterns, IgnoredMethods, inherit_mode.
30
30
  # AllowedMethods: refine
31
31
  Metrics/BlockLength:
32
- Max: 57
32
+ Exclude:
33
+ - 'lib/meibo/factory_bot/**/*.rb'
33
34
 
34
35
  # Offense count: 4
35
36
  # Configuration parameters: CountComments, CountAsOne.
@@ -49,7 +50,7 @@ Metrics/MethodLength:
49
50
  # Offense count: 1
50
51
  # Configuration parameters: CountComments, CountAsOne.
51
52
  Metrics/ModuleLength:
52
- Max: 222
53
+ Max: 231
53
54
 
54
55
  # Offense count: 16
55
56
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- meibo (0.22.0)
4
+ meibo (0.24.0)
5
5
  csv (>= 3.1.4)
6
6
  rubyzip
7
7
  zeitwerk
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require "date"
4
+ require "set"
4
5
  require "time"
5
6
 
6
7
  module Meibo
@@ -12,6 +13,7 @@ module Meibo
12
13
  date
13
14
  datetime
14
15
  enum
16
+ mext_grade_code
15
17
  integer
16
18
  status
17
19
  user_ids
@@ -142,6 +144,17 @@ module Meibo
142
144
  end
143
145
  end
144
146
 
147
+ def build_mext_grade_code_field_parser_converter(grade_field_indexes)
148
+ valid_grade = %w[P1 P2 P3 P4 P5 P6 J1 J2 J3 H1 H2 H3 E1 E2 E3].to_set
149
+ lambda do |grades, field_info|
150
+ next grades unless grade_field_indexes.include?(field_info.index)
151
+
152
+ raise InvalidDataTypeError unless grades.all? { |grade| valid_grade.include?(grade) }
153
+
154
+ grades
155
+ end
156
+ end
157
+
145
158
  def build_integer_field_parser_converter(integer_field_indexes)
146
159
  integer_field_indexes = integer_field_indexes.dup.freeze
147
160
  lambda do |field, field_info|
@@ -75,7 +75,16 @@ FactoryBot.define do
75
75
  end
76
76
 
77
77
  trait :jp do
78
- initialize_with { Meibo::JapanProfile::Role.new(**attributes) }
78
+ jp_version { "1.1" }
79
+
80
+ initialize_with do
81
+ case jp_version
82
+ when "1.1"
83
+ Meibo::Role.new(**attributes)
84
+ when "1.0"
85
+ Meibo::JapanProfile::RoleJpM0.new(**attributes)
86
+ end
87
+ end
79
88
  end
80
89
  end
81
90
  end
@@ -5,11 +5,19 @@ require "securerandom"
5
5
 
6
6
  FactoryBot.define do
7
7
  factory :meibo_user, class: "Meibo::User" do
8
- initialize_with { new(**attributes) }
8
+ initialize_with do
9
+ case oneroster_version
10
+ when "1.2.1"
11
+ new(**attributes)
12
+ when "1.2", "1.2.0"
13
+ Meibo::UserM0.new(**attributes)
14
+ end
15
+ end
9
16
 
10
17
  transient do
11
18
  agents { [] }
12
19
  primary_organization { nil }
20
+ oneroster_version { "1.2.1" }
13
21
  end
14
22
 
15
23
  sourced_id { SecureRandom.uuid }
@@ -20,7 +28,14 @@ FactoryBot.define do
20
28
  primary_org_sourced_id { primary_organization&.sourced_id }
21
29
 
22
30
  trait :jp do
23
- initialize_with { Meibo::JapanProfile::User.new(**attributes) }
31
+ initialize_with do
32
+ case oneroster_version
33
+ when "1.2.1"
34
+ Meibo::JapanProfile::User.new(**attributes)
35
+ when "1.2", "1.2.0"
36
+ Meibo::JapanProfile::UserM0.new(**attributes)
37
+ end
38
+ end
24
39
 
25
40
  transient do
26
41
  homeroom { nil }
@@ -10,7 +10,8 @@ module Meibo
10
10
  ).freeze,
11
11
  converters: superclass.converters.merge(
12
12
  boolean: [:special_needs].freeze,
13
- enum: { class_type: TYPES.values.freeze }.freeze
13
+ enum: { class_type: TYPES.values.freeze }.freeze,
14
+ mext_grade_code: [:grades].freeze
14
15
  ).freeze
15
16
  )
16
17
 
@@ -6,7 +6,7 @@ module Meibo
6
6
  DataModel.define(
7
7
  self,
8
8
  attribute_name_to_header_field_map: superclass.attribute_name_to_header_field_map,
9
- converters: superclass.converters.merge(enum: { course_code: [""].freeze }.freeze)
9
+ converters: superclass.converters.merge(enum: { course_code: [""].freeze }.freeze, mext_grade_code: [:grades].freeze)
10
10
  )
11
11
 
12
12
  # NOTE: courseCodeは空文字固定
data/lib/meibo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Meibo
4
- VERSION = "0.22.0"
4
+ VERSION = "0.24.0"
5
5
  end
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.22.0
4
+ version: 0.24.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-02-22 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: csv
@@ -142,7 +142,7 @@ metadata:
142
142
  allowed_push_host: https://rubygems.org/
143
143
  homepage_uri: https://github.com/hanachin/meibo
144
144
  source_code_uri: https://github.com/hanachin/meibo
145
- changelog_uri: https://github.com/hanachin/meibo/blob/meibo/v0.22.0/CHANGELOG.md
145
+ changelog_uri: https://github.com/hanachin/meibo/blob/meibo/v0.24.0/CHANGELOG.md
146
146
  rubygems_mfa_required: 'true'
147
147
  post_install_message:
148
148
  rdoc_options: []