moca_rlibs 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.idea/rlibs.iml +5 -2
- data/Gemfile.lock +17 -19
- data/README.md +3 -0
- data/lib/moca_rlibs/active_model_validators/ip.rb +1 -1
- data/lib/moca_rlibs/active_model_validators/only_alpha.rb +1 -1
- data/lib/moca_rlibs/active_model_validators/only_alpha_numeric.rb +1 -1
- data/lib/moca_rlibs/active_model_validators/only_ascii.rb +1 -1
- data/lib/moca_rlibs/active_model_validators/only_numbers.rb +1 -1
- data/lib/moca_rlibs/active_model_validators/only_printable.rb +1 -1
- data/lib/moca_rlibs/grape_validators/email.rb +1 -1
- data/lib/moca_rlibs/grape_validators/email_rfc.rb +1 -1
- data/lib/moca_rlibs/grape_validators/email_strict.rb +1 -1
- data/lib/moca_rlibs/grape_validators/ends_with.rb +1 -1
- data/lib/moca_rlibs/grape_validators/ip_address.rb +1 -1
- data/lib/moca_rlibs/grape_validators/length.rb +1 -1
- data/lib/moca_rlibs/grape_validators/max.rb +1 -1
- data/lib/moca_rlibs/grape_validators/min.rb +1 -1
- data/lib/moca_rlibs/grape_validators/only_alpha.rb +1 -1
- data/lib/moca_rlibs/grape_validators/only_alpha_numeric.rb +1 -1
- data/lib/moca_rlibs/grape_validators/only_ascii.rb +1 -1
- data/lib/moca_rlibs/grape_validators/only_numbers.rb +1 -1
- data/lib/moca_rlibs/grape_validators/only_printable.rb +1 -1
- data/lib/moca_rlibs/grape_validators/starts_with.rb +1 -1
- data/lib/moca_rlibs/grape_validators/url.rb +1 -1
- data/lib/moca_rlibs/version.rb +1 -1
- metadata +2 -3
- data/CHANGELOG.md +0 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c202c01ae7a990ee27e861b804435a952a46beb50bc981b427394079b0c8703
|
4
|
+
data.tar.gz: 0befa50c7ce356cc7b0fc9d43e57c65363914f6055581a22dfada5aa42aafa2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5232468e7c008b386bdb162fbe4396c351d86e71a89d9c98893500fc6bc5d788a7e9da3d8b9583738256b0777a0d2cdabb68c9b34480f2a586ac488b5485d358
|
7
|
+
data.tar.gz: 51871849c50b6097825e3a3365eba897407ca395e8130e15f9cc1d2d889a30f60f60552241a1336ee21001852151ea420eb0c0523004c25e9c1f0a052636581b
|
data/.idea/rlibs.iml
CHANGED
@@ -17,6 +17,7 @@
|
|
17
17
|
<orderEntry type="library" scope="PROVIDED" name="ast (v2.4.2, rbenv: 3.0.2) [gem]" level="application" />
|
18
18
|
<orderEntry type="library" scope="PROVIDED" name="builder (v3.2.4, rbenv: 3.0.2) [gem]" level="application" />
|
19
19
|
<orderEntry type="library" scope="PROVIDED" name="bundler (v2.2.22, rbenv: 3.0.2) [gem]" level="application" />
|
20
|
+
<orderEntry type="library" scope="PROVIDED" name="codecov (v0.6.0, rbenv: 3.0.2) [gem]" level="application" />
|
20
21
|
<orderEntry type="library" scope="PROVIDED" name="concurrent-ruby (v1.1.9, rbenv: 3.0.2) [gem]" level="application" />
|
21
22
|
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.4.4, rbenv: 3.0.2) [gem]" level="application" />
|
22
23
|
<orderEntry type="library" scope="PROVIDED" name="docile (v1.4.0, rbenv: 3.0.2) [gem]" level="application" />
|
@@ -39,14 +40,15 @@
|
|
39
40
|
<orderEntry type="library" scope="PROVIDED" name="rack-test (v1.1.0, rbenv: 3.0.2) [gem]" level="application" />
|
40
41
|
<orderEntry type="library" scope="PROVIDED" name="rainbow (v3.0.0, rbenv: 3.0.2) [gem]" level="application" />
|
41
42
|
<orderEntry type="library" scope="PROVIDED" name="rake (v13.0.6, rbenv: 3.0.2) [gem]" level="application" />
|
42
|
-
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.
|
43
|
+
<orderEntry type="library" scope="PROVIDED" name="regexp_parser (v2.2.0, rbenv: 3.0.2) [gem]" level="application" />
|
43
44
|
<orderEntry type="library" scope="PROVIDED" name="rexml (v3.2.5, rbenv: 3.0.2) [gem]" level="application" />
|
45
|
+
<orderEntry type="library" scope="PROVIDED" name="rspec (v3.10.0, rbenv: 3.0.2) [gem]" level="application" />
|
44
46
|
<orderEntry type="library" scope="PROVIDED" name="rspec-core (v3.10.1, rbenv: 3.0.2) [gem]" level="application" />
|
45
47
|
<orderEntry type="library" scope="PROVIDED" name="rspec-expectations (v3.10.1, rbenv: 3.0.2) [gem]" level="application" />
|
46
48
|
<orderEntry type="library" scope="PROVIDED" name="rspec-mocks (v3.10.2, rbenv: 3.0.2) [gem]" level="application" />
|
47
49
|
<orderEntry type="library" scope="PROVIDED" name="rspec-support (v3.10.3, rbenv: 3.0.2) [gem]" level="application" />
|
48
50
|
<orderEntry type="library" scope="PROVIDED" name="rubocop (v1.23.0, rbenv: 3.0.2) [gem]" level="application" />
|
49
|
-
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.
|
51
|
+
<orderEntry type="library" scope="PROVIDED" name="rubocop-ast (v1.14.0, rbenv: 3.0.2) [gem]" level="application" />
|
50
52
|
<orderEntry type="library" scope="PROVIDED" name="rubocop-performance (v1.12.0, rbenv: 3.0.2) [gem]" level="application" />
|
51
53
|
<orderEntry type="library" scope="PROVIDED" name="rubocop-rails (v2.12.4, rbenv: 3.0.2) [gem]" level="application" />
|
52
54
|
<orderEntry type="library" scope="PROVIDED" name="rubocop-rspec (v2.6.0, rbenv: 3.0.2) [gem]" level="application" />
|
@@ -56,6 +58,7 @@
|
|
56
58
|
<orderEntry type="library" scope="PROVIDED" name="simplecov-html (v0.12.3, rbenv: 3.0.2) [gem]" level="application" />
|
57
59
|
<orderEntry type="library" scope="PROVIDED" name="simplecov_json_formatter (v0.1.3, rbenv: 3.0.2) [gem]" level="application" />
|
58
60
|
<orderEntry type="library" scope="PROVIDED" name="slack-notifier (v2.4.0, rbenv: 3.0.2) [gem]" level="application" />
|
61
|
+
<orderEntry type="library" scope="PROVIDED" name="sqlite3 (v1.4.2, rbenv: 3.0.2) [gem]" level="application" />
|
59
62
|
<orderEntry type="library" scope="PROVIDED" name="tzinfo (v2.0.4, rbenv: 3.0.2) [gem]" level="application" />
|
60
63
|
<orderEntry type="library" scope="PROVIDED" name="unicode-display_width (v2.1.0, rbenv: 3.0.2) [gem]" level="application" />
|
61
64
|
<orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.5.1, rbenv: 3.0.2) [gem]" level="application" />
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
moca_rlibs (0.0.
|
4
|
+
moca_rlibs (0.0.9)
|
5
5
|
activemodel
|
6
6
|
activerecord
|
7
7
|
activesupport
|
@@ -12,23 +12,22 @@ PATH
|
|
12
12
|
GEM
|
13
13
|
remote: https://rubygems.org/
|
14
14
|
specs:
|
15
|
-
activemodel (
|
16
|
-
activesupport (=
|
17
|
-
activerecord (
|
18
|
-
activemodel (=
|
19
|
-
activesupport (=
|
20
|
-
activesupport (
|
15
|
+
activemodel (7.0.0)
|
16
|
+
activesupport (= 7.0.0)
|
17
|
+
activerecord (7.0.0)
|
18
|
+
activemodel (= 7.0.0)
|
19
|
+
activesupport (= 7.0.0)
|
20
|
+
activesupport (7.0.0)
|
21
21
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
22
22
|
i18n (>= 1.6, < 2)
|
23
23
|
minitest (>= 5.1)
|
24
24
|
tzinfo (~> 2.0)
|
25
|
-
zeitwerk (~> 2.3)
|
26
25
|
ast (2.4.2)
|
27
26
|
builder (3.2.4)
|
28
27
|
codecov (0.6.0)
|
29
28
|
simplecov (>= 0.15, < 0.22)
|
30
29
|
concurrent-ruby (1.1.9)
|
31
|
-
diff-lcs (1.
|
30
|
+
diff-lcs (1.5.0)
|
32
31
|
docile (1.4.0)
|
33
32
|
dry-configurable (0.13.0)
|
34
33
|
concurrent-ruby (~> 1.0)
|
@@ -50,7 +49,7 @@ GEM
|
|
50
49
|
dry-logic (~> 1.0, >= 1.0.2)
|
51
50
|
email_validator (2.2.3)
|
52
51
|
activemodel
|
53
|
-
grape (1.6.
|
52
|
+
grape (1.6.2)
|
54
53
|
activesupport
|
55
54
|
builder
|
56
55
|
dry-types (>= 1.1)
|
@@ -59,13 +58,13 @@ GEM
|
|
59
58
|
rack-accept
|
60
59
|
i18n (1.8.11)
|
61
60
|
concurrent-ruby (~> 1.0)
|
62
|
-
minitest (5.
|
61
|
+
minitest (5.15.0)
|
63
62
|
mustermann (1.1.1)
|
64
63
|
ruby2_keywords (~> 0.0.1)
|
65
64
|
mustermann-grape (1.0.1)
|
66
65
|
mustermann (>= 1.0.0)
|
67
66
|
parallel (1.21.0)
|
68
|
-
parser (3.0.3.
|
67
|
+
parser (3.0.3.2)
|
69
68
|
ast (~> 2.4.1)
|
70
69
|
rack (2.2.3)
|
71
70
|
rack-accept (0.4.5)
|
@@ -89,25 +88,25 @@ GEM
|
|
89
88
|
diff-lcs (>= 1.2.0, < 2.0)
|
90
89
|
rspec-support (~> 3.10.0)
|
91
90
|
rspec-support (3.10.3)
|
92
|
-
rubocop (1.
|
91
|
+
rubocop (1.24.0)
|
93
92
|
parallel (~> 1.10)
|
94
93
|
parser (>= 3.0.0.0)
|
95
94
|
rainbow (>= 2.2.2, < 4.0)
|
96
95
|
regexp_parser (>= 1.8, < 3.0)
|
97
96
|
rexml
|
98
|
-
rubocop-ast (>= 1.
|
97
|
+
rubocop-ast (>= 1.15.0, < 2.0)
|
99
98
|
ruby-progressbar (~> 1.7)
|
100
99
|
unicode-display_width (>= 1.4.0, < 3.0)
|
101
|
-
rubocop-ast (1.
|
100
|
+
rubocop-ast (1.15.1)
|
102
101
|
parser (>= 3.0.1.1)
|
103
|
-
rubocop-performance (1.
|
102
|
+
rubocop-performance (1.13.0)
|
104
103
|
rubocop (>= 1.7.0, < 2.0)
|
105
104
|
rubocop-ast (>= 0.4.0)
|
106
|
-
rubocop-rails (2.
|
105
|
+
rubocop-rails (2.13.0)
|
107
106
|
activesupport (>= 4.2.0)
|
108
107
|
rack (>= 1.1)
|
109
108
|
rubocop (>= 1.7.0, < 2.0)
|
110
|
-
rubocop-rspec (2.
|
109
|
+
rubocop-rspec (2.7.0)
|
111
110
|
rubocop (~> 1.19)
|
112
111
|
ruby-progressbar (1.11.0)
|
113
112
|
ruby2_keywords (0.0.5)
|
@@ -122,7 +121,6 @@ GEM
|
|
122
121
|
tzinfo (2.0.4)
|
123
122
|
concurrent-ruby (~> 1.0)
|
124
123
|
unicode-display_width (2.1.0)
|
125
|
-
zeitwerk (2.5.1)
|
126
124
|
|
127
125
|
PLATFORMS
|
128
126
|
arm64-darwin-21
|
data/README.md
CHANGED
@@ -3,6 +3,9 @@
|
|
3
3
|
[![Build Status](https://codebuild.ap-northeast-1.amazonaws.com/badges?uuid=eyJlbmNyeXB0ZWREYXRhIjoiekhCRy9vSkZhL3BSR1hCV0NvSkc3b3NMcm5MQnlnakkwVFZhWFI1bzZpTzZONmxMeFVLcjNKODhlQWo5ZGtFYmpLcjNQZVFqdzNVZTRBbFFJZ3h1NTNvPSIsIml2UGFyYW1ldGVyU3BlYyI6ImU4dXdib0NpOE1IbHJiYVQiLCJtYXRlcmlhbFNldFNlcmlhbCI6MX0%3D&branch=master)](https://ap-northeast-1.console.aws.amazon.com/codesuite/codebuild/085041388644/projects/rlibs)
|
4
4
|
[![codecov](https://codecov.io/gh/mocaberos/rlibs/branch/master/graph/badge.svg?token=L6SB5CH8KN)](https://codecov.io/gh/mocaberos/rlibs)
|
5
5
|
|
6
|
+
# 注意
|
7
|
+
grape 1.6.1以降のバージョンのみ使用可能
|
8
|
+
|
6
9
|
## インストール
|
7
10
|
```ruby
|
8
11
|
gem 'moca_rlibs'
|
@@ -6,7 +6,7 @@ require 'active_support/all'
|
|
6
6
|
module ActiveModel::Validations
|
7
7
|
# 文字列が半角アルファベットのみであることをチェックする
|
8
8
|
class OnlyAlphaValidator < ActiveModel::EachValidator
|
9
|
-
def validate_each(record,
|
9
|
+
def validate_each(record, _attribute, value)
|
10
10
|
return if value.blank?
|
11
11
|
|
12
12
|
value = value.presence.to_s
|
@@ -6,7 +6,7 @@ require 'active_support/all'
|
|
6
6
|
module ActiveModel::Validations
|
7
7
|
# 文字列が半角英数字のみであることをチェックする
|
8
8
|
class OnlyAlphaNumericValidator < ActiveModel::EachValidator
|
9
|
-
def validate_each(record,
|
9
|
+
def validate_each(record, _attribute, value)
|
10
10
|
return if value.blank?
|
11
11
|
|
12
12
|
value = value.presence.to_s
|
@@ -6,7 +6,7 @@ require 'active_support/all'
|
|
6
6
|
module ActiveModel::Validations
|
7
7
|
# アスキー文字のみを許可する
|
8
8
|
class OnlyAsciiValidator < ActiveModel::EachValidator
|
9
|
-
def validate_each(record,
|
9
|
+
def validate_each(record, _attribute, value)
|
10
10
|
return if value.blank?
|
11
11
|
|
12
12
|
value = value.presence.to_s
|
@@ -6,7 +6,7 @@ require 'active_support/all'
|
|
6
6
|
module ActiveModel::Validations
|
7
7
|
# 文字列が数字のみであることをチェックする
|
8
8
|
class OnlyNumbersValidator < ActiveModel::EachValidator
|
9
|
-
def validate_each(record,
|
9
|
+
def validate_each(record, _attribute, value)
|
10
10
|
return if value.blank?
|
11
11
|
|
12
12
|
value = value.presence.to_s
|
@@ -6,7 +6,7 @@ require 'active_support/all'
|
|
6
6
|
module ActiveModel::Validations
|
7
7
|
# 出力可能なアスキー文字のみかどうかをチェックする(半角英数字+一部の記号)
|
8
8
|
class OnlyPrintableValidator < ActiveModel::EachValidator
|
9
|
-
def validate_each(record,
|
9
|
+
def validate_each(record, _attribute, value)
|
10
10
|
return if value.blank?
|
11
11
|
|
12
12
|
value = value.presence.to_s
|
@@ -5,7 +5,7 @@ require 'grape'
|
|
5
5
|
|
6
6
|
module MocaRlibs::GrapeValidators
|
7
7
|
# メールアドレスのフォーマットチェック(簡易的なチェック)
|
8
|
-
class Email < Grape::Validations::Base
|
8
|
+
class Email < Grape::Validations::Validators::Base
|
9
9
|
def validate_param!(attr_name, params)
|
10
10
|
return if !@required && params[attr_name].blank?
|
11
11
|
|
@@ -7,7 +7,7 @@ require 'email_validator'
|
|
7
7
|
|
8
8
|
module MocaRlibs::GrapeValidators
|
9
9
|
# メールアドレスのフォーマットチェック(RFC-2822, RFC-5321)
|
10
|
-
class EmailRFC < Grape::Validations::Base
|
10
|
+
class EmailRFC < Grape::Validations::Validators::Base
|
11
11
|
def validate_param!(attr_name, params)
|
12
12
|
return if !@required && params[attr_name].blank?
|
13
13
|
|
@@ -7,7 +7,7 @@ require 'email_validator'
|
|
7
7
|
|
8
8
|
module MocaRlibs::GrapeValidators
|
9
9
|
# メールアドレスのフォーマットチェック(厳密チェック)
|
10
|
-
class EmailStrict < Grape::Validations::Base
|
10
|
+
class EmailStrict < Grape::Validations::Validators::Base
|
11
11
|
def validate_param!(attr_name, params)
|
12
12
|
return if !@required && params[attr_name].blank?
|
13
13
|
|
@@ -7,7 +7,7 @@ require 'grape'
|
|
7
7
|
|
8
8
|
module MocaRlibs::GrapeValidators
|
9
9
|
# 文字列の末尾をチェック
|
10
|
-
class EndsWith < Grape::Validations::Base
|
10
|
+
class EndsWith < Grape::Validations::Validators::Base
|
11
11
|
def validate_param!(attr_name, params)
|
12
12
|
return if !@required && params[attr_name].blank?
|
13
13
|
|
@@ -6,7 +6,7 @@ require 'resolv'
|
|
6
6
|
|
7
7
|
module MocaRlibs::GrapeValidators
|
8
8
|
# 数値の最小値をチェック
|
9
|
-
class IpAddress < Grape::Validations::Base
|
9
|
+
class IpAddress < Grape::Validations::Validators::Base
|
10
10
|
def validate_param!(attr_name, params)
|
11
11
|
return if !@required && params[attr_name].blank?
|
12
12
|
|
@@ -5,7 +5,7 @@ require 'grape'
|
|
5
5
|
|
6
6
|
module MocaRlibs::GrapeValidators
|
7
7
|
# 文字列が半角アルファベットのみであることをチェックする
|
8
|
-
class OnlyAlpha < Grape::Validations::Base
|
8
|
+
class OnlyAlpha < Grape::Validations::Validators::Base
|
9
9
|
def validate_param!(attr_name, params)
|
10
10
|
return if !@required && params[attr_name].blank?
|
11
11
|
|
@@ -5,7 +5,7 @@ require 'grape'
|
|
5
5
|
|
6
6
|
module MocaRlibs::GrapeValidators
|
7
7
|
# 文字列が半角英数字のみであることをチェックする
|
8
|
-
class OnlyAlphaNumeric < Grape::Validations::Base
|
8
|
+
class OnlyAlphaNumeric < Grape::Validations::Validators::Base
|
9
9
|
def validate_param!(attr_name, params)
|
10
10
|
return if !@required && params[attr_name].blank?
|
11
11
|
|
@@ -5,7 +5,7 @@ require 'grape'
|
|
5
5
|
|
6
6
|
module MocaRlibs::GrapeValidators
|
7
7
|
# アスキー文字のみを許可する
|
8
|
-
class OnlyASCII < Grape::Validations::Base
|
8
|
+
class OnlyASCII < Grape::Validations::Validators::Base
|
9
9
|
def validate_param!(attr_name, params)
|
10
10
|
return if !@required && params[attr_name].blank?
|
11
11
|
|
@@ -5,7 +5,7 @@ require 'grape'
|
|
5
5
|
|
6
6
|
module MocaRlibs::GrapeValidators
|
7
7
|
# 文字列が数字のみであることをチェックする
|
8
|
-
class OnlyNumbers < Grape::Validations::Base
|
8
|
+
class OnlyNumbers < Grape::Validations::Validators::Base
|
9
9
|
def validate_param!(attr_name, params)
|
10
10
|
return if !@required && params[attr_name].blank?
|
11
11
|
|
@@ -5,7 +5,7 @@ require 'grape'
|
|
5
5
|
|
6
6
|
module MocaRlibs::GrapeValidators
|
7
7
|
# 出力可能なアスキー文字のみかどうかをチェックする(半角英数字+一部の記号)
|
8
|
-
class OnlyPrintable < Grape::Validations::Base
|
8
|
+
class OnlyPrintable < Grape::Validations::Validators::Base
|
9
9
|
def validate_param!(attr_name, params)
|
10
10
|
return if !@required && params[attr_name].blank?
|
11
11
|
|
@@ -7,7 +7,7 @@ require 'grape'
|
|
7
7
|
|
8
8
|
module MocaRlibs::GrapeValidators
|
9
9
|
# 文字列の先頭をチェック
|
10
|
-
class StartsWith < Grape::Validations::Base
|
10
|
+
class StartsWith < Grape::Validations::Validators::Base
|
11
11
|
def validate_param!(attr_name, params)
|
12
12
|
return if !@required && params[attr_name].blank?
|
13
13
|
|
@@ -5,7 +5,7 @@ require 'grape'
|
|
5
5
|
|
6
6
|
module MocaRlibs::GrapeValidators
|
7
7
|
# URLとして正しいフォーマットかどうかをチェックする
|
8
|
-
class URL < Grape::Validations::Base
|
8
|
+
class URL < Grape::Validations::Validators::Base
|
9
9
|
def validate_param!(attr_name, params)
|
10
10
|
return if !@required && params[attr_name].blank?
|
11
11
|
|
data/lib/moca_rlibs/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: moca_rlibs
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- mocaberos
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -264,7 +264,6 @@ files:
|
|
264
264
|
- ".idea/vcs.xml"
|
265
265
|
- ".rspec"
|
266
266
|
- ".rubocop.yml"
|
267
|
-
- CHANGELOG.md
|
268
267
|
- CODE_OF_CONDUCT.md
|
269
268
|
- Dockerfile
|
270
269
|
- Gemfile
|