@@ -10,6 +10,37 @@ Interactify wraps the interactor and interactor-contracts gem and provides addit
10
10
This is a bells and whistles gem and assumes you are working in a Rails project with Sidekiq.
11
11
However, I'm open to the idea of making it more focused and making these more pluggable.
12
12
13
+ ## Installation
14
+
15
+ ``` Gemfile
16
+ gem 'interactify'
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### Initializer
22
+ ```
23
+ # in config/initializers/interactify.rb
24
+ Interactify.configure do |config|
25
+ # default
26
+ # config.root = Rails.root / 'app'
27
+ end
28
+
29
+ Interactify.on_contract_breach do |context, attrs|
30
+ # maybe add context to Sentry or Honeybadger etc here
31
+ end
32
+
33
+ Interactify.before_raise do |exception|
34
+ # maybe add context to Sentry or Honeybadger etc here
35
+ end
36
+ ```
37
+
38
+ ### Using the RSpec matchers
39
+ ``` ruby
40
+ # e.g. in spec/supoort/interactify.rb
41
+ require ' interactify/rspec/matchers'
42
+ ```
43
+
13
44
### Syntactic Sugar
14
45
- Everything is an Organizer/Interactor and supports interactor-contracts.
15
46
- Concise syntax for most common scenarios with ` expects ` and ` promises ` . Verifying the presence of the keys/values.
@@ -395,30 +426,6 @@ organize \
395
426
396
427
This will be validated at test time against the interactors promises.
397
428
398
- ## Installation
399
-
400
- ``` Gemfile
401
- gem 'interactify'
402
- ```
403
-
404
- ## Usage
405
-
406
- ``` ruby
407
- # e.g. in spec/supoort/interactify.rb
408
- require ' interactify/rspec/matchers'
409
-
410
- Interactify .configure do |config |
411
- config.root = Rails .root ' /app'
412
- end
413
-
414
- Interactify .on_contract_breach do |context , attrs |
415
- # maybe add context to Sentry or Honeybadger etc here
416
- end
417
-
418
- Interactify .before_raise do |exception |
419
- # maybe add context to Sentry or Honeybadger etc here
420
- end
421
- ```
422
429
423
430
## Development
424
431
0 commit comments