active_interaction 3.0.1 → 3.1.0

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: 570d5eae8a7122f5acf5ea497d191574073c80d1
4
- data.tar.gz: f5a66f3defbfd2cee1dabf0a60f7d4799544b043
3
+ metadata.gz: e72499bf1bdf3c8e52009aec73e0fa72c811055c
4
+ data.tar.gz: 1cf3dc7c588dfdc26b9342f657039ed854c0e510
5
5
  SHA512:
6
- metadata.gz: 4af716412dbce18461deb2ff8a15878511c683ef9fc3bc499b027788ecba3d98ada05ed09ab615a0ec8adcfbcd61a39c57cd119a3095c26c3a0760891d9d74bd
7
- data.tar.gz: 2911bf4456d0724b48804e4176ed96fcf40361b7dba671dfa7450f3a24180e3188a1509d4ffdeb8e41ed40e8895e80a4d2c5f96ce37651a14d208345c457ad82
6
+ metadata.gz: 853da48292d4d04cc8854c6a5992347ad48935806802d7a2dd22a8c35e345039f1c8751a2fc52b155a5848329db8b58d89aa338af1211b238f5c6a4772fb58a2
7
+ data.tar.gz: 9095f7b640d805897acf24f7a9439ae78cbb7af08a41d101070a7712786f878d4287a096420a90e52c05fecf0c56b0f766e58fada470e649d3273d2b64c2ba2a
@@ -1,672 +1,7 @@
1
- # [3.0.1][] (2016-01-15)
1
+ # Change log
2
2
 
3
- ## Fixed
3
+ ActiveInteraction uses [Semantic Versioning][].
4
+ The change log is available through the [releases on GitHub][].
4
5
 
5
- - [#349][]: Merging errors on `:base` with a message that was a `String` attempted to translate it.
6
-
7
- # [3.0.0][] (2016-01-13)
8
-
9
- ## Changed
10
-
11
- - [#333][]: Copy symbolic errors when using `compose`.
12
-
13
- ## Removed
14
-
15
- - [#344][]: Support for Ruby 1.9.3.
16
- - [#346][]: Support for ActiveModel 3.2.
17
-
18
- # [2.2.0][] (2015-12-18)
19
-
20
- ## Added
21
-
22
- - [#336][]: Added frozen string pragma for Ruby 2.3.
23
-
24
- ## Changed
25
-
26
- - [#332][]: Changed default lambdas to be evaluated in the interaction's
27
- binding.
28
-
29
- # [2.1.5][] (2015-12-11)
30
-
31
- ## Added
32
-
33
- - [#330][]: Added a French translation.
34
-
35
- # [2.1.4][] (2015-11-03)
36
-
37
- ## Fixed
38
-
39
- - [#320][]: Stopped requiring ActiveRecord.
40
-
41
- ## Added
42
-
43
- - [#310][]: Added a warning when a filter is redefined.
44
-
45
- ## Changed
46
-
47
- - [#311][]: Changed the error message when defining the default value for a
48
- hash.
49
-
50
- # [2.1.3][] (2015-10-02)
51
-
52
- ## Fixed
53
-
54
- - [#303][]: Allowed ActiveRecord associations as inputs to array filters.
55
-
56
- ## Changed
57
-
58
- - [#304][]: Improved the error message for object filters when the class does
59
- not exist.
60
-
61
- # [2.1.2][] (2015-09-03)
62
-
63
- ## Fixed
64
-
65
- - [#298][]: Fixed a bug that raised exceptions when passing invalid nested
66
- values.
67
-
68
- # [2.1.1][] (2015-08-04)
69
-
70
- ## Fixed
71
-
72
- - [#296][]: Fixed a bug that silently converted invalid lazy default values to
73
- `nil` instead of raising an `InvalidDefaultError`.
74
-
75
- # [2.1.0][] (2015-07-30)
76
-
77
- ## Added
78
-
79
- - [#295][]: Added `given?` predicate method to see if an input was passed to
80
- `run`.
81
-
82
- # [2.0.1][] (2015-05-27)
83
-
84
- ## Fixed
85
-
86
- - [#286][]: Change `file` filter to check for `rewind` instead of `eof?`.
87
- - [#289][]: Actually removed `model` filter, which was deprecated in v1.6.0.
88
-
89
- # [2.0.0][] (2015-05-06)
90
-
91
- For help upgrading to version 2, please read [the announcement post][].
92
-
93
- ## Changed
94
-
95
- - [#250][]: Replaced symbolic errors with Rails 5-style detailed errors.
96
- - [#269][]: Prevented proc defaults from being eagerly evaluated.
97
- - [#264][]: Renamed `model` filter to `object`.
98
- - [#213][]: Remove transaction support. Database transactions will need to be
99
- handled manually now.
100
- - [#214][]: Results are returned from invalid outcomes.
101
- - [#164][]: Changed the `hash` filter to use hashes with indifferent access.
102
- - [#236][]: Changed the `file` filter to accept anything that responds to `eof?`.
103
-
104
- ## Security
105
-
106
- - [#215][]: Rather than symbolizing keys all hashes now use indifferent access.
107
- This takes care of potential but unlikely DoS attacks noted in [#163][].
108
-
109
- # [1.6.1][] (2015-10-02)
110
-
111
- ## Fixed
112
-
113
- - [#303][]: Allowed ActiveRecord associations as inputs to array filters.
114
-
115
- # [1.6.0][] (2015-05-06)
116
-
117
- ## Added
118
-
119
- - Added `object` as an alias for `model`.
120
- - Added symbol support to `add`.
121
- - Added `details` as an alternative to `symbolic`.
122
-
123
- ## Changed
124
-
125
- - Deprecated `model` in favor of `object`.
126
- - Deprecated `add_sym` in favor of `add`.
127
- - Deprecated `transaction`.
128
- - Deprecated `symbolic` in favor of `details`.
129
-
130
- # [1.5.1][] (2015-04-28)
131
-
132
- ## Fixed
133
-
134
- - [#265][]: Allow `nil` inputs for interface and model filters.
135
- - [#256][]: Improve error messages for nested invalid values.
136
-
137
- # [1.5.0][] (2015-02-05)
138
-
139
- ## Added
140
-
141
- - [#248][]: Add `has_attribute?` support to an instance of an interaction.
142
-
143
- ## Fixed
144
-
145
- - [#248][]: Fix support for simple_form gem.
146
-
147
- # [1.4.1][] (2014-12-12)
148
-
149
- ## Fixed
150
-
151
- - [#244][]: Fix improperly adding load paths to I18n.
152
-
153
- # [1.4.0][] (2014-12-10)
154
-
155
- ## Changed
156
-
157
- - [#239][]: Accept `ActiveRecord::Relation` objects as `array` inputs.
158
-
159
- # [1.3.1][] (2014-12-10)
160
-
161
- ## Fixed
162
-
163
- - [#235][]: Fix a bug that prevented custom translations from loading.
164
- - [#224][]: Fix a bug that incorrectly inferred plural class names for filters
165
- inside arrays.
166
-
167
- # [1.3.0][] (2014-08-15)
168
-
169
- ## Added
170
-
171
- - [#178][]: Add an interface filter.
172
- - [#196][]: Add a `type_check` callback that happens before the `validation`
173
- callback.
174
-
175
- # [1.2.5][] (2014-08-15)
176
-
177
- ## Fixed
178
-
179
- - [#207][]: Fix a bug that incorrectly converted plural class names
180
- to their singular form.
181
- - [#206][]: Fix a bug that caused an i18n deprecation warning.
182
- - [#201][]: Prevented time filters from being initialized with the
183
- format option when time zones are available.
184
-
185
- # [1.2.4][] (2014-08-07)
186
-
187
- ## Fixed
188
-
189
- - [#203][]: Fix a bug that prevented transaction options from being passed to
190
- subclasses.
191
-
192
- # [1.2.3][] (2014-05-12)
193
-
194
- ## Fixed
195
-
196
- - [#192][]: Fix a bug that raised `ActiveRecord::Rollback` when composing even
197
- when not in a transaction.
198
-
199
- # [1.2.2][] (2014-05-07)
200
-
201
- ## Fixed
202
-
203
- - Fix a bug that raised `NameError`s when there were invalid nested hash
204
- errors.
205
- - Add missing translation for symbol filters.
206
-
207
- # [1.2.1][] (2014-05-02)
208
-
209
- ## Fixed
210
-
211
- - [#179][]: Fix a bug that marked model inputs as invalid even if they returned true
212
- for `object.is_a?(klass)`.
213
-
214
- # [1.2.0][] (2014-04-30)
215
-
216
- ## Added
217
-
218
- - [#175][]: Add support for Rails-style date and time parameters like `date(1i)`.
219
- - [#173][]: Add a decimal filter.
220
- - [#155][]: Add support for disabling and modifying transactions through the
221
- `transaction` helper method.
222
- - [#140][]: Add support for `column_for_attribute` which provides better
223
- interoperability with gems like Formtastic and Simple Form.
224
-
225
- # [1.1.7][] (2014-04-30)
226
-
227
- ## Fixed
228
-
229
- - [#174][]: Fix a bug that leaked validators among all child classes.
230
-
231
- # [1.1.6][] (2014-04-29)
232
-
233
- ## Fixed
234
-
235
- - [#36][]: Fix a bug that caused nested hash error messages to be misleading.
236
-
237
- # [1.1.5][] (2014-03-31)
238
-
239
- ## Fixed
240
-
241
- - The `transform_keys` method broke backwards compatibility because it's not
242
- available until Rails 4.0.2.
243
-
244
- # [1.1.4][] (2014-03-31)
245
-
246
- ## Fixed
247
-
248
- - Fix an issue where non-stripped hash keys would be incorrectly converted to strings.
249
-
250
- # [1.1.3][] (2014-03-31)
251
-
252
- ## Fixed
253
-
254
- - [#165][]: Fix Rubocop errors and pin the version to avoid future issues with new cops
255
- breaking the build.
256
-
257
- ## Security
258
-
259
- - [#163][]: Fix some denial of service attacks via hash symbolization.
260
-
261
- # [1.1.2][] (2014-03-05)
262
-
263
- ## Fixed
264
-
265
- - [#156][]: Don't constantize classes for model filters on initialization. This fixes a
266
- bug that made those filters dependent on load order.
267
-
268
- # [1.1.1][] (2014-03-04)
269
-
270
- ## Fixed
271
-
272
- - [#153][]: Allow merging ActiveModel errors into ActiveInteraction errors with
273
- `ActiveInteraction::Errors#merge!`.
274
-
275
- # [1.1.0][] (2014-02-28)
276
-
277
- ## Added
278
-
279
- - [#116][], [#119][], [#122][]: Speed up many filters by caching class constants.
280
- - [#115][]: Add support for callbacks around `execute`.
281
- - [#136][]: Allow callable defaults.
282
-
283
- ## Changed
284
-
285
- - [#114][]: Support `:only` and `:except` options simultaneously with `import_filters`.
286
- Previously this raised an `ArgumentError`.
287
- - [#114][]: Support passing a single symbol to `:only` and `:except`. Previously an Array
288
- was required.
289
-
290
- ## Security
291
-
292
- - [#138][]: Only set instance variables for attributes with readers defined.
293
-
294
-
295
- # [1.0.5][] (2014-02-25)
296
-
297
- ## Fixed
298
-
299
- - [#143][]: Rollback database changes when `compose` fails.
300
-
301
- # [1.0.4][] (2014-02-11)
302
-
303
- ## Fixed
304
-
305
- - Add translations to the gem specification.
306
-
307
- # ~~[1.0.3][] (2014-02-11)~~
308
-
309
- ## Fixed
310
-
311
- - [#135][]: Fix a bug that caused invalid strings to be parsed as `nil` instead of
312
- raising an error when `Time.zone` was set.
313
- - [#134][]: Fix bug that prevented loading I18n translations.
314
-
315
- # [1.0.2][] (2014-02-07)
316
-
317
- ## Fixed
318
-
319
- - [#130][]: Stop creating duplicate errors on subsequent calls to `valid?`.
320
-
321
- # [1.0.1][] (2014-02-04)
322
-
323
- ## Fixed
324
-
325
- - [#125][]: Short circuit `valid?` after successfully running an interaction.
326
- - [#129][]: Fix a bug that prevented merging interpolated symbolic errors.
327
- - [#128][]: Use `:invalid_type` instead of `:invalid` as I18n key for type errors.
328
- - [#127][]: Fix a bug that skipped setting up accessors for imported filters.
329
-
330
- # [1.0.0][] (2014-01-21)
331
-
332
- ## Added
333
-
334
- - [#102][]: Add predicate methods for checking if an input was passed.
335
- - [#103][]: Allow fetching filters by name.
336
- - [#104][]: Allow import filters from another interaction with `import_filters`.
337
-
338
- ## Changed
339
-
340
- - [#111][]: Replace `Filters` with a hash. To iterate over `Filter` objects, use
341
- `Interaction.filters.values`.
342
- - Rename `Filter#has_default?` to `Filter#default?`.
343
-
344
- ## Fixed
345
-
346
- - [#98][]: Add `respond_to_missing?` to complement `method_missing` calls.
347
- - [#106][]: When adding a filter that shares a name with an existing filter, it will now
348
- replace the existing one instead of adding a duplicate.
349
-
350
- # [0.10.2][] (2014-01-02)
351
-
352
- ## Fixed
353
-
354
- - [#94][]: Fix a bug that marked Time instances as invalid if Time.zone was set.
355
-
356
- # [0.10.1][] (2013-12-20)
357
-
358
- ## Fixed
359
-
360
- - [#90][]: Fix bug that prevented parsing strings as times when ActiveSupport was
361
- available.
362
-
363
- # [0.10.0][] (2013-12-19)
364
-
365
- ## Added
366
-
367
- - Support casting "true" and "false" as booleans.
368
-
369
- ## Fixed
370
-
371
- - [#89][]: Fix bug that allowed subclasses to mutate the filters on their superclasses.
372
-
373
- # [0.9.1][] (2013-12-17)
374
-
375
- ## Fixed
376
-
377
- - [#84][]: Fix I18n deprecation warning.
378
- - [#82][]: Raise `ArgumentError` when running an interaction with non-hash inputs.
379
- - [#77][]: For compatibility with `ActiveRecord::Errors`, support indifferent access of
380
- `ActiveInteraction::Errors`.
381
- - [#88][]: Fix losing filters when using inheritance.
382
-
383
- # [0.9.0][] (2013-12-02)
384
-
385
- ## Added
386
-
387
- - Add experimental composition implementation (`ActiveInteraction::Base#compose`).
388
-
389
- ## Removed
390
-
391
- - Remove `ActiveInteraction::Pipeline`.
392
-
393
- # [0.8.0][] (2013-11-14)
394
-
395
- ## Added
396
-
397
- - [#44][], [#45][]: Add ability to document interactions and filters.
398
-
399
- # [0.7.0][] (2013-11-14)
400
-
401
- ## Added
402
-
403
- - [#41][]: Add ability to chain a series of interactions together with
404
- `ActiveInteraction::Pipeline`.
405
-
406
- # [0.6.1][] (2013-11-14)
407
-
408
- ## Fixed
409
-
410
- - Re-release. Forgot to merge into master.
411
-
412
- # ~~[0.6.0][] (2013-11-14)~~
413
-
414
- ## Added
415
-
416
- - Add ability to introspect interactions with `filters`.
417
- - [#57][]: Allow getting all of the user-supplied inputs in an interaction with
418
- `inputs`.
419
- - [#61][]: Add a symbol filter.
420
- - [#58][]: Allow adding symbolic errors with `errors.add_sym` and retrieving them with
421
- `errors.symbolic`.
422
-
423
- ## Changed
424
-
425
- - Error class now end with `Error`.
426
- - By default, strip unlisted keys from hashes. To retain the old behavior,
427
- set `strip: false` on a hash filter.
428
- - [#49][]: Prevent specifying defaults (other than `nil` or `{}`) on hash filters. Set
429
- defaults on the nested filters instead.
430
- - [#66][]: Replace `allow_nil: true` with `default: nil`.
431
-
432
- ## Fixed
433
-
434
- - Fix bug that prevented listing multiple attributes in a hash filter.
435
- - Fix bug that prevented hash filters from being nested in array filters.
436
-
437
- # [0.5.0][] (2013-10-16)
438
-
439
- ## Added
440
-
441
- - [#34][]: Allow adding errors in `execute` method with `errors.add`.
442
-
443
- ## Fixed
444
-
445
- - [#56][]: Prevent manually setting the outcome's result.
446
-
447
- # [0.4.0][] (2013-08-15)
448
-
449
- ## Added
450
-
451
- - Support i18n translations.
452
-
453
- # [0.3.0][] (2013-08-07)
454
-
455
- ## Added
456
-
457
- - [#30][]: Allow nested default values.
458
-
459
- ## Changed
460
-
461
- - [#36][]: Give better error messages for nested attributes.
462
- - [#39][]: Add a more useful invalid interaction error message.
463
- - [#38][]: Use default value when given an explicit `nil`.
464
-
465
- # [0.2.2][] (2013-08-07)
466
-
467
- ## Fixed
468
-
469
- - [#40][]: Fix support for `ActiveSupport::TimeWithZone`.
470
-
471
- # [0.2.1][] (2013-08-06)
472
-
473
- ## Fixed
474
-
475
- - [#37][]: Fix setting a default value on more than one attribute at a time.
476
-
477
- # [0.2.0][] (2013-07-16)
478
-
479
- ## Added
480
-
481
- - [#23][]: Add support for strptime format strings on Date, DateTime, and Time filters.
482
-
483
- ## Changed
484
-
485
- - [#20][]: Wrap interactions in ActiveRecord transactions if they're available.
486
- - [#24][]: Add option to strip string values, which is enabled by default.
487
-
488
- # [0.1.3][] (2013-07-16)
489
-
490
- ## Fixed
491
-
492
- - Fix bug that prevented `attr_accessor`s from working.
493
- - Handle unconfigured timezones.
494
- - [#27][]: Use RDoc as YARD's Markdown provider instead of kramdown.
495
-
496
- # [0.1.2][] (2013-07-14)
497
-
498
- ## Fixed
499
-
500
- - [#29][]: `execute` will now have the filtered version of the values passed
501
- to `run` or `run!` as was intended.
502
-
503
- # [0.1.1][] (2013-07-13)
504
-
505
- ## Fixed
506
-
507
- - [#28][]: Correct gemspec dependencies on activemodel.
508
-
509
- # ~~[0.1.0][] (2013-07-12)~~
510
-
511
- - Initial release.
512
-
513
- [3.0.1]: https://github.com/orgsync/active_interaction/compare/v3.0.0...v3.0.1
514
- [3.0.0]: https://github.com/orgsync/active_interaction/compare/v2.2.0...v3.0.0
515
- [2.2.0]: https://github.com/orgsync/active_interaction/compare/v2.1.5...v2.2.0
516
- [2.1.5]: https://github.com/orgsync/active_interaction/compare/v2.1.4...v2.1.5
517
- [2.1.4]: https://github.com/orgsync/active_interaction/compare/v2.1.3...v2.1.4
518
- [2.1.3]: https://github.com/orgsync/active_interaction/compare/v2.1.2...v2.1.3
519
- [2.1.2]: https://github.com/orgsync/active_interaction/compare/v2.1.1...v2.1.2
520
- [2.1.1]: https://github.com/orgsync/active_interaction/compare/v2.1.0...v2.1.1
521
- [2.1.0]: https://github.com/orgsync/active_interaction/compare/v2.0.1...v2.1.0
522
- [2.0.1]: https://github.com/orgsync/active_interaction/compare/v2.0.0...v2.0.1
523
- [2.0.0]: https://github.com/orgsync/active_interaction/compare/v1.6.0...v2.0.0
524
- [1.6.1]: https://github.com/orgsync/active_interaction/compare/v1.6.0...v1.6.1
525
- [1.6.0]: https://github.com/orgsync/active_interaction/compare/v1.5.1...v1.6.0
526
- [1.5.1]: https://github.com/orgsync/active_interaction/compare/v1.5.0...v1.5.1
527
- [1.5.0]: https://github.com/orgsync/active_interaction/compare/v1.4.1...v1.5.0
528
- [1.4.1]: https://github.com/orgsync/active_interaction/compare/v1.4.0...v1.4.1
529
- [1.4.0]: https://github.com/orgsync/active_interaction/compare/v1.3.1...v1.4.0
530
- [1.3.1]: https://github.com/orgsync/active_interaction/compare/v1.3.0...v1.3.1
531
- [1.3.0]: https://github.com/orgsync/active_interaction/compare/v1.2.5...v1.3.0
532
- [1.2.5]: https://github.com/orgsync/active_interaction/compare/v1.2.4...v1.2.5
533
- [1.2.4]: https://github.com/orgsync/active_interaction/compare/v1.2.3...v1.2.4
534
- [1.2.3]: https://github.com/orgsync/active_interaction/compare/v1.2.2...v1.2.3
535
- [1.2.2]: https://github.com/orgsync/active_interaction/compare/v1.2.1...v1.2.2
536
- [1.2.1]: https://github.com/orgsync/active_interaction/compare/v1.2.0...v1.2.1
537
- [1.2.0]: https://github.com/orgsync/active_interaction/compare/v1.1.7...v1.2.0
538
- [1.1.7]: https://github.com/orgsync/active_interaction/compare/v1.1.6...v1.1.7
539
- [1.1.6]: https://github.com/orgsync/active_interaction/compare/v1.1.5...v1.1.6
540
- [1.1.5]: https://github.com/orgsync/active_interaction/compare/v1.1.4...v1.1.5
541
- [1.1.4]: https://github.com/orgsync/active_interaction/compare/v1.1.3...v1.1.4
542
- [1.1.3]: https://github.com/orgsync/active_interaction/compare/v1.1.2...v1.1.3
543
- [1.1.2]: https://github.com/orgsync/active_interaction/compare/v1.1.1...v1.1.2
544
- [1.1.1]: https://github.com/orgsync/active_interaction/compare/v1.1.0...v1.1.1
545
- [1.1.0]: https://github.com/orgsync/active_interaction/compare/v1.0.5...v1.1.0
546
- [1.0.5]: https://github.com/orgsync/active_interaction/compare/v1.0.4...v1.0.5
547
- [1.0.4]: https://github.com/orgsync/active_interaction/compare/v1.0.3...v1.0.4
548
- [1.0.3]: https://github.com/orgsync/active_interaction/compare/v1.0.2...v1.0.3
549
- [1.0.2]: https://github.com/orgsync/active_interaction/compare/v1.0.1...v1.0.2
550
- [1.0.1]: https://github.com/orgsync/active_interaction/compare/v1.0.0...v1.0.1
551
- [1.0.0]: https://github.com/orgsync/active_interaction/compare/v0.10.2...v1.0.0
552
- [0.10.2]: https://github.com/orgsync/active_interaction/compare/v0.10.1...v0.10.2
553
- [0.10.1]: https://github.com/orgsync/active_interaction/compare/v0.10.0...v0.10.1
554
- [0.10.0]: https://github.com/orgsync/active_interaction/compare/v0.9.1...v0.10.0
555
- [0.9.1]: https://github.com/orgsync/active_interaction/compare/v0.9.0...v0.9.1
556
- [0.9.0]: https://github.com/orgsync/active_interaction/compare/v0.8.0...v0.9.0
557
- [0.8.0]: https://github.com/orgsync/active_interaction/compare/v0.7.0...v0.8.0
558
- [0.7.0]: https://github.com/orgsync/active_interaction/compare/v0.6.1...v0.7.0
559
- [0.6.1]: https://github.com/orgsync/active_interaction/compare/v0.6.0...v0.6.1
560
- [0.6.0]: https://github.com/orgsync/active_interaction/compare/v0.5.0...v0.6.0
561
- [0.5.0]: https://github.com/orgsync/active_interaction/compare/v0.4.0...v0.5.0
562
- [0.4.0]: https://github.com/orgsync/active_interaction/compare/v0.3.0...v0.4.0
563
- [0.3.0]: https://github.com/orgsync/active_interaction/compare/v0.2.2...v0.3.0
564
- [0.2.2]: https://github.com/orgsync/active_interaction/compare/v0.2.1...v0.2.2
565
- [0.2.1]: https://github.com/orgsync/active_interaction/compare/v0.2.0...v0.2.1
566
- [0.2.0]: https://github.com/orgsync/active_interaction/compare/v0.1.3...v0.2.0
567
- [0.1.3]: https://github.com/orgsync/active_interaction/compare/v0.1.2...v0.1.3
568
- [0.1.2]: https://github.com/orgsync/active_interaction/compare/v0.1.1...v0.1.2
569
- [0.1.1]: https://github.com/orgsync/active_interaction/compare/v0.1.0...v0.1.1
570
- [0.1.0]: https://github.com/orgsync/active_interaction/compare/v0.0.0...v0.1.0
571
-
572
- [#20]: https://github.com/orgsync/active_interaction/issues/20
573
- [#23]: https://github.com/orgsync/active_interaction/issues/23
574
- [#24]: https://github.com/orgsync/active_interaction/issues/24
575
- [#27]: https://github.com/orgsync/active_interaction/issues/27
576
- [#28]: https://github.com/orgsync/active_interaction/issues/28
577
- [#29]: https://github.com/orgsync/active_interaction/issues/29
578
- [#30]: https://github.com/orgsync/active_interaction/issues/30
579
- [#34]: https://github.com/orgsync/active_interaction/issues/34
580
- [#36]: https://github.com/orgsync/active_interaction/issues/36
581
- [#37]: https://github.com/orgsync/active_interaction/issues/37
582
- [#38]: https://github.com/orgsync/active_interaction/issues/38
583
- [#39]: https://github.com/orgsync/active_interaction/issues/39
584
- [#40]: https://github.com/orgsync/active_interaction/issues/40
585
- [#41]: https://github.com/orgsync/active_interaction/issues/41
586
- [#44]: https://github.com/orgsync/active_interaction/issues/44
587
- [#45]: https://github.com/orgsync/active_interaction/issues/45
588
- [#49]: https://github.com/orgsync/active_interaction/issues/49
589
- [#56]: https://github.com/orgsync/active_interaction/issues/56
590
- [#57]: https://github.com/orgsync/active_interaction/issues/57
591
- [#58]: https://github.com/orgsync/active_interaction/issues/58
592
- [#61]: https://github.com/orgsync/active_interaction/issues/61
593
- [#66]: https://github.com/orgsync/active_interaction/issues/66
594
- [#77]: https://github.com/orgsync/active_interaction/issues/77
595
- [#82]: https://github.com/orgsync/active_interaction/issues/82
596
- [#84]: https://github.com/orgsync/active_interaction/issues/84
597
- [#88]: https://github.com/orgsync/active_interaction/issues/88
598
- [#89]: https://github.com/orgsync/active_interaction/issues/89
599
- [#90]: https://github.com/orgsync/active_interaction/issues/90
600
- [#94]: https://github.com/orgsync/active_interaction/issues/94
601
- [#98]: https://github.com/orgsync/active_interaction/issues/98
602
- [#102]: https://github.com/orgsync/active_interaction/issues/102
603
- [#103]: https://github.com/orgsync/active_interaction/issues/103
604
- [#104]: https://github.com/orgsync/active_interaction/issues/104
605
- [#106]: https://github.com/orgsync/active_interaction/issues/106
606
- [#111]: https://github.com/orgsync/active_interaction/issues/111
607
- [#114]: https://github.com/orgsync/active_interaction/issues/114
608
- [#115]: https://github.com/orgsync/active_interaction/issues/115
609
- [#116]: https://github.com/orgsync/active_interaction/issues/116
610
- [#119]: https://github.com/orgsync/active_interaction/issues/119
611
- [#122]: https://github.com/orgsync/active_interaction/issues/122
612
- [#125]: https://github.com/orgsync/active_interaction/issues/125
613
- [#127]: https://github.com/orgsync/active_interaction/issues/127
614
- [#128]: https://github.com/orgsync/active_interaction/issues/128
615
- [#129]: https://github.com/orgsync/active_interaction/issues/129
616
- [#130]: https://github.com/orgsync/active_interaction/issues/130
617
- [#134]: https://github.com/orgsync/active_interaction/issues/134
618
- [#135]: https://github.com/orgsync/active_interaction/issues/135
619
- [#136]: https://github.com/orgsync/active_interaction/issues/136
620
- [#138]: https://github.com/orgsync/active_interaction/issues/138
621
- [#140]: https://github.com/orgsync/active_interaction/issues/140
622
- [#143]: https://github.com/orgsync/active_interaction/issues/143
623
- [#153]: https://github.com/orgsync/active_interaction/issues/153
624
- [#155]: https://github.com/orgsync/active_interaction/issues/155
625
- [#156]: https://github.com/orgsync/active_interaction/issues/156
626
- [#163]: https://github.com/orgsync/active_interaction/issues/163
627
- [#164]: https://github.com/orgsync/active_interaction/issues/164
628
- [#165]: https://github.com/orgsync/active_interaction/issues/165
629
- [#173]: https://github.com/orgsync/active_interaction/issues/173
630
- [#174]: https://github.com/orgsync/active_interaction/issues/174
631
- [#175]: https://github.com/orgsync/active_interaction/issues/175
632
- [#178]: https://github.com/orgsync/active_interaction/issues/178
633
- [#179]: https://github.com/orgsync/active_interaction/issues/179
634
- [#192]: https://github.com/orgsync/active_interaction/issues/192
635
- [#196]: https://github.com/orgsync/active_interaction/issues/196
636
- [#201]: https://github.com/orgsync/active_interaction/issues/201
637
- [#203]: https://github.com/orgsync/active_interaction/issues/203
638
- [#206]: https://github.com/orgsync/active_interaction/issues/206
639
- [#207]: https://github.com/orgsync/active_interaction/issues/207
640
- [#213]: https://github.com/orgsync/active_interaction/issues/213
641
- [#214]: https://github.com/orgsync/active_interaction/issues/214
642
- [#215]: https://github.com/orgsync/active_interaction/issues/215
643
- [#224]: https://github.com/orgsync/active_interaction/issues/224
644
- [#235]: https://github.com/orgsync/active_interaction/issues/235
645
- [#236]: https://github.com/orgsync/active_interaction/issues/236
646
- [#239]: https://github.com/orgsync/active_interaction/issues/239
647
- [#244]: https://github.com/orgsync/active_interaction/issues/244
648
- [#248]: https://github.com/orgsync/active_interaction/issues/248
649
- [#250]: https://github.com/orgsync/active_interaction/issues/250
650
- [#256]: https://github.com/orgsync/active_interaction/issues/256
651
- [#264]: https://github.com/orgsync/active_interaction/issues/264
652
- [#265]: https://github.com/orgsync/active_interaction/issues/265
653
- [#269]: https://github.com/orgsync/active_interaction/issues/269
654
- [#286]: https://github.com/orgsync/active_interaction/issues/286
655
- [#289]: https://github.com/orgsync/active_interaction/issues/289
656
- [#295]: https://github.com/orgsync/active_interaction/issues/295
657
- [#296]: https://github.com/orgsync/active_interaction/issues/296
658
- [#298]: https://github.com/orgsync/active_interaction/issues/298
659
- [#303]: https://github.com/orgsync/active_interaction/issues/303
660
- [#304]: https://github.com/orgsync/active_interaction/issues/304
661
- [#310]: https://github.com/orgsync/active_interaction/issues/310
662
- [#311]: https://github.com/orgsync/active_interaction/issues/311
663
- [#320]: https://github.com/orgsync/active_interaction/issues/320
664
- [#330]: https://github.com/orgsync/active_interaction/pull/330
665
- [#332]: https://github.com/orgsync/active_interaction/pull/332
666
- [#333]: https://github.com/orgsync/active_interaction/pull/333
667
- [#336]: https://github.com/orgsync/active_interaction/pull/336
668
- [#344]: https://github.com/orgsync/active_interaction/pull/344
669
- [#346]: https://github.com/orgsync/active_interaction/pull/346
670
- [#349]: https://github.com/orgsync/active_interaction/pull/349
671
-
672
- [the announcement post]: http://devblog.orgsync.com/2015/05/06/announcing-active-interaction-2/
6
+ [Semantic Versioning]: http://semver.org/spec/v2.0.0.html
7
+ [releases on GitHub]: https://github.com/orgsync/active_interaction/releases
data/README.md CHANGED
@@ -172,8 +172,8 @@ class SayHello < ActiveInteraction::Base
172
172
  end
173
173
  ```
174
174
 
175
- When you run this interaction, two things will happen. First ActiveInteraction
176
- will type check your inputs. Then ActiveModel will validate them. If both of
175
+ When you run this interaction, two things will happen. **First ActiveInteraction
176
+ will type check your inputs. Then ActiveModel will validate them.** If both of
177
177
  those are happy, it will be executed.
178
178
 
179
179
  ``` rb
@@ -95,7 +95,7 @@ module ActiveInteraction
95
95
  # @private
96
96
  def method_missing(*args, &block)
97
97
  super do |klass, names, options|
98
- fail InvalidFilterError, 'missing attribute name' if names.empty?
98
+ raise InvalidFilterError, 'missing attribute name' if names.empty?
99
99
 
100
100
  names.each { |name| add_filter(klass, name, options, &block) }
101
101
  end
@@ -107,7 +107,7 @@ module ActiveInteraction
107
107
  # @param name [Symbol]
108
108
  # @param options [Hash]
109
109
  def add_filter(klass, name, options, &block)
110
- fail InvalidFilterError, name.inspect if InputProcessor.reserved?(name)
110
+ raise InvalidFilterError, name.inspect if InputProcessor.reserved?(name)
111
111
 
112
112
  initialize_filter(klass.new(name, options, &block))
113
113
  end
@@ -167,7 +167,7 @@ module ActiveInteraction
167
167
  #
168
168
  # @private
169
169
  def initialize(inputs = {})
170
- fail ArgumentError, 'inputs must be a hash' unless inputs.is_a?(Hash)
170
+ raise ArgumentError, 'inputs must be a hash' unless inputs.is_a?(Hash)
171
171
 
172
172
  process_inputs(inputs.symbolize_keys)
173
173
  end
@@ -237,7 +237,7 @@ module ActiveInteraction
237
237
  @_interaction_keys = inputs.keys.to_set & self.class.filters.keys
238
238
 
239
239
  inputs.each do |key, value|
240
- fail InvalidValueError, key.inspect if InputProcessor.reserved?(key)
240
+ raise InvalidValueError, key.inspect if InputProcessor.reserved?(key)
241
241
 
242
242
  populate_reader(key, value)
243
243
  end
@@ -27,7 +27,7 @@ module ActiveInteraction
27
27
  #
28
28
  # @raise [NotImplementedError]
29
29
  def execute
30
- fail NotImplementedError
30
+ raise NotImplementedError
31
31
  end
32
32
 
33
33
  # @return [Object] If there are no validation errors.
@@ -95,7 +95,7 @@ module ActiveInteraction
95
95
  if valid?
96
96
  result
97
97
  else
98
- fail InvalidInteractionError, errors.full_messages.join(', ')
98
+ raise InvalidInteractionError, errors.full_messages.join(', ')
99
99
  end
100
100
  end
101
101
 
@@ -49,7 +49,7 @@ module ActiveInteraction
49
49
  #
50
50
  # @see .slug
51
51
  def factory(slug)
52
- CLASSES.fetch(slug) { fail MissingFilterError, slug.inspect }
52
+ CLASSES.fetch(slug) { raise MissingFilterError, slug.inspect }
53
53
  end
54
54
 
55
55
  private
@@ -125,10 +125,10 @@ module ActiveInteraction
125
125
  # @raise [NoDefaultError] If the default is missing.
126
126
  # @raise [InvalidDefaultError] If the default is invalid.
127
127
  def default(context = nil)
128
- fail NoDefaultError, name unless default?
128
+ raise NoDefaultError, name unless default?
129
129
 
130
130
  value = raw_default(context)
131
- fail InvalidValueError if value.is_a?(GroupedInput)
131
+ raise InvalidValueError if value.is_a?(GroupedInput)
132
132
 
133
133
  cast(value, context)
134
134
  rescue InvalidNestedValueError => error
@@ -175,11 +175,11 @@ module ActiveInteraction
175
175
  def cast(value, _interaction)
176
176
  case value
177
177
  when NilClass
178
- fail MissingValueError, name unless default?
178
+ raise MissingValueError, name unless default?
179
179
 
180
180
  nil
181
181
  else
182
- fail InvalidValueError, "#{name}: #{describe(value)}"
182
+ raise InvalidValueError, "#{name}: #{describe(value)}"
183
183
  end
184
184
  end
185
185
 
@@ -215,11 +215,11 @@ module ActiveInteraction
215
215
  # @return [Object]
216
216
  def raw_default(context)
217
217
  value = options.fetch(:default)
218
+ return value unless value.is_a?(Proc)
218
219
 
219
- if value.is_a?(Proc)
220
- context.instance_exec(&value)
221
- else
222
- value
220
+ case value.arity
221
+ when 1 then context.instance_exec(self, &value)
222
+ else context.instance_exec(&value)
223
223
  end
224
224
  end
225
225
  end
@@ -36,7 +36,7 @@ module ActiveInteraction
36
36
  klass.strptime(value, format)
37
37
  else
38
38
  klass.parse(value) ||
39
- (fail ArgumentError, "no time information in #{value.inspect}")
39
+ (raise ArgumentError, "no time information in #{value.inspect}")
40
40
  end
41
41
  rescue ArgumentError
42
42
  _cast(value, context)
@@ -73,15 +73,15 @@ module ActiveInteraction
73
73
  # @raise [InvalidFilterError]
74
74
  def validate!(filter, names)
75
75
  unless filters.empty?
76
- fail InvalidFilterError, 'multiple filters in array block'
76
+ raise InvalidFilterError, 'multiple filters in array block'
77
77
  end
78
78
 
79
79
  unless names.empty?
80
- fail InvalidFilterError, 'attribute names in array block'
80
+ raise InvalidFilterError, 'attribute names in array block'
81
81
  end
82
82
 
83
83
  if filter.default?
84
- fail InvalidDefaultError, 'default values in array block'
84
+ raise InvalidDefaultError, 'default values in array block'
85
85
  end
86
86
 
87
87
  nil
@@ -42,7 +42,7 @@ module ActiveInteraction
42
42
 
43
43
  def method_missing(*args, &block)
44
44
  super(*args) do |klass, names, options|
45
- fail InvalidFilterError, 'missing attribute name' if names.empty?
45
+ raise InvalidFilterError, 'missing attribute name' if names.empty?
46
46
 
47
47
  names.each do |name|
48
48
  filters[name] = klass.new(name, options, &block)
@@ -62,7 +62,7 @@ module ActiveInteraction
62
62
  value = super
63
63
 
64
64
  if value.is_a?(Hash) && !value.empty?
65
- fail InvalidDefaultError, "#{name}: #{value.inspect}"
65
+ raise InvalidDefaultError, "#{name}: #{value.inspect}"
66
66
  end
67
67
 
68
68
  value
@@ -29,7 +29,7 @@ module ActiveInteraction
29
29
 
30
30
  def initialize(name, options = {}, &block)
31
31
  if options.key?(:format) && klass != Time
32
- fail InvalidFilterError, 'format option unsupported with time zones'
32
+ raise InvalidFilterError, 'format option unsupported with time zones'
33
33
  end
34
34
 
35
35
  super
@@ -18,7 +18,7 @@ module ActiveInteraction
18
18
 
19
19
  def process(inputs)
20
20
  inputs.stringify_keys.sort.each_with_object({}) do |(k, v), h|
21
- fail ReservedNameError, k.inspect if reserved?(k)
21
+ raise ReservedNameError, k.inspect if reserved?(k)
22
22
 
23
23
  if (match = GROUPED_INPUT_PATTERN.match(k))
24
24
  assign_to_group!(h, *match.captures, v)
@@ -6,5 +6,5 @@ module ActiveInteraction
6
6
  # The version number.
7
7
  #
8
8
  # @return [Gem::Version]
9
- VERSION = Gem::Version.new('3.0.1')
9
+ VERSION = Gem::Version.new('3.1.0')
10
10
  end
@@ -166,6 +166,23 @@ shared_examples_for 'a filter' do
166
166
  expect(filter.default(nil)).to eql options[:default].call
167
167
  end
168
168
  end
169
+
170
+ context 'with a callable default that takes an argument' do
171
+ include_context 'optional'
172
+
173
+ it 'returns the default' do
174
+ default = options[:default]
175
+
176
+ spec = self
177
+ filter # Necessary to bring into scope for lambda.
178
+ options[:default] = lambda do |this|
179
+ spec.expect(this).to be filter
180
+ default
181
+ end
182
+
183
+ expect(filter.default(nil)).to be default
184
+ end
185
+ end
169
186
  end
170
187
 
171
188
  describe '#desc' do
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: 3.0.1
4
+ version: 3.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aaron Lasseigne
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-01-15 00:00:00.000000000 Z
12
+ date: 2016-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activemodel
@@ -135,14 +135,14 @@ dependencies:
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '10.4'
138
+ version: '11.1'
139
139
  type: :development
140
140
  prerelease: false
141
141
  version_requirements: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '10.4'
145
+ version: '11.1'
146
146
  - !ruby/object:Gem::Dependency
147
147
  name: rspec
148
148
  requirement: !ruby/object:Gem::Requirement
@@ -163,14 +163,14 @@ dependencies:
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 0.36.0
166
+ version: 0.39.0
167
167
  type: :development
168
168
  prerelease: false
169
169
  version_requirements: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 0.36.0
173
+ version: 0.39.0
174
174
  - !ruby/object:Gem::Dependency
175
175
  name: yard
176
176
  requirement: !ruby/object:Gem::Requirement
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
300
300
  version: '0'
301
301
  requirements: []
302
302
  rubyforge_project:
303
- rubygems_version: 2.5.1
303
+ rubygems_version: 2.6.0
304
304
  signing_key:
305
305
  specification_version: 4
306
306
  summary: Manage application specific business logic.