activestorage-validator 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +48 -48
- data/README.md +3 -2
- data/activestorage-validator.gemspec +1 -1
- data/config/locales/en.yml +7 -0
- data/config/locales/ja.yml +7 -0
- data/lib/activestorage/validator.rb +2 -0
- data/lib/activestorage/validator/version.rb +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77d1ae10da54133ba2ab8776eb4c2f0ac671b025a9de6d790d27600a966f79cf
|
4
|
+
data.tar.gz: 159dc5d99a34bdea7fc2a1790be65466d1c06a7004cd31ff59f01a86724cb8b9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 287d4bf2a5f22ad26cd23276e6299ce209b50157b626bda4105112004e4592d09bfb82c384e451cea9a2e3c674d31b37c23bc0b77f7f72f3b668e518d9bf28c9
|
7
|
+
data.tar.gz: d154f704dc0c112a1da4f1506ff6b63fbb1ed17c1d449074b6eeedf1522e2525efa18d30ca570429994fe5a4c9ae4138e703b5442296707ca9b1e5b064d37233
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,102 +1,102 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
activestorage-validator (0.1.
|
4
|
+
activestorage-validator (0.1.1)
|
5
5
|
rails (~> 5.2.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: https://rubygems.org/
|
9
9
|
specs:
|
10
|
-
actioncable (5.2.
|
11
|
-
actionpack (= 5.2.
|
10
|
+
actioncable (5.2.2)
|
11
|
+
actionpack (= 5.2.2)
|
12
12
|
nio4r (~> 2.0)
|
13
13
|
websocket-driver (>= 0.6.1)
|
14
|
-
actionmailer (5.2.
|
15
|
-
actionpack (= 5.2.
|
16
|
-
actionview (= 5.2.
|
17
|
-
activejob (= 5.2.
|
14
|
+
actionmailer (5.2.2)
|
15
|
+
actionpack (= 5.2.2)
|
16
|
+
actionview (= 5.2.2)
|
17
|
+
activejob (= 5.2.2)
|
18
18
|
mail (~> 2.5, >= 2.5.4)
|
19
19
|
rails-dom-testing (~> 2.0)
|
20
|
-
actionpack (5.2.
|
21
|
-
actionview (= 5.2.
|
22
|
-
activesupport (= 5.2.
|
20
|
+
actionpack (5.2.2)
|
21
|
+
actionview (= 5.2.2)
|
22
|
+
activesupport (= 5.2.2)
|
23
23
|
rack (~> 2.0)
|
24
24
|
rack-test (>= 0.6.3)
|
25
25
|
rails-dom-testing (~> 2.0)
|
26
26
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
27
|
-
actionview (5.2.
|
28
|
-
activesupport (= 5.2.
|
27
|
+
actionview (5.2.2)
|
28
|
+
activesupport (= 5.2.2)
|
29
29
|
builder (~> 3.1)
|
30
30
|
erubi (~> 1.4)
|
31
31
|
rails-dom-testing (~> 2.0)
|
32
32
|
rails-html-sanitizer (~> 1.0, >= 1.0.3)
|
33
|
-
activejob (5.2.
|
34
|
-
activesupport (= 5.2.
|
33
|
+
activejob (5.2.2)
|
34
|
+
activesupport (= 5.2.2)
|
35
35
|
globalid (>= 0.3.6)
|
36
|
-
activemodel (5.2.
|
37
|
-
activesupport (= 5.2.
|
38
|
-
activerecord (5.2.
|
39
|
-
activemodel (= 5.2.
|
40
|
-
activesupport (= 5.2.
|
36
|
+
activemodel (5.2.2)
|
37
|
+
activesupport (= 5.2.2)
|
38
|
+
activerecord (5.2.2)
|
39
|
+
activemodel (= 5.2.2)
|
40
|
+
activesupport (= 5.2.2)
|
41
41
|
arel (>= 9.0)
|
42
|
-
activestorage (5.2.
|
43
|
-
actionpack (= 5.2.
|
44
|
-
activerecord (= 5.2.
|
42
|
+
activestorage (5.2.2)
|
43
|
+
actionpack (= 5.2.2)
|
44
|
+
activerecord (= 5.2.2)
|
45
45
|
marcel (~> 0.3.1)
|
46
|
-
activesupport (5.2.
|
46
|
+
activesupport (5.2.2)
|
47
47
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
48
48
|
i18n (>= 0.7, < 2)
|
49
49
|
minitest (~> 5.1)
|
50
50
|
tzinfo (~> 1.1)
|
51
51
|
arel (9.0.0)
|
52
52
|
builder (3.2.3)
|
53
|
-
concurrent-ruby (1.
|
53
|
+
concurrent-ruby (1.1.4)
|
54
54
|
crass (1.0.4)
|
55
55
|
diff-lcs (1.3)
|
56
56
|
erubi (1.7.1)
|
57
57
|
globalid (0.4.1)
|
58
58
|
activesupport (>= 4.2.0)
|
59
|
-
i18n (1.
|
59
|
+
i18n (1.2.0)
|
60
60
|
concurrent-ruby (~> 1.0)
|
61
|
-
loofah (2.2.
|
61
|
+
loofah (2.2.3)
|
62
62
|
crass (~> 1.0.2)
|
63
63
|
nokogiri (>= 1.5.9)
|
64
|
-
mail (2.7.
|
64
|
+
mail (2.7.1)
|
65
65
|
mini_mime (>= 0.1.1)
|
66
66
|
marcel (0.3.3)
|
67
67
|
mimemagic (~> 0.3.2)
|
68
|
-
method_source (0.9.
|
68
|
+
method_source (0.9.2)
|
69
69
|
mimemagic (0.3.2)
|
70
70
|
mini_mime (1.0.1)
|
71
|
-
mini_portile2 (2.
|
71
|
+
mini_portile2 (2.4.0)
|
72
72
|
minitest (5.11.3)
|
73
73
|
nio4r (2.3.1)
|
74
|
-
nokogiri (1.
|
75
|
-
mini_portile2 (~> 2.
|
76
|
-
rack (2.0.
|
74
|
+
nokogiri (1.9.0)
|
75
|
+
mini_portile2 (~> 2.4.0)
|
76
|
+
rack (2.0.6)
|
77
77
|
rack-test (1.1.0)
|
78
78
|
rack (>= 1.0, < 3)
|
79
|
-
rails (5.2.
|
80
|
-
actioncable (= 5.2.
|
81
|
-
actionmailer (= 5.2.
|
82
|
-
actionpack (= 5.2.
|
83
|
-
actionview (= 5.2.
|
84
|
-
activejob (= 5.2.
|
85
|
-
activemodel (= 5.2.
|
86
|
-
activerecord (= 5.2.
|
87
|
-
activestorage (= 5.2.
|
88
|
-
activesupport (= 5.2.
|
79
|
+
rails (5.2.2)
|
80
|
+
actioncable (= 5.2.2)
|
81
|
+
actionmailer (= 5.2.2)
|
82
|
+
actionpack (= 5.2.2)
|
83
|
+
actionview (= 5.2.2)
|
84
|
+
activejob (= 5.2.2)
|
85
|
+
activemodel (= 5.2.2)
|
86
|
+
activerecord (= 5.2.2)
|
87
|
+
activestorage (= 5.2.2)
|
88
|
+
activesupport (= 5.2.2)
|
89
89
|
bundler (>= 1.3.0)
|
90
|
-
railties (= 5.2.
|
90
|
+
railties (= 5.2.2)
|
91
91
|
sprockets-rails (>= 2.0.0)
|
92
92
|
rails-dom-testing (2.0.3)
|
93
93
|
activesupport (>= 4.2.0)
|
94
94
|
nokogiri (>= 1.6)
|
95
95
|
rails-html-sanitizer (1.0.4)
|
96
96
|
loofah (~> 2.2, >= 2.2.2)
|
97
|
-
railties (5.2.
|
98
|
-
actionpack (= 5.2.
|
99
|
-
activesupport (= 5.2.
|
97
|
+
railties (5.2.2)
|
98
|
+
actionpack (= 5.2.2)
|
99
|
+
activesupport (= 5.2.2)
|
100
100
|
method_source
|
101
101
|
rake (>= 0.8.7)
|
102
102
|
thor (>= 0.19.0, < 2.0)
|
@@ -122,7 +122,7 @@ GEM
|
|
122
122
|
activesupport (>= 4.0)
|
123
123
|
sprockets (>= 3.0.0)
|
124
124
|
sqlite3 (1.3.13)
|
125
|
-
thor (0.20.
|
125
|
+
thor (0.20.3)
|
126
126
|
thread_safe (0.3.6)
|
127
127
|
tzinfo (1.2.5)
|
128
128
|
thread_safe (~> 0.1)
|
@@ -141,4 +141,4 @@ DEPENDENCIES
|
|
141
141
|
sqlite3
|
142
142
|
|
143
143
|
BUNDLED WITH
|
144
|
-
1.
|
144
|
+
1.17.1
|
data/README.md
CHANGED
@@ -25,8 +25,9 @@ class User < ApplicationRecord
|
|
25
25
|
has_one_attached :avatar
|
26
26
|
has_many_attached :photos
|
27
27
|
|
28
|
-
validates :avatar,
|
29
|
-
validates :photos,
|
28
|
+
validates :avatar, presence: true, blob: { content_type: :image } # supported options: :image, :audio, :video, :text
|
29
|
+
validates :photos, presence: true, blob: { content_type: ['image/png', 'image/jpg', 'image/jpeg'], size_range: 1..5.megabytes }
|
30
|
+
# validates :photos, presence: true, blob: { content_type: %r{^image/}, size_range: 1..5.megabytes }
|
30
31
|
end
|
31
32
|
```
|
32
33
|
|
@@ -5,7 +5,7 @@ require "activestorage/validator/version"
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "activestorage-validator"
|
8
|
-
spec.version =
|
8
|
+
spec.version = ActiveStorage::Validator::VERSION
|
9
9
|
spec.authors = ["aki"]
|
10
10
|
spec.email = ["aki77@users.noreply.github.com"]
|
11
11
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activestorage-validator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- aki
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -86,6 +86,8 @@ files:
|
|
86
86
|
- activestorage-validator.gemspec
|
87
87
|
- bin/console
|
88
88
|
- bin/setup
|
89
|
+
- config/locales/en.yml
|
90
|
+
- config/locales/ja.yml
|
89
91
|
- lib/activestorage/validator.rb
|
90
92
|
- lib/activestorage/validator/blob.rb
|
91
93
|
- lib/activestorage/validator/version.rb
|