redress 0.4.0 → 0.4.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: 48dca657c066cb4fa1396fb346f8863da7b4f8f25c0220f63689751a23539403
4
- data.tar.gz: fa0c17d8bd9907b671297e38cf3fc31b9f6d5107eb443b766e39b45d7a5783b3
3
+ metadata.gz: 5e9932ab0a49884022ac9b826536b72e5f8294252af2c9a4322152de15919d4a
4
+ data.tar.gz: f182b8dc2352cf774a5e1117bfe82dc9ee8f9319bf9a28516165683d353d5b13
5
5
  SHA512:
6
- metadata.gz: b7fbe56267bb3af7b7ed25a49754aca0f95035f572fcbf6464ea5d05324d0b653ad63156427563d0ee3686806b5bc90c7ebdb8934e5399820f5152c9e1383d6b
7
- data.tar.gz: 1fed4838fbdfcdc0313098e96e1d641321b9b76b9cd97a4abac203591f3a5734840e1d5f8770e7dd08a4fdfcb220bf1caa4c113242bb064674935e1eb9d27910
6
+ metadata.gz: 107beeb6d2f81812cdfee470d300f7556960c73ea5a00cd414509bb4dc7679615134679d6b362aa6cbaac03b6faee2f36b35e51d7428441a91afa3a1aaf8328b
7
+ data.tar.gz: 7000bfc7c0c64df258b16bcdfb80b380e68f8e09e0cff2c9e6493481d817df5981ece134c2c27bba1aee776e7f30d12871a82a87254641610a630695b476de0c
data/README.md CHANGED
@@ -63,9 +63,9 @@ class SimpleForm < ApplicationForm
63
63
  mimic :user
64
64
 
65
65
  define_schema do
66
- attribute :nickname, Redress::Types::Strict::String.default("superman")
67
- attribute :name, String
68
- attribute :email, String
66
+ attribute :nickname, Redress::Types::Strict::String.default('superman')
67
+ attribute :name, Redress::Types::StrippedString
68
+ attribute :email, Redress::Types::StrippedString
69
69
  attribute :name_with_email, String
70
70
  attribute :age, Redress::Types::Coercible::Integer
71
71
  atttibute :terms_of_service, Redress::Types::Bool
@@ -12,7 +12,7 @@ module Redress
12
12
  end
13
13
 
14
14
  def self.version
15
- '0.4.0'
15
+ '0.4.1'
16
16
  end
17
17
 
18
18
  def self.version_label
data/lib/redress/types.rb CHANGED
@@ -5,5 +5,9 @@ require 'dry-types'
5
5
  module Redress
6
6
  module Types
7
7
  include Dry::Types()
8
+
9
+ StrippedString = String.constructor do |value|
10
+ value.to_s.strip.empty? ? nil : value.to_s.strip
11
+ end
8
12
  end
9
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redress
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Galeta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-24 00:00:00.000000000 Z
11
+ date: 2019-08-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel