attributes_sanitizer 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7293d638b6f0162ea95543f432fcae6150687b1a87aad503f3f57950c278b92e
4
- data.tar.gz: 7c8046d3f6435c229607b336031164f63761c8b58ac7eaafa99f45bcabf3d18e
3
+ metadata.gz: 12b4709383dbae4f0d6a6f345719ecffa47fe27e750d39cf00b14e788cf35536
4
+ data.tar.gz: 56fdfa609e76e3870cda762b237e234d9bbafc1904875114970a56f41de0325d
5
5
  SHA512:
6
- metadata.gz: 81920cb935016e60767ae442105fe540451d700ba3567dd6c611d81b7ab319860ff89ca4f08dd7275bcf65985f164e162220d10214ca2d894205c41daff33779
7
- data.tar.gz: 051514ccb49100577fcd88ea6bd53d83f1581e2c5c63fc99da1195d8afe8007f080d86915fc519c66b17365b28ac895fb3b35c84a287337164ba9a592ebddd04
6
+ metadata.gz: a05d6ea506b2c4d77f5d9022ebde30514d5e1de50d6ac94a974ea378efc77c52a2a08463e665b5981f6df727d5b6d179e74d42ceda14c0c07a9ba583490efbf5
7
+ data.tar.gz: 9ae866687f015fae0041fd60aee83ee96834b7033ab10c75d55366afe6a72172df9687cce35336bf9629744d3e280f91a5121110a4df6bf5c543b43d2a56bf57
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Maintainability](https://api.codeclimate.com/v1/badges/29a55c3bd2dd9e5ed117/maintainability)](https://codeclimate.com/github/andersondias/attributes_sanitizer/maintainability)
1
+ [![Maintainability](https://api.codeclimate.com/v1/badges/29a55c3bd2dd9e5ed117/maintainability)](https://codeclimate.com/github/andersondias/attributes_sanitizer/maintainability) [![Test Coverage](https://api.codeclimate.com/v1/badges/29a55c3bd2dd9e5ed117/test_coverage)](https://codeclimate.com/github/andersondias/attributes_sanitizer/test_coverage)
2
2
 
3
3
  # AttributesSanitizer
4
4
 
@@ -20,6 +20,7 @@ end
20
20
  ```
21
21
 
22
22
  It comes with pre-defined sanitizers:
23
+ - `:stringify` which perform a `to_s` into the value, to be sanitized as a string. Can be used before other sanitizer, that depends to the value be a string
23
24
  - `:downcase` which downcases a given attribute string
24
25
  - `:upcase` which upcases a given attribute string
25
26
  - `:strip_tags` which removes any tags from the given string based on Rails sanitize helper.
@@ -3,6 +3,10 @@ module AttributesSanitizer
3
3
  extend ActiveSupport::Concern
4
4
 
5
5
  included do
6
+ AttributesSanitizer.define_sanitizer :stringify do |value|
7
+ value.to_s
8
+ end
9
+
6
10
  AttributesSanitizer.define_sanitizer :downcase do |value|
7
11
  value.downcase
8
12
  end
@@ -25,4 +29,3 @@ module AttributesSanitizer
25
29
  end
26
30
  end
27
31
  end
28
-
@@ -1,3 +1,3 @@
1
1
  module AttributesSanitizer
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attributes_sanitizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anderson Dias