sanitize_model_attributes 0.0.3 → 0.0.4
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/Rakefile +10 -0
- data/lib/sanitize_model_attributes.rb +0 -1
- data/lib/sanitize_model_attributes/version.rb +1 -1
- data/sanitize_model_attributes.gemspec +2 -1
- data/test/test_sanitize_model_attributes.rb +22 -0
- metadata +19 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc0574877c0a1ab3a3ac743d5263eda56a66748e
|
4
|
+
data.tar.gz: 3eab358067dfb1bf2cf175c4a496704f23b018ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80005ad476407d81722cfe1c6c895589ad1d6fba1724e6f9a70be06e9bb8e69f9b77ebba1f494bf6364967fea28265a13276d2ac06198b7985ab1d229e243ac0
|
7
|
+
data.tar.gz: ee4ac12d6fa577978def554d5781e14bea4857e7c39d819189278716e3584940d36f7702939eb838e2b924f0bc0d791494f6fbc0c12e60d14378592f79eb13b5
|
data/Rakefile
CHANGED
@@ -18,5 +18,6 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.
|
21
|
+
spec.add_dependency "sanitize", "~> 3"
|
22
|
+
spec.add_development_dependency 'minitest'
|
22
23
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
require 'minitest/autorun'
|
2
|
+
require 'sanitize_model_attributes'
|
3
|
+
|
4
|
+
class TestString < Minitest::Test
|
5
|
+
def test_to_respond
|
6
|
+
klass = Class.new
|
7
|
+
klass.include SanitizeModelAttributes
|
8
|
+
|
9
|
+
assert klass.respond_to? :sanitize_attributes
|
10
|
+
assert klass.respond_to? :sanitize_model_attributes
|
11
|
+
|
12
|
+
klass.class_eval do
|
13
|
+
sanitize_attributes :name
|
14
|
+
sanitize_model_attributes :model_name
|
15
|
+
end
|
16
|
+
|
17
|
+
instance = klass.new
|
18
|
+
|
19
|
+
assert instance.respond_to? :name=
|
20
|
+
assert instance.respond_to? :model_name=
|
21
|
+
end
|
22
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sanitize_model_attributes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi CHIBA
|
@@ -17,13 +17,27 @@ dependencies:
|
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3'
|
20
|
-
type: :
|
20
|
+
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: minitest
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
description: ''
|
28
42
|
email:
|
29
43
|
- mail@takashi.me
|
@@ -39,6 +53,7 @@ files:
|
|
39
53
|
- lib/sanitize_model_attributes.rb
|
40
54
|
- lib/sanitize_model_attributes/version.rb
|
41
55
|
- sanitize_model_attributes.gemspec
|
56
|
+
- test/test_sanitize_model_attributes.rb
|
42
57
|
homepage: https://github.com/tachiba/sanitize_model_attributes
|
43
58
|
licenses:
|
44
59
|
- MIT
|
@@ -63,4 +78,5 @@ rubygems_version: 2.4.3
|
|
63
78
|
signing_key:
|
64
79
|
specification_version: 4
|
65
80
|
summary: Sanitize ActiveRecord attributes.
|
66
|
-
test_files:
|
81
|
+
test_files:
|
82
|
+
- test/test_sanitize_model_attributes.rb
|