activemodel-form 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 7e058c984da25c27169959762dac404cceae4751
4
+ data.tar.gz: 482b90026e32b2bdfeefca36d3a7920c9bcd9e7e
5
+ SHA512:
6
+ metadata.gz: 03e38946cc2fd643cfd44544692d1c8cf20e72503ffa6f262810c34e503710bf1afe0fb341d05ef8f2dc2250cfb2ab0e085c7b7b2c6ff1ee30e5ad36770e2d2c
7
+ data.tar.gz: 853a0ab98b68da5367c7fea52f71ba316271e9897495c63a2f3fe230130c36d60e52dad20d6ff74e17ffdac5a8345ed775757f456d484f27425d02ba13f5ab50
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ #### 0.0.3
2
+
3
+ * Added simplecov (Thanks [@colszowka](https://github.com/colszowka))
4
+ * Fixed a bug where passing in ' ' to string attributes lead to
5
+ RuntimeErrors. (Thanks again [@colszowka](https://github.com/colszowka)) [#4](https://github.com/MSch/activemodel-form/pull/4)
@@ -17,10 +17,11 @@ Gem::Specification.new do |gem|
17
17
  gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
18
18
  gem.require_paths = ["lib"]
19
19
 
20
- gem.add_runtime_dependency 'activemodel', '~> 3.2.7'
21
- gem.add_runtime_dependency 'activesupport', '~> 3.2.7'
20
+ gem.add_runtime_dependency 'activemodel', '>= 3.2.7'
21
+ gem.add_runtime_dependency 'activesupport', '>= 3.2.7'
22
22
 
23
23
  gem.add_development_dependency 'rake'
24
24
  gem.add_development_dependency 'pry'
25
25
  gem.add_development_dependency 'minitest'
26
+ gem.add_development_dependency 'simplecov'
26
27
  end
@@ -66,7 +66,7 @@ module ActiveModel
66
66
  def self.parse(v)
67
67
  if v.present?
68
68
  String.new(v)
69
- elsif ['', nil].include? v
69
+ elsif ['', nil].include? v.to_s.strip
70
70
  nil
71
71
  else
72
72
  raise "Couldn't parse string attribute value: '#{v}'"
@@ -1,5 +1,5 @@
1
1
  module ActiveModel
2
2
  class Form
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
data/spec/spec_helper.rb CHANGED
@@ -1,3 +1,5 @@
1
+ require 'simplecov'
2
+ SimpleCov.start
1
3
  require 'minitest/spec'
2
4
  require 'minitest/autorun'
3
5
 
@@ -0,0 +1,19 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe ActiveModel::Form::StringAttribute do
4
+ it "parses '' as nil" do
5
+ ActiveModel::Form::StringAttribute.parse('').must_equal nil
6
+ end
7
+
8
+ it "parses ' ' as nil" do
9
+ ActiveModel::Form::StringAttribute.parse(' ').must_equal nil
10
+ end
11
+
12
+ it "parses nil as nil" do
13
+ ActiveModel::Form::StringAttribute.parse(nil).must_equal nil
14
+ end
15
+
16
+ it "parses 'A String' as that string" do
17
+ ActiveModel::Form::StringAttribute.parse('A String').must_equal 'A String'
18
+ end
19
+ end
metadata CHANGED
@@ -1,94 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activemodel-form
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
5
- prerelease:
4
+ version: 0.0.3
6
5
  platform: ruby
7
6
  authors:
8
7
  - Martin Schürrer
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-12-10 00:00:00.000000000 Z
11
+ date: 2013-05-13 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: activemodel
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
- - - ~>
17
+ - - '>='
20
18
  - !ruby/object:Gem::Version
21
19
  version: 3.2.7
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
- - - ~>
24
+ - - '>='
28
25
  - !ruby/object:Gem::Version
29
26
  version: 3.2.7
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: activesupport
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ~>
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: 3.2.7
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ~>
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: 3.2.7
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rake
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: pry
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: minitest
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: simplecov
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - '>='
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - '>='
92
95
  - !ruby/object:Gem::Version
93
96
  version: '0'
94
97
  description: ActiveModel with support for booleans and datetimes in form helpers
@@ -100,6 +103,7 @@ extra_rdoc_files: []
100
103
  files:
101
104
  - .gitignore
102
105
  - .travis.yml
106
+ - CHANGELOG.md
103
107
  - Gemfile
104
108
  - LICENSE.txt
105
109
  - README.md
@@ -144,35 +148,29 @@ files:
144
148
  - spec/integer_attribute_form_spec.rb
145
149
  - spec/model_name_spec.rb
146
150
  - spec/spec_helper.rb
151
+ - spec/string_attribute_spec.rb
147
152
  homepage: https://github.com/MSch/activemodel-form
148
153
  licenses: []
154
+ metadata: {}
149
155
  post_install_message:
150
156
  rdoc_options: []
151
157
  require_paths:
152
158
  - lib
153
159
  required_ruby_version: !ruby/object:Gem::Requirement
154
- none: false
155
160
  requirements:
156
- - - ! '>='
161
+ - - '>='
157
162
  - !ruby/object:Gem::Version
158
163
  version: '0'
159
- segments:
160
- - 0
161
- hash: 1924311521467823083
162
164
  required_rubygems_version: !ruby/object:Gem::Requirement
163
- none: false
164
165
  requirements:
165
- - - ! '>='
166
+ - - '>='
166
167
  - !ruby/object:Gem::Version
167
168
  version: '0'
168
- segments:
169
- - 0
170
- hash: 1924311521467823083
171
169
  requirements: []
172
170
  rubyforge_project:
173
- rubygems_version: 1.8.24
171
+ rubygems_version: 2.0.3
174
172
  signing_key:
175
- specification_version: 3
173
+ specification_version: 4
176
174
  summary: ''
177
175
  test_files:
178
176
  - spec/boolean_attribute_form_spec.rb
@@ -180,3 +178,5 @@ test_files:
180
178
  - spec/integer_attribute_form_spec.rb
181
179
  - spec/model_name_spec.rb
182
180
  - spec/spec_helper.rb
181
+ - spec/string_attribute_spec.rb
182
+ has_rdoc: