kirico 1.0.4 → 1.0.5

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
  SHA1:
3
- metadata.gz: 28534524bcc437fdf758e1d22da04ec2466196b0
4
- data.tar.gz: cf58e75afffd2437f309309a0c94c270322bbb3f
3
+ metadata.gz: b032116ad8c9f2d4855e50dd82fd02660f8dfce3
4
+ data.tar.gz: 40cbf3b7fe3232fb3a505b4029f004b06d211abd
5
5
  SHA512:
6
- metadata.gz: a4a204454daf43b2e2817a0f75ce67f5bdfd9fe6b08be3bea6fc3023e70c09ba8e574c4d1c6d5d299d2caaf4ec926a1fb1d51be0fe85602bf6a569ca2594265e
7
- data.tar.gz: 7f46f860418f9bd7da4906d867420bee5ab507dfc3943d624985889bdb7f00d11adb627572c7792f33e039b17f897ce59103d1add80a2e9782e784581550249f
6
+ metadata.gz: 800ba09cda1c0b96563bee84256087597ec6e7ae733d903f34c857f40a45deb374d39dc4e63a4b70e4abcaa29b5f3733ee0da8af0002bb78c0bf7156a29648eb
7
+ data.tar.gz: 1fbae68e0d12f7fd80024df54bd341c7f77815e38afb0498ca6d4131883a34e7236141309c0009f4fdc3516ddab217e65334fc5aaf28458fbc82bbb1dd0d4a38
data/README.md CHANGED
@@ -218,7 +218,7 @@ Copyright (c) 2017 Kensuke NAITO and SmartHR, Inc.
218
218
 
219
219
  # SmartHR について
220
220
 
221
- ![SmartHR logo](https://cloud.githubusercontent.com/assets/2214179/24910676/79ef6ada-1f03-11e7-856a-9f9737942867.png)
221
+ <img src="https://user-images.githubusercontent.com/2214179/30309095-3fb58b08-97c4-11e7-939b-b4b97414bb1d.png" width="300">
222
222
 
223
223
  kirico は株式会社 SmartHR によってメンテナンス、開発が行われています。
224
224
  わたしたちは OSS の力を信じています。
@@ -1,4 +1,5 @@
1
1
  # coding: utf-8
2
+
2
3
  lib = File.expand_path('../lib', __FILE__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
5
  require 'kirico/version'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'kirico/version'
3
4
  require 'kirico/models/application_record'
4
5
  require 'kirico/models/company_count'
@@ -4,6 +4,15 @@ en:
4
4
  messages:
5
5
  invalid_charset: "has invalid character(s): %{error_chars}"
6
6
  invalid_space_divider: "must be dividied by %{space_type}"
7
+ too_long_in_bytes:
8
+ one: is too long (maximum is 1 byte)
9
+ other: is too long (maximum is %{count} bytes)
10
+ too_short_in_bytes:
11
+ one: is too short (minimum is 1 byte)
12
+ other: is too short (minimum is %{count} bytes)
13
+ wrong_length_in_bytes:
14
+ one: is the wrong length (should be 1 byte)
15
+ other: is the wrong length (should be %{count} bytes)
7
16
  invalid_date: "is not a valid date"
8
17
  invalid_time: "is not a valid time"
9
18
  invalid_datetime: "is not a valid datetime"
@@ -4,9 +4,9 @@ ja:
4
4
  messages:
5
5
  invalid_charset: "に利用できない文字が入力されています。%{error_chars}"
6
6
  invalid_space_divider: "は%{space_type}で区切ってください。"
7
- too_long: は%{count}文字以内で入力してください。
8
- too_short: は%{count}文字以上で入力してください。
9
- wrong_length: は%{count}文字で入力してください。
7
+ too_long_in_bytes: は%{count}バイト以内で入力してください。
8
+ too_short_in_bytes: は%{count}バイト以上で入力してください。
9
+ wrong_length_in_bytes: は%{count}バイトで入力してください。
10
10
  invalid_date: "は正しい形式で入力してください。"
11
11
  invalid_time: "は正しい形式で入力してください。"
12
12
  invalid_datetime: "は正しい形式で入力してください。"
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Kirico
3
4
  class CSVGenerator
4
5
  def initialize(fd_management_record, company, data = [])
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'virtus'
3
4
  require 'active_model'
4
5
  require 'kirico/models/helper'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'virtus'
3
4
  require 'active_model'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'virtus'
3
4
  require 'active_model'
4
5
  require 'kirico/models/helper'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'virtus'
3
4
  require 'active_model'
4
5
 
@@ -18,14 +19,14 @@ module Kirico
18
19
  attribute :tel_number, String
19
20
 
20
21
  validates :area_code, charset: { accept: [:numeric] }, sjis_bytesize: { is: 2 }
21
- validates :office_code, charset: { accept: [:numeric, :latin, :katakana] }, sjis_bytesize: { in: 1..4 }
22
+ validates :office_code, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..4 }
22
23
  validates :office_number, charset: { accept: [:numeric] }, sjis_bytesize: { in: 1..5 }
23
24
  validates :zip_code1, charset: { accept: [:numeric] }, sjis_bytesize: { is: 3 }
24
25
  validates :zip_code2, charset: { accept: [:numeric] }, sjis_bytesize: { is: 4 }
25
26
  validates :address, charset: { accept: [:all] }, sjis_bytesize: { in: 1..75 }
26
- validates :name, charset: { accept: [:katakana, :kanji] }, sjis_bytesize: { in: 1..50 }
27
- validates :owner_name, charset: { accept: [:katakana, :kanji] }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :both_width }
28
- validates :tel_number, charset: { accept: [:latin, :numeric] }, sjis_bytesize: { in: 1..12 }
27
+ validates :name, charset: { accept: %i(katakana kanji) }, sjis_bytesize: { in: 1..50 }
28
+ validates :owner_name, charset: { accept: %i(katakana kanji) }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :both_width }
29
+ validates :tel_number, charset: { accept: %i(latin numeric) }, sjis_bytesize: { in: 1..12 }
29
30
 
30
31
  def initialize
31
32
  yield(self) if block_given?
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'kirico/models/base_company_count'
3
4
 
4
5
  module Kirico
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'virtus'
3
4
 
4
5
  module Kirico
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'virtus'
3
4
 
4
5
  module Kirico
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # 住所変更届データレコード
3
4
  module Kirico
4
5
  class DataRecord22187041 < ApplicationRecord
@@ -22,18 +23,18 @@ module Kirico
22
23
  attribute :memo, String
23
24
 
24
25
  validates :area_code, charset: { accept: [:numeric] }, sjis_bytesize: { is: 2 }
25
- validates :office_code, charset: { accept: [:numeric, :latin, :katakana] }, sjis_bytesize: { in: 1..4 }
26
+ validates :office_code, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..4 }
26
27
  validates :ip_code, charset: { accept: [:numeric] }, sjis_bytesize: { in: 1..6 }
27
28
  validates :basic_pension_number1, charset: { accept: [:numeric] }, sjis_bytesize: { is: 4 }, allow_blank: true
28
29
  validates :basic_pension_number2, charset: { accept: [:numeric] }, sjis_bytesize: { is: 6 }, allow_blank: true
29
30
  validates :zip_code1, charset: { accept: [:numeric] }, sjis_bytesize: { is: 3 }
30
31
  validates :zip_code2, charset: { accept: [:numeric] }, sjis_bytesize: { is: 4 }
31
- validates :new_address_yomi, charset: { accept: [:numeric, :latin, :katakana] }, sjis_bytesize: { in: 1..75 }
32
+ validates :new_address_yomi, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..75 }
32
33
  validates :new_address, charset: { accept: [:all] }, sjis_bytesize: { in: 0..74 }, allow_blank: true
33
34
  validates :updated_at, timeliness: { on_or_before: :today, type: :date }
34
35
  validates :ip_name_yomi, charset: { accept: [:katakana] }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :half_width }
35
36
  validates :ip_name, charset: { accept: [:all] }, sjis_bytesize: { in: 0..24 }, allow_blank: true, space_divider: { space: :full_width }
36
- validates :old_address_yomi, charset: { accept: [:numeric, :latin, :katakana] }, sjis_bytesize: { in: 1..75 }
37
+ validates :old_address_yomi, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..75 }
37
38
  validates :old_address, charset: { accept: [:all] }, sjis_bytesize: { in: 0..74 }, allow_blank: true
38
39
  validates :memo, charset: { accept: [:all] }, sjis_bytesize: { in: 0..75 }, allow_blank: true
39
40
 
@@ -1,9 +1,10 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # 算定基礎届データレコード
3
4
  module Kirico
4
5
  class DataRecord22257041 < ApplicationRecord
5
6
  DOC_CODE = '22257041'
6
- COVERED_MONTHS = [:apr, :may, :jun].freeze
7
+ COVERED_MONTHS = %i(apr may jun).freeze
7
8
 
8
9
  attribute :area_code, String
9
10
  attribute :office_code, String
@@ -36,12 +37,12 @@ module Kirico
36
37
  define_in_k_method :old_monthly_standard_income_hel_ins, :old_monthly_standard_income_pns_ins
37
38
 
38
39
  validates :area_code, charset: { accept: [:numeric] }, sjis_bytesize: { is: 2 }
39
- validates :office_code, charset: { accept: [:numeric, :latin, :katakana] }, sjis_bytesize: { in: 1..4 }
40
+ validates :office_code, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..4 }
40
41
  validates :ip_code, charset: { accept: [:numeric] }, sjis_bytesize: { in: 1..6 }
41
42
  validates :applied_at, timeliness: { on_or_after: -> { Date.new(1989, 1, 8) }, type: :date }
42
43
  validates :ip_name_yomi, charset: { accept: [:katakana] }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :half_width }
43
44
  validates :ip_name, charset: { accept: [:all] }, sjis_bytesize: { in: 0..24 }, allow_blank: true, space_divider: { space: :full_width }
44
- validates :gender_type, inclusion: { in: [:gender_type_1, :gender_type_2, :gender_type_3, :gender_type_5, :gender_type_6, :gender_type_7] }
45
+ validates :gender_type, inclusion: { in: %i(gender_type_1 gender_type_2 gender_type_3 gender_type_5 gender_type_6 gender_type_7) }
45
46
  validates :old_monthly_standard_income_hel_ins, numericality: { greater_than_or_equal_to: 1_000, less_than_or_equal_to: 9_999_999 }, allow_blank: true
46
47
  validates :old_monthly_standard_income_pns_ins, numericality: { greater_than_or_equal_to: 1_000, less_than_or_equal_to: 9_999_999 }, allow_blank: true
47
48
  validates :old_applied_at, timeliness: { on_or_after: -> { Date.new(1989, 1, 8) }, type: :date }
@@ -53,9 +54,9 @@ module Kirico
53
54
  validates "#{month}_income_goods", numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 9_999_999 }
54
55
  end
55
56
  validates :avg_adjustment, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 9_999_999 }, allow_blank: true
56
- validates :ip_type, inclusion: { in: [:ip_type_0, :ip_type_1, :ip_type_2] }
57
+ validates :ip_type, inclusion: { in: %i(ip_type_0 ip_type_1 ip_type_2) }
57
58
  validates :retroacted_payment, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 9_999_999 }, allow_blank: true
58
- validates :income_updated_type, inclusion: { in: [:income_updated_type_0, :income_updated_type_1] }, allow_blank: true
59
+ validates :income_updated_type, inclusion: { in: %i(income_updated_type_0 income_updated_type_1) }, allow_blank: true
59
60
  validates :income_diff_amount, numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 9_999_999 }, allow_blank: true
60
61
  validates :income_updated_at, timeliness: { on_or_after: -> { Date.new(1989, 1, 8) }, type: :date }, allow_blank: true
61
62
  validates :memo, charset: { accept: [:all] }, sjis_bytesize: { in: 0..75 }, allow_blank: true
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'kirico/models/base_fd_management_record'
3
4
 
4
5
  module Kirico
@@ -7,7 +8,7 @@ module Kirico
7
8
  attribute :office_code, String
8
9
 
9
10
  validates :area_code, charset: { accept: [:numeric] }, sjis_bytesize: { is: 2 }
10
- validates :office_code, charset: { accept: [:numeric, :latin, :katakana] }, sjis_bytesize: { in: 1..4 }
11
+ validates :office_code, charset: { accept: %i(numeric latin katakana) }, sjis_bytesize: { in: 1..4 }
11
12
 
12
13
  def to_csv
13
14
  [
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'virtus'
3
4
  require 'active_model'
4
5
 
@@ -40,7 +41,7 @@ module Kirico
40
41
 
41
42
  # 子のエラーを自身のエラーとして設定する
42
43
  def validate_children
43
- [:fd, :company, :company_count].each do |attribute|
44
+ %i(fd company company_count).each do |attribute|
44
45
  rec = send(attribute)
45
46
  next if rec.nil? || rec.valid?
46
47
  rec.errors.full_messages.each do |msg|
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'era_ja'
3
4
  require 'active_support/core_ext/object'
4
5
  require 'yaml'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'kirico/models/base_company_count'
3
4
 
4
5
  # 社会保険労務士: 事業所数情報
@@ -8,7 +9,7 @@ module Kirico
8
9
 
9
10
  attribute :name, String
10
11
 
11
- validates :name, charset: { accept: [:katakana, :kanji] }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :both_width }
12
+ validates :name, charset: { accept: %i(katakana kanji) }, sjis_bytesize: { in: 1..25 }, space_divider: { space: :both_width }
12
13
 
13
14
  def to_csv
14
15
  [name, COUNT].map { |attr| attr.to_s.encode('CP932') }.join(',')
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'kirico/models/base_fd_management_record'
3
4
 
4
5
  # 社会保険労務士: FD 管理レコード
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'active_model'
3
4
  require 'active_model/validator'
4
5
 
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'active_model'
3
4
  require 'active_model/validator'
4
5
 
@@ -11,10 +12,10 @@ require 'active_model/validator'
11
12
  # 参考: https://github.com/rails/rails/blob/fe1f4b2ad56f010a4e9b93d547d63a15953d9dc2/activemodel/lib/active_model/validations/length.rb
12
13
  module Kirico
13
14
  class SjisBytesizeValidator < ActiveModel::EachValidator
14
- MESSAGES = { is: :wrong_length, minimum: :too_short, maximum: :too_long }.freeze
15
+ MESSAGES = { is: :wrong_length_in_bytes, minimum: :too_short_in_bytes, maximum: :too_long_in_bytes }.freeze
15
16
  CHECKS = { is: :==, minimum: :>=, maximum: :<= }.freeze
16
17
 
17
- RESERVED_OPTIONS = [:minimum, :maximum, :within, :is, :too_short, :too_long]
18
+ RESERVED_OPTIONS = %i(minimum maximum within is too_short too_long)
18
19
 
19
20
  def initialize(options)
20
21
  range = (options.delete(:in) || options.delete(:within))
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'active_model'
3
4
  require 'active_model/validator'
4
5
  require 'active_model/validations/format'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Kirico
3
- VERSION = '1.0.4'
4
+ VERSION = '1.0.5'
4
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kirico
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - kakipo
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-07-03 00:00:00.000000000 Z
11
+ date: 2017-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport