better_interactor 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/.forgejo/workflows/main.yml +14 -0
- data/.forgejo/workflows/publish.yml +36 -0
- data/.forgejo/workflows/test.yml +29 -0
- data/README.md +10 -3
- data/lib/better_interactor/version.rb +1 -1
- metadata +10 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 639eafdbe3f21672f1954622cea7d47d3fc046d1b5b9d2297eb8a22aa1ab96ab
|
|
4
|
+
data.tar.gz: e1342b3ce0729c2509129a6131bde95e77009c6bd5044780b11b4859a8431b4e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 335ad144b4c44b45ffbb570ed133d88a376b95d1eac91d92e99885b56f9fc28e4a6604887c5e3c516d7566cdd1165f4e8a2c91c7189388743e4c1834f44c00a2
|
|
7
|
+
data.tar.gz: abddf86851b23555df4e78bf4579decfc14cdcca6ee0b3230daa75e5cde646af2f4670be863f176d2a8b19f8bf00413339160dd0ae6b757627a06aed74df1d6f
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
name: Publish to RubyGems
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
#tags:
|
|
8
|
+
# - 'v*'
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
publish:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: https://github.com/actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Ruby
|
|
17
|
+
uses: https://github.com/ruby/setup-ruby@v1
|
|
18
|
+
with:
|
|
19
|
+
ruby-version: '3.2'
|
|
20
|
+
bundler-cache: true
|
|
21
|
+
|
|
22
|
+
- name: Build and Publish to RubyGems
|
|
23
|
+
env:
|
|
24
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
25
|
+
run: |
|
|
26
|
+
mkdir -p $HOME/.gem
|
|
27
|
+
touch $HOME/.gem/credentials
|
|
28
|
+
chmod 0600 $HOME/.gem/credentials
|
|
29
|
+
|
|
30
|
+
cat <<EOF > $HOME/.gem/credentials
|
|
31
|
+
---
|
|
32
|
+
:rubygems_api_key: ${GEM_HOST_API_KEY}
|
|
33
|
+
EOF
|
|
34
|
+
|
|
35
|
+
gem build *.gemspec
|
|
36
|
+
gem push *.gem
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Test Ruby
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
|
|
8
|
+
pull_request:
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
name: Ruby ${{ matrix.ruby }}
|
|
14
|
+
strategy:
|
|
15
|
+
matrix:
|
|
16
|
+
ruby:
|
|
17
|
+
- '3.2.0'
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- uses: https://github.com/actions/checkout@v4
|
|
21
|
+
with:
|
|
22
|
+
persist-credentials: false
|
|
23
|
+
- name: Set up Ruby
|
|
24
|
+
uses: https://github.com/ruby/setup-ruby@v1
|
|
25
|
+
with:
|
|
26
|
+
ruby-version: ${{ matrix.ruby }}
|
|
27
|
+
bundler-cache: true
|
|
28
|
+
- name: Run Tests
|
|
29
|
+
run: bundle exec rspec
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Better Interactor is a gem that aims to extend the default usage for the [Intera
|
|
|
4
4
|
|
|
5
5
|
- adding a condition to your interactors, in the organizer, to skip its call, if that returns false
|
|
6
6
|
- defining a default condition for each interactor call, in the organizer
|
|
7
|
-
-
|
|
7
|
+
- defining a method inside the organizer and call that instead of an organizer
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
@@ -24,7 +24,7 @@ gem install better_interactor
|
|
|
24
24
|
|
|
25
25
|
### Conditional Call
|
|
26
26
|
|
|
27
|
-
passing an hash instead of
|
|
27
|
+
passing an hash instead of an interactor allows you to define 2 keys inside of it:
|
|
28
28
|
|
|
29
29
|
- class: with the interactor class name
|
|
30
30
|
- if: with a symbol with the same name as the method that responds to our condition
|
|
@@ -74,7 +74,7 @@ In this example:
|
|
|
74
74
|
- ChargeCard will always be called, because there's no method named **can_charge_card?**
|
|
75
75
|
- SendThankYou will be called only if the method **can_send_thank_you?**, with the passed context, returns true
|
|
76
76
|
|
|
77
|
-
**In case of Interactors inside of Modules (Client::
|
|
77
|
+
**In case of Interactors inside of Modules (Client::SendThankYou) the modules are included inside the method name (can_client_send_thank_you?)**
|
|
78
78
|
|
|
79
79
|
### Interactor-like method
|
|
80
80
|
|
|
@@ -110,6 +110,13 @@ Clone this repo, run bundle and you are good to go.
|
|
|
110
110
|
|
|
111
111
|
Bug reports and pull requests are welcome on GitHub at https://github.com/gimbardo/better_interactor.
|
|
112
112
|
|
|
113
|
+
To contribute:
|
|
114
|
+
|
|
115
|
+
1. Fork the project.
|
|
116
|
+
2. Write a failing test.
|
|
117
|
+
3. Commit changes that fix the tests.
|
|
118
|
+
5. Be patient.
|
|
119
|
+
|
|
113
120
|
## License
|
|
114
121
|
|
|
115
122
|
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
metadata
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: better_interactor
|
|
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
|
- Gamberi Elia
|
|
8
|
+
autorequire:
|
|
8
9
|
bindir: exe
|
|
9
10
|
cert_chain: []
|
|
10
|
-
date:
|
|
11
|
+
date: 2026-01-14 00:00:00.000000000 Z
|
|
11
12
|
dependencies:
|
|
12
13
|
- !ruby/object:Gem::Dependency
|
|
13
14
|
name: interactor-rails
|
|
@@ -37,12 +38,16 @@ dependencies:
|
|
|
37
38
|
- - ">="
|
|
38
39
|
- !ruby/object:Gem::Version
|
|
39
40
|
version: '6.0'
|
|
41
|
+
description:
|
|
40
42
|
email:
|
|
41
43
|
- me@gimbaro.dev
|
|
42
44
|
executables: []
|
|
43
45
|
extensions: []
|
|
44
46
|
extra_rdoc_files: []
|
|
45
47
|
files:
|
|
48
|
+
- ".forgejo/workflows/main.yml"
|
|
49
|
+
- ".forgejo/workflows/publish.yml"
|
|
50
|
+
- ".forgejo/workflows/test.yml"
|
|
46
51
|
- LICENSE.txt
|
|
47
52
|
- README.md
|
|
48
53
|
- Rakefile
|
|
@@ -57,6 +62,7 @@ metadata:
|
|
|
57
62
|
allowed_push_host: https://rubygems.org/
|
|
58
63
|
homepage_uri: https://gimbaro.dev
|
|
59
64
|
source_code_uri: https://github.com/Gimbardo/better_interactor
|
|
65
|
+
post_install_message:
|
|
60
66
|
rdoc_options: []
|
|
61
67
|
require_paths:
|
|
62
68
|
- lib
|
|
@@ -71,7 +77,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
71
77
|
- !ruby/object:Gem::Version
|
|
72
78
|
version: '0'
|
|
73
79
|
requirements: []
|
|
74
|
-
rubygems_version: 3.
|
|
80
|
+
rubygems_version: 3.4.19
|
|
81
|
+
signing_key:
|
|
75
82
|
specification_version: 4
|
|
76
83
|
summary: Better Interactor is a small gem that aims to improve a lot of stuff that
|
|
77
84
|
is missing in the main interactor gem
|