spicerack 0.20.4 → 0.21.0

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
  SHA256:
3
- metadata.gz: ae50512ce8b956c8f5078a78c5c0c836702038315b38219ab6b4e2604eb6bc9f
4
- data.tar.gz: cd473a9eaaa920d5cb3f2fd65d2c5aaf351b8159c408c5765faa8a89f4593828
3
+ metadata.gz: b82da445e51f86bcd96b4731bd3efeb9a4b40464a065d54c817f9c71771da121
4
+ data.tar.gz: '0797642aa3bd51c69ab9194a7998ace4ac03727aa332d6ebdb335f4eae811df0'
5
5
  SHA512:
6
- metadata.gz: ac9b7820808d83bc5d2efe38c3d5beae002bfdd4ea896abc0fcf31de87c0b3a6807d22686066c61715f33bc36b3607dd64c9a764c1cec2050fde28f193470fb1
7
- data.tar.gz: 9dd784996210945197147da2d659bcab77f301c9658592e1b35e7a8c8c5133d657801f09f72da01fa8a22a1b79a3f712bd04631c2b7d4b35b250d037b5aa169b
6
+ metadata.gz: 227f2dab6ac34ee78daf9e0bef7d4cbb8807d7452603d58b743e85198ebe2f187e8709bc695195359dc77580a6ccccc7cb344088eae5b50ae33f49a7090ce89b
7
+ data.tar.gz: 834d0d355fe257192f1ea7c28d45cf5f04618c00fd7f61414eedb06297e41a72e9c4970c57350e06e70ace4c9c6e9f2c544df39eab7400a962920842f602e1ca
data/lib/spicerack.rb CHANGED
@@ -22,6 +22,9 @@ require "spicerack/attribute_object"
22
22
  require "spicerack/input_object"
23
23
  require "spicerack/input_model"
24
24
  require "spicerack/configurable"
25
- require "spicerack/stateful_object"
25
+ require "spicerack/output_object"
26
26
 
27
- module Spicerack; end
27
+ module Spicerack
28
+ class Error < StandardError; end
29
+ class NotValidatedError < Error; end
30
+ end
@@ -37,7 +37,7 @@ module Spicerack
37
37
 
38
38
  def ensure_validation_before(method)
39
39
  around_method method do |*arguments|
40
- raise Flow::State::Errors::NotValidated unless validated?
40
+ raise NotValidatedError unless validated?
41
41
 
42
42
  super(*arguments)
43
43
  end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spicerack
4
+ module Objects
5
+ module Status
6
+ extend ActiveSupport::Concern
7
+
8
+ included do
9
+ after_validation { self.was_validated = errors.empty? }
10
+
11
+ private
12
+
13
+ attr_accessor :was_validated
14
+ end
15
+
16
+ def validated?
17
+ was_validated.present?
18
+ end
19
+ end
20
+ end
21
+ end
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative "objects/status"
3
4
  require_relative "objects/output"
4
5
 
5
6
  module Spicerack
6
- class StatefulObject < InputModel
7
+ class OutputObject < InputModel
8
+ include Objects::Status
7
9
  include Objects::Output
8
10
  end
9
11
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module Spicerack
4
4
  # This constant is managed by spicerack
5
- VERSION = "0.20.4"
5
+ VERSION = "0.21.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spicerack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.20.4
4
+ version: 0.21.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Garside
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-01-08 00:00:00.000000000 Z
14
+ date: 2020-01-13 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: around_the_world
@@ -19,70 +19,70 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 0.20.4
22
+ version: 0.21.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 0.20.4
29
+ version: 0.21.0
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: redis_hash
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '='
35
35
  - !ruby/object:Gem::Version
36
- version: 0.20.4
36
+ version: 0.21.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
41
  - - '='
42
42
  - !ruby/object:Gem::Version
43
- version: 0.20.4
43
+ version: 0.21.0
44
44
  - !ruby/object:Gem::Dependency
45
45
  name: short_circu_it
46
46
  requirement: !ruby/object:Gem::Requirement
47
47
  requirements:
48
48
  - - '='
49
49
  - !ruby/object:Gem::Version
50
- version: 0.20.4
50
+ version: 0.21.0
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
54
54
  requirements:
55
55
  - - '='
56
56
  - !ruby/object:Gem::Version
57
- version: 0.20.4
57
+ version: 0.21.0
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: technologic
60
60
  requirement: !ruby/object:Gem::Requirement
61
61
  requirements:
62
62
  - - '='
63
63
  - !ruby/object:Gem::Version
64
- version: 0.20.4
64
+ version: 0.21.0
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - '='
70
70
  - !ruby/object:Gem::Version
71
- version: 0.20.4
71
+ version: 0.21.0
72
72
  - !ruby/object:Gem::Dependency
73
73
  name: tablesalt
74
74
  requirement: !ruby/object:Gem::Requirement
75
75
  requirements:
76
76
  - - '='
77
77
  - !ruby/object:Gem::Version
78
- version: 0.20.4
78
+ version: 0.21.0
79
79
  type: :runtime
80
80
  prerelease: false
81
81
  version_requirements: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - '='
84
84
  - !ruby/object:Gem::Version
85
- version: 0.20.4
85
+ version: 0.21.0
86
86
  - !ruby/object:Gem::Dependency
87
87
  name: bundler
88
88
  requirement: !ruby/object:Gem::Requirement
@@ -207,28 +207,28 @@ dependencies:
207
207
  requirements:
208
208
  - - '='
209
209
  - !ruby/object:Gem::Version
210
- version: 0.20.4
210
+ version: 0.21.0
211
211
  type: :development
212
212
  prerelease: false
213
213
  version_requirements: !ruby/object:Gem::Requirement
214
214
  requirements:
215
215
  - - '='
216
216
  - !ruby/object:Gem::Version
217
- version: 0.20.4
217
+ version: 0.21.0
218
218
  - !ruby/object:Gem::Dependency
219
219
  name: spicerack-styleguide
220
220
  requirement: !ruby/object:Gem::Requirement
221
221
  requirements:
222
222
  - - '='
223
223
  - !ruby/object:Gem::Version
224
- version: 0.20.4
224
+ version: 0.21.0
225
225
  type: :development
226
226
  prerelease: false
227
227
  version_requirements: !ruby/object:Gem::Requirement
228
228
  requirements:
229
229
  - - '='
230
230
  - !ruby/object:Gem::Version
231
- version: 0.20.4
231
+ version: 0.21.0
232
232
  - !ruby/object:Gem::Dependency
233
233
  name: will_paginate
234
234
  requirement: !ruby/object:Gem::Requirement
@@ -308,6 +308,8 @@ files:
308
308
  - lib/spicerack/objects/defaults.rb
309
309
  - lib/spicerack/objects/options.rb
310
310
  - lib/spicerack/objects/output.rb
311
+ - lib/spicerack/objects/status.rb
312
+ - lib/spicerack/output_object.rb
311
313
  - lib/spicerack/redis_model.rb
312
314
  - lib/spicerack/root_object.rb
313
315
  - lib/spicerack/rspec/configurable/dsl.rb
@@ -324,7 +326,6 @@ files:
324
326
  - lib/spicerack/rspec/shared_examples/an_input_object_with_a_class_collection_attribute.rb
325
327
  - lib/spicerack/rspec/shoulda_matcher_helper.rb
326
328
  - lib/spicerack/spec_helper.rb
327
- - lib/spicerack/stateful_object.rb
328
329
  - lib/spicerack/version.rb
329
330
  homepage: https://github.com/Freshly/spicerack
330
331
  licenses: