coercion 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/lib/coercion.rb +3 -2
- data/lib/coercion/version.rb +3 -0
- metadata +52 -56
data/LICENSE
CHANGED
data/lib/coercion.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
require 'coercion/version'
|
1
2
|
require 'coercion/railtie' if defined?(::Rails::Railtie)
|
2
3
|
|
3
4
|
module Coercion
|
@@ -10,8 +11,8 @@ module Coercion
|
|
10
11
|
|
11
12
|
module StripStrings
|
12
13
|
def write_attribute(attr_name, value)
|
13
|
-
value.strip
|
14
|
-
super
|
14
|
+
value = value.strip if value.is_a?(String)
|
15
|
+
super(attr_name, value)
|
15
16
|
end
|
16
17
|
end
|
17
18
|
end
|
metadata
CHANGED
@@ -1,86 +1,82 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: coercion
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.4
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
|
-
authors:
|
7
|
+
authors:
|
7
8
|
- Tyler Hunt
|
8
9
|
autorequire:
|
9
10
|
bindir: bin
|
10
11
|
cert_chain: []
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
dependencies:
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-03-12 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: activerecord
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
requirements:
|
16
|
+
requirement: &70310506921560 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
21
19
|
- - ~>
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version:
|
24
|
-
version:
|
25
|
-
- !ruby/object:Gem::Dependency
|
26
|
-
name: activesupport
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '3.0'
|
27
22
|
type: :runtime
|
28
|
-
|
29
|
-
version_requirements:
|
30
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70310506921560
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activesupport
|
27
|
+
requirement: &70310506921060 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
31
30
|
- - ~>
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version:
|
34
|
-
version:
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: railties
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.0'
|
37
33
|
type: :runtime
|
38
|
-
|
39
|
-
version_requirements:
|
40
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70310506921060
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: railties
|
38
|
+
requirement: &70310506958460 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
41
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
version:
|
44
|
-
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '3.0'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70310506958460
|
45
47
|
description:
|
46
48
|
email:
|
47
49
|
executables: []
|
48
|
-
|
49
50
|
extensions: []
|
50
|
-
|
51
51
|
extra_rdoc_files: []
|
52
|
-
|
53
|
-
files:
|
52
|
+
files:
|
54
53
|
- LICENSE
|
55
54
|
- lib/coercion/railtie.rb
|
55
|
+
- lib/coercion/version.rb
|
56
56
|
- lib/coercion.rb
|
57
|
-
has_rdoc: true
|
58
57
|
homepage: http://github.com/tylerhunt/coercion
|
59
58
|
licenses: []
|
60
|
-
|
61
59
|
post_install_message:
|
62
60
|
rdoc_options: []
|
63
|
-
|
64
|
-
require_paths:
|
61
|
+
require_paths:
|
65
62
|
- lib
|
66
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
63
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
|
+
none: false
|
65
|
+
requirements:
|
66
|
+
- - ! '>='
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
71
|
+
requirements:
|
72
|
+
- - ! '>='
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
78
75
|
requirements: []
|
79
|
-
|
80
76
|
rubyforge_project:
|
81
|
-
rubygems_version: 1.
|
77
|
+
rubygems_version: 1.8.6
|
82
78
|
signing_key:
|
83
79
|
specification_version: 3
|
84
|
-
summary:
|
80
|
+
summary: An ActiveRecord plugin to strip whitespace from strings and coerce empty
|
81
|
+
strings to nil values on assignment.
|
85
82
|
test_files: []
|
86
|
-
|