metaractor 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/metaractor/context_errors.rb +23 -8
- data/lib/metaractor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc495c71ac16ac1b8a355d83849f7f27b9980acb4f7fb36cf8da50773e73c4fc
|
4
|
+
data.tar.gz: 015a5f2abe0b5d1bd62ae5e685ec509f8b46ad29e4d2fa3dd5e9d98aae4db461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 781c25b93c7b3cc8c645218ba0f7971389d86a1129ad1a62bd9930eb28b6a3413736917135c3bc6e8b4e803a7ad1664e12f7dfc6d133fa4c325e25696de75e36
|
7
|
+
data.tar.gz: fbbb9d96afed276d4a187255745b069dd7a18001e351934724d1b9122807300a844839ddee43112e74691b7ef314745de14b70b248d835ca31d3cdee20015908
|
data/README.md
CHANGED
@@ -101,13 +101,13 @@ For more examples of all of the above approaches, please see the specs.
|
|
101
101
|
|
102
102
|
## Development
|
103
103
|
|
104
|
-
- `docker build
|
105
|
-
- `docker run
|
104
|
+
- `docker-compose build --pull`
|
105
|
+
- `docker-compose run --rm metaractor` to run specs
|
106
106
|
|
107
107
|
To release a new version:
|
108
108
|
- Update the version number in `version.rb` and commit the result.
|
109
|
-
- `docker build
|
110
|
-
- `docker run
|
109
|
+
- `docker-compose build --pull`
|
110
|
+
- `docker-compose run --rm release`
|
111
111
|
|
112
112
|
## Contributing
|
113
113
|
|
@@ -8,26 +8,41 @@ module Metaractor
|
|
8
8
|
super
|
9
9
|
end
|
10
10
|
|
11
|
-
def fail_with_error!(message:)
|
12
|
-
add_error(message: message)
|
11
|
+
def fail_with_error!(message: nil, **args)
|
12
|
+
add_error(message: message, **args)
|
13
13
|
fail!
|
14
14
|
end
|
15
15
|
|
16
|
-
def fail_with_errors!(messages:)
|
17
|
-
add_errors(messages: messages)
|
16
|
+
def fail_with_errors!(messages: [], errors: [])
|
17
|
+
add_errors(messages: messages, errors: errors)
|
18
18
|
fail!
|
19
19
|
end
|
20
20
|
|
21
|
-
def add_error(message:)
|
22
|
-
|
21
|
+
def add_error(message: nil, **args)
|
22
|
+
if message.nil?
|
23
|
+
add_errors(errors: [**args])
|
24
|
+
else
|
25
|
+
add_errors(messages: Array(message))
|
26
|
+
end
|
23
27
|
end
|
24
28
|
|
25
|
-
def add_errors(messages:)
|
29
|
+
def add_errors(messages: [], errors: [])
|
26
30
|
self.errors += messages
|
31
|
+
self.errors += errors
|
27
32
|
end
|
28
33
|
|
29
34
|
def error_messages
|
30
|
-
errors.
|
35
|
+
errors.map do |error|
|
36
|
+
if error.respond_to?(:has_key?) && error.has_key?(:title)
|
37
|
+
if error[:source] != nil
|
38
|
+
"#{error[:source]}: #{error[:title]}"
|
39
|
+
else
|
40
|
+
error[:title].to_s
|
41
|
+
end
|
42
|
+
else
|
43
|
+
error.to_s
|
44
|
+
end
|
45
|
+
end.join("\n")
|
31
46
|
end
|
32
47
|
end
|
33
48
|
end
|
data/lib/metaractor/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metaractor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Schlesinger
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10
|
11
|
+
date: 2018-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: interactor
|