stringify_date 0.0.4 → 0.0.5

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
  SHA1:
3
- metadata.gz: a39eb73f6ef96799f1f98e25804abcae35069425
4
- data.tar.gz: c259372ac147418e7d861b6b1f93575076c86e4a
3
+ metadata.gz: 1cd8b5cdd13ef8963c90c44bd1360572dece4aca
4
+ data.tar.gz: bf011c635c3c4c3c9254ae4a0294f4c9dde5ba99
5
5
  SHA512:
6
- metadata.gz: 6c2f550d6cbb82b91c1a1cd1ed2df57bc52604a3c86c6fe846160c00641ae40771391b44b7dbba44536119d2d98ccba6344f1dd75166e484c577dcbafa8252dc
7
- data.tar.gz: 2a5085fcde8ef0ed4bdca6b7e93f3618fe233a2aac8f03bffb5fe68e23f3547d9661dc599cbeb4409670edb7120fb5e1d64bfac743e290d62bfb370ed4f57f1d
6
+ metadata.gz: f3e2b1a01adbb4d4ebeecdcd965163993d9a6ea19f6d844bf9ac1684e6f4c6f2d02fe3ec2a42e867aa6ea46e1f9d463af2dac3b7426aa709f39f70a86699edff
7
+ data.tar.gz: 7e42e6f7b3db793e5802b83ebfe38e90fa294c62cf39921e878d93797767bdab300c0d6cbb650dba1214feb5d1e75d8b5992d372eec6eac07719262f4fa921a4
@@ -1,4 +1,7 @@
1
1
  language: ruby
2
+ script:
3
+ - 'rake spec'
4
+
2
5
  rvm:
3
6
  - 1.9.3
4
7
  - 2.0.0
data/README.md CHANGED
@@ -1,3 +1,5 @@
1
+ [![Build Status](https://travis-ci.org/matheusvetor/stringify_date.svg?branch=master)](https://travis-ci.org/matheusvetor/stringify_date)
2
+
1
3
  # StringifyDate
2
4
 
3
5
  This gem provides a _string and _string= to date and datetime attributes.
data/Rakefile CHANGED
@@ -1,2 +1 @@
1
1
  require "bundler/gem_tasks"
2
-
@@ -30,9 +30,10 @@ module StringifyDate
30
30
  Time.parse(value)
31
31
  rescue ArgumentError
32
32
  instance_variable_set("@#{name}_invalid", true)
33
+ nil
33
34
  end
34
35
  else
35
- ''
36
+ nil
36
37
  end
37
38
  )
38
39
  end
@@ -1,3 +1,3 @@
1
1
  module StringifyDate
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -35,6 +35,12 @@ describe StringifyDate::ActiveRecord::Stringify do
35
35
  expect(test_date.valid?).to be(false)
36
36
  end
37
37
 
38
+ it 'should real attribute be nil when parse invalid date' do
39
+ test_date.start_at_string = 'invalid'
40
+
41
+ expect(test_date.start_at).to be(nil)
42
+ end
43
+
38
44
  it 'should be valid when parse empty string' do
39
45
  test_date.start_at_string = ''
40
46
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stringify_date
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rute Passos
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-22 00:00:00.000000000 Z
12
+ date: 2014-10-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -132,6 +132,7 @@ extensions: []
132
132
  extra_rdoc_files: []
133
133
  files:
134
134
  - ".gitignore"
135
+ - ".travis.yml"
135
136
  - Gemfile
136
137
  - Guardfile
137
138
  - LICENSE.txt
@@ -190,7 +191,6 @@ files:
190
191
  - spec/dummy/public/favicon.ico
191
192
  - spec/spec_helper.rb
192
193
  - stringify_date.gemspec
193
- - travis.yml
194
194
  homepage: https://github.com/matheusvetor/stringify_date
195
195
  licenses:
196
196
  - MIT