easy_command 1.0.0 → 1.0.1
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/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +8 -0
- data/README.md +33 -37
- data/lib/easy_command/spec_helpers/mock_command_helper.rb +3 -3
- data/lib/easy_command/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: 0b45f334c0c48dfc490d81c9000ab136aa0fa088b533a7a86be8158a8256c869
|
4
|
+
data.tar.gz: 960fc70115c7b808907afd19d1351071d4e80a5f4bc2257983596b950daef2ef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 49ac077ef6479ec840f616c7490558d42e9c7d2542216cd3af21c77bdbb6db00aba5d09cce90d36d9f6723440894b385269a3b84755c0ecf22c49152e61c0f53
|
7
|
+
data.tar.gz: f4a57dcdd044e6ce596e8eabf9b7fbdf55a63b267a0332ceb0ca24dfe532effa339e7961742e3387ad7e411b7513c66c6bc9ac4c9e8ff05667a5b3fefdde40d9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.0.1](https://github.com/Swile/easy_command/compare/v1.0.0...v1.0.1) (2024-08-07)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* Refresh Table of Contents ([25f496f](https://github.com/Swile/easy_command/commit/25f496f91266f1b70c372a6e75c66e4dcfdcfb31))
|
9
|
+
* rename last uses of `Command` into `EasyCommand` ([#22](https://github.com/Swile/easy_command/issues/22)) ([d7ec6ff](https://github.com/Swile/easy_command/commit/d7ec6ffad0014c6514dda76d189120c3df38238d))
|
10
|
+
|
3
11
|
## [1.0.0](https://github.com/Swile/easy_command/compare/v1.0.0-rc3...v1.0.0) (2024-06-20)
|
4
12
|
|
5
13
|
|
data/README.md
CHANGED
@@ -5,42 +5,38 @@ A simple, standardized way to build and use _Service Objects_ in Ruby.
|
|
5
5
|
Table of Contents
|
6
6
|
=================
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
- [Usage](#usage-2)
|
41
|
-
|
42
|
-
|
43
|
-
Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)
|
8
|
+
* [Requirements](#requirements)
|
9
|
+
* [Installation](#installation)
|
10
|
+
* [Contributing](#contributing)
|
11
|
+
* [Publication](#publication)
|
12
|
+
* [Automated](#automated)
|
13
|
+
* [Usage](#usage)
|
14
|
+
* [Returned objects](#returned-objects)
|
15
|
+
* [Subcommand](#subcommand)
|
16
|
+
* [Command chaining](#command-chaining)
|
17
|
+
* [Flow success callbacks](#flow-success-callbacks)
|
18
|
+
* [Merge errors from ActiveRecord instance](#merge-errors-from-activerecord-instance)
|
19
|
+
* [Stopping execution of the command](#stopping-execution-of-the-command)
|
20
|
+
* [abort](#abort)
|
21
|
+
* [assert](#assert)
|
22
|
+
* [ExitError](#exiterror)
|
23
|
+
* [Callback](#callback)
|
24
|
+
* [#on_success](#on_success)
|
25
|
+
* [Error message](#error-message)
|
26
|
+
* [Default scope](#default-scope)
|
27
|
+
* [Example](#example)
|
28
|
+
* [Test with Rspec](#test-with-rspec)
|
29
|
+
* [Mock](#mock)
|
30
|
+
* [Setup](#setup)
|
31
|
+
* [Usage](#usage-1)
|
32
|
+
* [Matchers](#matchers)
|
33
|
+
* [Setup](#setup-1)
|
34
|
+
* [Rails project](#rails-project)
|
35
|
+
* [Usage](#usage-2)
|
36
|
+
* [Using as Command](#using-as-command)
|
37
|
+
* [Acknowledgements](#acknowledgements)
|
38
|
+
|
39
|
+
<!-- Created by https://github.com/ekalinin/github-markdown-toc -->
|
44
40
|
|
45
41
|
# Requirements
|
46
42
|
|
@@ -769,4 +765,4 @@ We also thank all the contributors at Swile that took part in the internal devel
|
|
769
765
|
- Julien Bouyoud
|
770
766
|
- Didier Bernaudeau
|
771
767
|
- Charles Duporge
|
772
|
-
- D'alberto
|
768
|
+
- Pierre-Julien D'alberto
|
@@ -31,7 +31,7 @@ module EasyCommand
|
|
31
31
|
klass = Object.const_get('FakeCommandErrors')
|
32
32
|
else
|
33
33
|
klass = Object.const_set 'FakeCommandErrors', Class.new
|
34
|
-
klass.prepend
|
34
|
+
klass.prepend EasyCommand
|
35
35
|
end
|
36
36
|
fake_command = klass.new
|
37
37
|
if errors.any?
|
@@ -46,9 +46,9 @@ module EasyCommand
|
|
46
46
|
allow(double).to receive(:errors).and_return(fake_command.errors)
|
47
47
|
monad =
|
48
48
|
if success
|
49
|
-
|
49
|
+
EasyCommand::Success.new(result)
|
50
50
|
else
|
51
|
-
|
51
|
+
EasyCommand::Failure.new(result).with_errors(fake_command.errors)
|
52
52
|
end
|
53
53
|
allow(double).to receive(:call).and_return(monad)
|
54
54
|
allow(double).to receive(:on_success).and_return(double)
|
data/lib/easy_command/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: easy_command
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Swile
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|