kirico 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/kirico/validators/sjis_bytesize_validator.rb +2 -1
- data/lib/kirico/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 509096a9019dc94c96f63802979b7f7fc85261d2
|
4
|
+
data.tar.gz: edd24c57291b695f87321a9406ad721420801720
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc6f911e48dfffcec6398f095b7329679511140e029baf7b04530a887af919d0f0ef7c777f64e6b75bdf7660075c8b11424302b375cefc845cc98263f81cb46c
|
7
|
+
data.tar.gz: 2a021ec0c08e49f41c10356b7e7c6b63925c8703e8849b1832601b6b026a13d91b5e47bfd9ce8c83c3511e766c07b88acc396f17108a61b3e4f0d668ccddf199
|
@@ -3,6 +3,7 @@ require 'active_model'
|
|
3
3
|
require 'active_model/validator'
|
4
4
|
|
5
5
|
# SJIS 換算の文字長を検証する
|
6
|
+
# SJIS 変換不可文字が設定された場合は 1 文字としてカウントする
|
6
7
|
#
|
7
8
|
# 設定例:
|
8
9
|
# validate :address, sjis_bytesize: { in: 1..30 }
|
@@ -47,7 +48,7 @@ module Kirico
|
|
47
48
|
end
|
48
49
|
|
49
50
|
def validate_each(record, attribute, value = '')
|
50
|
-
value_length = value.to_s.encode('Shift_JIS').bytesize
|
51
|
+
value_length = value.to_s.encode('Shift_JIS', undef: :replace).bytesize
|
51
52
|
|
52
53
|
errors_options = options.except(*RESERVED_OPTIONS)
|
53
54
|
|
data/lib/kirico/version.rb
CHANGED
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: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- kakipo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|