g2_command 0.3.0 → 0.4.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/command.rb +3 -2
- data/lib/command/failure.rb +12 -0
- data/lib/command/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 795f881d90230226f9ddb662080b9d8586474a3e42261129491c3c0b65f7e659
|
4
|
+
data.tar.gz: ca5199ed96e14da877e03fc026b3afd6dc503f2aeddd7c3111164f1d46c5b1c7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d2f46c2cf70d1e008cc17ea2d0d7c2bc2dbdd22db0dbac5169b1f701a1e8da848c8c65c9e5bc357ea714bb1195713ae310be39a580508d0acb3998fa3cbfd7c
|
7
|
+
data.tar.gz: 3dfe50a69b515562937438cdb87c689a2bff3c5f2e0151a73530492385f9c4eab3bc7fc238cf0ac5581ebb4b2199c4e3d700d618dbb680cd4c8c7b7222e5b32d
|
data/Gemfile.lock
CHANGED
data/lib/command.rb
CHANGED
@@ -5,6 +5,7 @@ require 'active_model'
|
|
5
5
|
require 'dry-initializer'
|
6
6
|
require 'dry-monads'
|
7
7
|
|
8
|
+
require 'command/failure'
|
8
9
|
require 'command/input_middleware'
|
9
10
|
require 'command/interrupt'
|
10
11
|
|
@@ -34,13 +35,13 @@ module Command
|
|
34
35
|
end
|
35
36
|
end
|
36
37
|
|
37
|
-
errors.empty? ? Success(result) : Failure(errors)
|
38
|
+
errors.empty? ? Success(result) : Failure(Command::Failure.new(result, errors))
|
38
39
|
end
|
39
40
|
|
40
41
|
def compose(command, *args)
|
41
42
|
outcome = command.run(*args)
|
42
43
|
|
43
|
-
raise Command::Interrupt, outcome.failure if outcome.failure?
|
44
|
+
raise Command::Interrupt, outcome.failure.errors if outcome.failure?
|
44
45
|
|
45
46
|
outcome.value!
|
46
47
|
end
|
data/lib/command/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: g2_command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hamed Asghari
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- bin/setup
|
101
101
|
- g2_command.gemspec
|
102
102
|
- lib/command.rb
|
103
|
+
- lib/command/failure.rb
|
103
104
|
- lib/command/input_middleware.rb
|
104
105
|
- lib/command/input_middleware/rails_params.rb
|
105
106
|
- lib/command/input_middleware/symbolizer.rb
|