meibo 0.10.0 → 0.12.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: 81c241cd2d1a3603d9c298a9a7184c59bce8d3202c47abe00e032b2977996bea
4
- data.tar.gz: 71fd725549de0aeae48e99f5168b8ccd89c2c6e123aa594db89056c751cb06d4
3
+ metadata.gz: f252ebdf57a419551a3b65f21656ea93a2d949c72dd4e957a69aa30a9ab978af
4
+ data.tar.gz: 2b3d36b6b7eb8268046e06308d73531b9cec3f849cecc0e3750069435f40c04c
5
5
  SHA512:
6
- metadata.gz: e033966fe38e2571b8ac48e8be83f1b16bf38079c1f31dbd282bbdb67e29b424bfd5ff7d1fffe7d02c6069da09fd0500ea13070b2e7d1457914ae8d51656462f
7
- data.tar.gz: 1caa9f1c35a55e4cc1e640480e92f31c7a2993272ee52f3ef7a31cb5eb50430466f8fdbc9f4aafd26cc7b34f7201eaee00736f0dcff2bfa8c0a46368a15810ee
6
+ metadata.gz: b18d0f8dddadb024f22df2832ad0133fbe1af864143eed2de56108a06e68e97eea28a60909f3eda192fa45c45b5165ef4c1b80805c969d99704bbecd66001618
7
+ data.tar.gz: 0a1cf57f5dd8e08b362cc3cd107ae527c45683b7796ef02db788416a65958a99b3ff5605af8ea64b32b5b3ece0ca2236d60d0da12aad941fded971388e731dc5
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- meibo (0.10.0)
4
+ meibo (0.12.0)
5
5
  rubyzip
6
6
  zeitwerk
7
7
 
data/lib/meibo/builder.rb CHANGED
@@ -10,7 +10,7 @@ module Meibo
10
10
 
11
11
  def_delegators :@roster, :academic_sessions, :classes, :courses, :demographics, :enrollments, :organizations, :roles, :users, :user_profiles
12
12
 
13
- def initialize(roster:, profile: Profile.new)
13
+ def initialize(roster:, profile: Meibo.default_profile)
14
14
  @roster = roster
15
15
  @profile = profile
16
16
  end
@@ -15,8 +15,8 @@ FactoryBot.define do
15
15
  sourced_id { SecureRandom.uuid }
16
16
  title { "#{school_year}年度" }
17
17
  type { Meibo::AcademicSession::TYPES[:school_year] }
18
- start_date { Date.new(school_year, 4, 1).iso8601 }
19
- end_date { Date.new(school_year + 1, 3, 31).iso8601 }
18
+ start_date { Date.new(school_year, 4, 1) }
19
+ end_date { Date.new(school_year + 1, 3, 31) }
20
20
  parent_sourced_id { parent&.sourced_id }
21
21
  school_year { today.year }
22
22
 
data/lib/meibo/reader.rb CHANGED
@@ -5,7 +5,7 @@ require 'zip'
5
5
 
6
6
  module Meibo
7
7
  class Reader
8
- def self.open(file_path, profile: Profile.new)
8
+ def self.open(file_path, profile: Meibo.default_profile)
9
9
  Zip::File.open(file_path) do |zipfile|
10
10
  yield new(zipfile: zipfile, profile: profile)
11
11
  end
data/lib/meibo/roster.rb CHANGED
@@ -6,7 +6,7 @@ require 'csv'
6
6
  module Meibo
7
7
  class Roster
8
8
  class << self
9
- def from_file(file_path, profile: Profile.new)
9
+ def from_file(file_path, profile: Meibo.default_profile)
10
10
  Reader.open(file_path, profile: profile) do |reader|
11
11
  begin
12
12
  manifest = reader.manifest
@@ -66,7 +66,7 @@ module Meibo
66
66
 
67
67
  attr_reader :profile, :manifest_properties, :academic_sessions, :classes, :courses, :demographics, :enrollments, :organizations, :roles, :user_profiles, :users
68
68
 
69
- def initialize(profile: Profile.new, manifest_properties: {}, academic_sessions: [], classes: [], courses: [], demographics: [], enrollments: [], organizations: [], roles: [], user_profiles: [], users: [])
69
+ def initialize(profile: Meibo.default_profile, manifest_properties: {}, academic_sessions: [], classes: [], courses: [], demographics: [], enrollments: [], organizations: [], roles: [], user_profiles: [], users: [])
70
70
  @profile = profile
71
71
  @manifest_properties = manifest_properties
72
72
  @academic_sessions = AcademicSessionSet.new(academic_sessions, roster: self)
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.10.0"
4
+ VERSION = "0.12.0"
5
5
  end
data/lib/meibo.rb CHANGED
@@ -12,6 +12,12 @@ require_relative "meibo/errors"
12
12
  module Meibo
13
13
  CSV_ENCODING = 'UTF-8'
14
14
  ENUM_EXT_PATTERN = /\Aext:[a-zA-Z0-9\.\-_]+\z/
15
+
16
+ class << self
17
+ attr_accessor :default_profile
18
+ end
15
19
  end
16
20
 
17
21
  loader.eager_load
22
+
23
+ Meibo.default_profile = Meibo::Profile.new
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.10.0
4
+ version: 0.12.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: 2022-11-08 00:00:00.000000000 Z
11
+ date: 2022-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip
@@ -125,7 +125,7 @@ metadata:
125
125
  allowed_push_host: https://rubygems.org/
126
126
  homepage_uri: https://github.com/hanachin/meibo
127
127
  source_code_uri: https://github.com/hanachin/meibo
128
- changelog_uri: https://github.com/hanachin/meibo/blob/meibo/v0.10.0/CHANGELOG.md
128
+ changelog_uri: https://github.com/hanachin/meibo/blob/meibo/v0.12.0/CHANGELOG.md
129
129
  post_install_message:
130
130
  rdoc_options: []
131
131
  require_paths: