active_interaction 1.0.2 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07e6b7eb1027d9cb220bccdd4ad1e97d23d85dc2
4
- data.tar.gz: 07dfb947aafeea6442164d08ed03b37c2738f446
3
+ metadata.gz: e077e7417f7fbedd11628a5e7afa21c6f621b97b
4
+ data.tar.gz: 7b2791942057e4952c06215bed4dc10db96f4a13
5
5
  SHA512:
6
- metadata.gz: 1fac720546402daaed4ca81cb48266d394acef2133da63029d9288e5bc5055467766a290ea952a3716bb298f17e112bbd819d434593c173bfe2708f3b7fabb21
7
- data.tar.gz: 2b1263e75189e213d1c1ac289b51eb374b8bb3cde3846ee1944954a1b0ff41d889f99e77d604de3eb8dbfe54229b76d39486b38622f28880247df486c0288e6c
6
+ metadata.gz: 201b72229f19b2a3dc03ee3e6110463f25ad9b1295b245cb90564b1f15ecb73d4f8e7f22880d8b353ab8669f594e7c386bb9bf774cc8ed70e461e8824669a579
7
+ data.tar.gz: 92e695b28d7d0e4aaa80d3adb96b10248f4a3a7fb222ee3c48b406efe30cc5b2a0679e1cc336b52113dda3a6b6f037356bc6c5b826a2316198e279d36b518920
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # [Master][]
2
2
 
3
+ # [1.0.4][] (2014-02-11)
4
+
5
+ - Add translations to the gem specification.
6
+
7
+ # [1.0.3][] (2014-02-11)
8
+
9
+ - Fix a bug that caused invalid strings to be parsed as `nil` instead of
10
+ raising an error when `Time.zone` was set.
11
+ - Fix bug that prevented loading I18n translations.
12
+
3
13
  # [1.0.2][] (2014-02-07)
4
14
 
5
15
  - Stop creating duplicate errors on subsequent calls to `valid?`.
@@ -129,7 +139,9 @@
129
139
 
130
140
  - Initial release.
131
141
 
132
- [master]: https://github.com/orgsync/active_interaction/compare/v1.0.2...master
142
+ [master]: https://github.com/orgsync/active_interaction/compare/v1.0.4...master
143
+ [1.0.4]: https://github.com/orgsync/active_interaction/compare/v1.0.3...v1.0.4
144
+ [1.0.3]: https://github.com/orgsync/active_interaction/compare/v1.0.2...v1.0.3
133
145
  [1.0.2]: https://github.com/orgsync/active_interaction/compare/v1.0.1...v1.0.2
134
146
  [1.0.1]: https://github.com/orgsync/active_interaction/compare/v1.0.0...v1.0.1
135
147
  [1.0.0]: https://github.com/orgsync/active_interaction/compare/v0.10.2...v1.0.0
@@ -31,9 +31,8 @@ require 'active_interaction/filters/time_filter'
31
31
 
32
32
  require 'active_interaction/base'
33
33
 
34
- I18n.backend.load_translations(
35
- Dir[File.join(%w(lib active_interaction locale *.yml))]
36
- )
34
+ I18n.load_path << File.expand_path(
35
+ File.join(%w(active_interaction locale en.yml)), File.dirname(__FILE__))
37
36
 
38
37
  # Manage application specific business logic.
39
38
  #
@@ -42,5 +41,5 @@ I18n.backend.load_translations(
42
41
  #
43
42
  # @since 1.0.0
44
43
  #
45
- # @version 1.0.2
44
+ # @version 1.0.4
46
45
  module ActiveInteraction end
@@ -28,7 +28,8 @@ module ActiveInteraction
28
28
  if format?
29
29
  klass.strptime(value, format)
30
30
  else
31
- klass.parse(value)
31
+ klass.parse(value) ||
32
+ (fail ArgumentError, "no time information in #{value.inspect}")
32
33
  end
33
34
  rescue ArgumentError
34
35
  _cast(value)
@@ -0,0 +1,19 @@
1
+ en:
2
+ active_interaction:
3
+ errors:
4
+ messages:
5
+ invalid: is invalid
6
+ invalid_type: is not a valid %{type}
7
+ missing: is required
8
+ types:
9
+ array: array
10
+ boolean: boolean
11
+ date: date
12
+ date_time: date time
13
+ file: file
14
+ float: float
15
+ hash: hash
16
+ integer: integer
17
+ model: model
18
+ string: string
19
+ time: time
@@ -5,5 +5,5 @@ module ActiveInteraction
5
5
  # The version number.
6
6
  #
7
7
  # @return [Gem::Version]
8
- VERSION = Gem::Version.new('1.0.2')
8
+ VERSION = Gem::Version.new('1.0.4')
9
9
  end
@@ -9,6 +9,7 @@ TimeZone = Class.new do
9
9
 
10
10
  def self.parse(*args)
11
11
  TimeWithZone.new(Time.parse(*args))
12
+ rescue ArgumentError
12
13
  end
13
14
  end
14
15
 
@@ -57,6 +58,14 @@ describe TimeInteraction do
57
58
  end
58
59
  end
59
60
 
61
+ context 'with an invalid String' do
62
+ let(:a) { 'invalid' }
63
+
64
+ it 'is invalid' do
65
+ expect(outcome).to be_invalid
66
+ end
67
+ end
68
+
60
69
  context 'with a Time' do
61
70
  let(:a) { Time.now }
62
71
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_interaction
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne
@@ -9,124 +9,124 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-02-07 00:00:00.000000000 Z
12
+ date: 2014-02-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ">="
19
19
  - !ruby/object:Gem::Version
20
20
  version: '3'
21
- - - <
21
+ - - "<"
22
22
  - !ruby/object:Gem::Version
23
23
  version: '5'
24
24
  type: :runtime
25
25
  prerelease: false
26
26
  version_requirements: !ruby/object:Gem::Requirement
27
27
  requirements:
28
- - - '>='
28
+ - - ">="
29
29
  - !ruby/object:Gem::Version
30
30
  version: '3'
31
- - - <
31
+ - - "<"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '5'
34
34
  - !ruby/object:Gem::Dependency
35
35
  name: bundler
36
36
  requirement: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ~>
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '1.5'
41
41
  type: :development
42
42
  prerelease: false
43
43
  version_requirements: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ~>
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
47
  version: '1.5'
48
48
  - !ruby/object:Gem::Dependency
49
49
  name: coveralls
50
50
  requirement: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ~>
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0.7'
55
55
  type: :development
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0.7'
62
62
  - !ruby/object:Gem::Dependency
63
63
  name: guard-rspec
64
64
  requirement: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '4.2'
69
69
  type: :development
70
70
  prerelease: false
71
71
  version_requirements: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ~>
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
75
  version: '4.2'
76
76
  - !ruby/object:Gem::Dependency
77
77
  name: rake
78
78
  requirement: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ~>
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '10.1'
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ~>
87
+ - - "~>"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '10.1'
90
90
  - !ruby/object:Gem::Dependency
91
91
  name: rdoc
92
92
  requirement: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ~>
94
+ - - "~>"
95
95
  - !ruby/object:Gem::Version
96
96
  version: '4.1'
97
97
  type: :development
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ~>
101
+ - - "~>"
102
102
  - !ruby/object:Gem::Version
103
103
  version: '4.1'
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: guard-rubocop
106
106
  requirement: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ~>
108
+ - - "~>"
109
109
  - !ruby/object:Gem::Version
110
110
  version: '1.0'
111
111
  type: :development
112
112
  prerelease: false
113
113
  version_requirements: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ~>
115
+ - - "~>"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '1.0'
118
118
  - !ruby/object:Gem::Dependency
119
119
  name: yard
120
120
  requirement: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ~>
122
+ - - "~>"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0.8'
125
125
  type: :development
126
126
  prerelease: false
127
127
  version_requirements: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ~>
129
+ - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0.8'
132
132
  description: Manage application specific business logic.
@@ -137,10 +137,6 @@ executables: []
137
137
  extensions: []
138
138
  extra_rdoc_files: []
139
139
  files:
140
- - CHANGELOG.md
141
- - LICENSE.txt
142
- - README.md
143
- - lib/active_interaction.rb
144
140
  - lib/active_interaction/base.rb
145
141
  - lib/active_interaction/concerns/active_modelable.rb
146
142
  - lib/active_interaction/concerns/hashable.rb
@@ -165,6 +161,7 @@ files:
165
161
  - lib/active_interaction/filters/time_filter.rb
166
162
  - lib/active_interaction/modules/validation.rb
167
163
  - lib/active_interaction/version.rb
164
+ - lib/active_interaction.rb
168
165
  - spec/active_interaction/base_spec.rb
169
166
  - spec/active_interaction/concerns/active_modelable_spec.rb
170
167
  - spec/active_interaction/concerns/hashable_spec.rb
@@ -205,6 +202,10 @@ files:
205
202
  - spec/support/concerns.rb
206
203
  - spec/support/filters.rb
207
204
  - spec/support/interactions.rb
205
+ - CHANGELOG.md
206
+ - LICENSE.txt
207
+ - README.md
208
+ - lib/active_interaction/locale/en.yml
208
209
  homepage: http://orgsync.github.io/active_interaction/
209
210
  licenses:
210
211
  - MIT
@@ -215,17 +216,17 @@ require_paths:
215
216
  - lib
216
217
  required_ruby_version: !ruby/object:Gem::Requirement
217
218
  requirements:
218
- - - '>='
219
+ - - ">="
219
220
  - !ruby/object:Gem::Version
220
221
  version: 1.9.3
221
222
  required_rubygems_version: !ruby/object:Gem::Requirement
222
223
  requirements:
223
- - - '>='
224
+ - - ">="
224
225
  - !ruby/object:Gem::Version
225
226
  version: '0'
226
227
  requirements: []
227
228
  rubyforge_project:
228
- rubygems_version: 2.2.0
229
+ rubygems_version: 2.1.11
229
230
  signing_key:
230
231
  specification_version: 4
231
232
  summary: Manage application specific business logic.