interactor-extended 0.1.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.
Files changed (66) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +2 -0
  3. data/.rubocop.yml +28 -0
  4. data/CHANGELOG.md +5 -0
  5. data/CODE_OF_CONDUCT.md +84 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +86 -0
  8. data/Rakefile +12 -0
  9. data/VERSION +1 -0
  10. data/docs/colorize.md +22 -0
  11. data/docs/configuration.md +63 -0
  12. data/docs/context_definition.md +21 -0
  13. data/docs/duration.md +37 -0
  14. data/docs/flow.md +25 -0
  15. data/docs/jobify.md +38 -0
  16. data/docs/light_context.md +24 -0
  17. data/docs/light_context_definition.md +19 -0
  18. data/docs/loggable.md +17 -0
  19. data/docs/operation.md +34 -0
  20. data/docs/organize.md +20 -0
  21. data/docs/populate.md +34 -0
  22. data/lib/interactor/colorize.rb +61 -0
  23. data/lib/interactor/context_definition.rb +156 -0
  24. data/lib/interactor/contextable.rb +18 -0
  25. data/lib/interactor/duration/base_formatter.rb +32 -0
  26. data/lib/interactor/duration/color_string_formatter.rb +22 -0
  27. data/lib/interactor/duration/json_formatter.rb +43 -0
  28. data/lib/interactor/duration/string_formatter.rb +57 -0
  29. data/lib/interactor/duration.rb +97 -0
  30. data/lib/interactor/extended/configuration.rb +51 -0
  31. data/lib/interactor/extended/error.rb +8 -0
  32. data/lib/interactor/extended/helpers.rb +54 -0
  33. data/lib/interactor/extended/version.rb +30 -0
  34. data/lib/interactor/extended.rb +84 -0
  35. data/lib/interactor/flow.rb +21 -0
  36. data/lib/interactor/jobify.rb +121 -0
  37. data/lib/interactor/light_context.rb +169 -0
  38. data/lib/interactor/light_context_definition.rb +53 -0
  39. data/lib/interactor/loggable.rb +28 -0
  40. data/lib/interactor/operation.rb +21 -0
  41. data/lib/interactor/organize.rb +49 -0
  42. data/lib/interactor/populate.rb +63 -0
  43. data/lib/interactor/threadable.rb +13 -0
  44. data/sig/interactor/colorize.rbs +9 -0
  45. data/sig/interactor/context_definition.rbs +20 -0
  46. data/sig/interactor/contextable.rbs +6 -0
  47. data/sig/interactor/duration/base_formatter.rbs +12 -0
  48. data/sig/interactor/duration/color_string_formatter.rbs +9 -0
  49. data/sig/interactor/duration/json_formatter.rbs +7 -0
  50. data/sig/interactor/duration/string_formatter.rbs +7 -0
  51. data/sig/interactor/duration.rbs +7 -0
  52. data/sig/interactor/extended/configuration.rbs +14 -0
  53. data/sig/interactor/extended/error.rbs +6 -0
  54. data/sig/interactor/extended/helpers.rbs +9 -0
  55. data/sig/interactor/extended/version.rbs +10 -0
  56. data/sig/interactor/extended.rbs +12 -0
  57. data/sig/interactor/flow.rbs +8 -0
  58. data/sig/interactor/jobify.rbs +32 -0
  59. data/sig/interactor/light_context.rbs +28 -0
  60. data/sig/interactor/light_context_definition.rbs +13 -0
  61. data/sig/interactor/loggable.rbs +13 -0
  62. data/sig/interactor/operation.rbs +8 -0
  63. data/sig/interactor/organize.rbs +21 -0
  64. data/sig/interactor/populate.rbs +20 -0
  65. data/sig/interactor/threadable.rbs +5 -0
  66. metadata +127 -0
@@ -0,0 +1,7 @@
1
+ module Interactor
2
+ module Duration
3
+ class JsonFormatter < BaseFormatter
4
+ def value: () -> Array[Hash[Symbol, untyped]]
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Interactor
2
+ module Duration
3
+ class StringFormatter < JsonFormatter
4
+ def value: () -> String
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ module Interactor
2
+ module Duration
3
+ class << self
4
+ def included: (untyped base) -> void
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,14 @@
1
+ module Interactor
2
+ module Extended
3
+ class Configuration
4
+ attr_accessor logger: untyped
5
+ attr_accessor type: Symbol | Array[untyped]
6
+ attr_accessor duration_format: Symbol | String | nil
7
+ attr_accessor on_duration: ((String) -> void) | nil
8
+ attr_reader types: Hash[Symbol, Array[untyped]]
9
+
10
+ def initialize: () -> void
11
+ def add_type!: (Symbol type, ?Array[untyped] modules, ?Symbol | nil inherit) -> void
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,6 @@
1
+ module Interactor
2
+ module Extended
3
+ class Error < StandardError
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,9 @@
1
+ module Interactor
2
+ module Extended
3
+ module Helpers
4
+ def deep_dup: (untyped obj) -> untyped
5
+ def deep_transform_keys: (untyped object) { (untyped) -> untyped } -> untyped
6
+ def safe_constantize: (String camel_cased_word) -> untyped
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,10 @@
1
+ module Interactor
2
+ module Extended
3
+ VERSION: String
4
+
5
+ class << self
6
+ def version -> String
7
+ def revision -> String | nil
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,12 @@
1
+ module Interactor
2
+ module Extended
3
+ class << self
4
+ def configuration: () -> Configuration
5
+ def configuration=: (Configuration config) -> Configuration
6
+ def configure: () { (Configuration) -> untyped } -> untyped
7
+ def modules: (Symbol kind, Symbol | Array[untyped] type) -> Array[untyped]
8
+ def build_module: (Symbol kind, Symbol | Array[untyped] type) -> Module
9
+ def thread: () { () -> untyped } -> Thread
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,8 @@
1
+ module Interactor
2
+ module Flow
3
+ class << self
4
+ def included: (untyped base) -> void
5
+ def []: (Symbol type) -> Module
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,32 @@
1
+ module Interactor
2
+ module Jobify
3
+ class << self
4
+ def included: (untyped base) -> void
5
+ end
6
+
7
+ module ClassMethods
8
+ attr_reader job_active: bool | nil
9
+ attr_reader job_class: Class | nil
10
+ attr_reader job_default: bool
11
+ attr_reader job_params: untyped
12
+
13
+ def jobify: (?klass: Class | nil, ?params: untyped, ?default: bool) { (untyped) -> untyped } -> void
14
+ end
15
+
16
+ def job_active: () -> bool | nil
17
+ def job_default: () -> bool
18
+ def run!: () -> untyped
19
+
20
+ protected
21
+
22
+ def jobify?: () -> bool
23
+ def job_class: () -> Class
24
+ def job_params: () -> untyped
25
+ def perform_in?: () -> bool
26
+ def perform_job: (?untyped params) -> void
27
+ def perform_later: (untyped args) -> void
28
+ def perform_in: (untyped wait, untyped args) -> void
29
+ def sidekiq?: () -> bool
30
+ def application_job?: () -> bool
31
+ end
32
+ end
@@ -0,0 +1,28 @@
1
+ module Interactor
2
+ class LightContext < BasicObject
3
+ def success?: () -> bool
4
+ def failure?: () -> bool
5
+ def fail!: (?Hash[untyped, untyped] context) -> void
6
+ def called!: (untyped interactor) -> void
7
+ def rollback!: () -> bool
8
+ def _called: () -> Array[untyped]
9
+ def initialize: (?Hash[untyped, untyped] data) -> void
10
+ def to_h: () -> Hash[Symbol, untyped]
11
+ def inspect: () -> String
12
+ def to_s: () -> String
13
+ def key?: (untyped name) -> bool
14
+ def []: (untyped name) -> untyped
15
+ def []=: (untyped key, untyped value) -> untyped
16
+ def respond_to?: (untyped name, ?bool include_private) -> bool
17
+ def deconstruct_keys: (?Array[Symbol] | nil keys) -> Hash[Symbol, untyped]
18
+
19
+ private
20
+
21
+ def respond_to_missing?: (untyped name, ?bool _include_private) -> bool
22
+ def method_missing: (untyped name, *untyped args) -> untyped
23
+
24
+ class << self
25
+ def build: (?untyped context) -> LightContext
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,13 @@
1
+ module Interactor
2
+ module LightContextDefinition
3
+ class << self
4
+ def included: (untyped base) -> void
5
+ end
6
+
7
+ module ClassMethods
8
+ def attribute: (*Symbol | String, ?array: bool, ?default: untyped, ?required: bool, ?direction: Symbol) -> void
9
+ def input: (*Symbol | String, ?array: bool, ?default: untyped, ?required: bool, ?writer: bool) -> void
10
+ def output: (*Symbol | String, ?array: bool, ?default: untyped, ?required: bool) -> void
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ module Interactor
2
+ module Loggable
3
+ class << self
4
+ def included: (untyped base) -> void
5
+ end
6
+
7
+ module ClassMethods
8
+ def logger: () -> untyped
9
+ end
10
+
11
+ def logger: () -> untyped
12
+ end
13
+ end
@@ -0,0 +1,8 @@
1
+ module Interactor
2
+ module Operation
3
+ class << self
4
+ def included: (untyped base) -> void
5
+ def []: (Symbol type) -> Module
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,21 @@
1
+ module Interactor
2
+ module Organize
3
+ class ThreadRunner < Proc
4
+ end
5
+
6
+ class << self
7
+ def included: (untyped base) -> void
8
+ end
9
+
10
+ module ClassMethods
11
+ def thread: (untyped klass) -> ThreadRunner
12
+ end
13
+
14
+ def call: () -> untyped
15
+
16
+ protected
17
+
18
+ def organize: (*untyped organized) -> Array[untyped]
19
+ def organized: () -> untyped
20
+ end
21
+ end
@@ -0,0 +1,20 @@
1
+ module Interactor
2
+ module Populate
3
+ class << self
4
+ def included: (untyped base) -> void
5
+ end
6
+
7
+ module ClassMethods
8
+ def call: (*untyped args) -> untyped
9
+ def call!: (*untyped args) -> untyped
10
+
11
+ private
12
+
13
+ def populate: (?Hash[untyped, untyped] context, ?untyped parent_context, *untyped keys) { (Hash[untyped, untyped]) -> untyped } -> untyped
14
+ end
15
+
16
+ protected
17
+
18
+ def context_assign: (?Hash[untyped, untyped] data) -> LightContext
19
+ end
20
+ end
@@ -0,0 +1,5 @@
1
+ module Interactor
2
+ module Threadable
3
+ def thread: () { () -> untyped } -> Thread
4
+ end
5
+ end
metadata ADDED
@@ -0,0 +1,127 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: interactor-extended
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Anatolii Varanytsia
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2026-09-14 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: interactor
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 3.2.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 3.2.0
27
+ description: Interactor-extended provide a useful extensions for the Interactor gem.
28
+ email:
29
+ - prizrack13@gmail.com
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - ".rspec"
35
+ - ".rubocop.yml"
36
+ - CHANGELOG.md
37
+ - CODE_OF_CONDUCT.md
38
+ - LICENSE.txt
39
+ - README.md
40
+ - Rakefile
41
+ - VERSION
42
+ - docs/colorize.md
43
+ - docs/configuration.md
44
+ - docs/context_definition.md
45
+ - docs/duration.md
46
+ - docs/flow.md
47
+ - docs/jobify.md
48
+ - docs/light_context.md
49
+ - docs/light_context_definition.md
50
+ - docs/loggable.md
51
+ - docs/operation.md
52
+ - docs/organize.md
53
+ - docs/populate.md
54
+ - lib/interactor/colorize.rb
55
+ - lib/interactor/context_definition.rb
56
+ - lib/interactor/contextable.rb
57
+ - lib/interactor/duration.rb
58
+ - lib/interactor/duration/base_formatter.rb
59
+ - lib/interactor/duration/color_string_formatter.rb
60
+ - lib/interactor/duration/json_formatter.rb
61
+ - lib/interactor/duration/string_formatter.rb
62
+ - lib/interactor/extended.rb
63
+ - lib/interactor/extended/configuration.rb
64
+ - lib/interactor/extended/error.rb
65
+ - lib/interactor/extended/helpers.rb
66
+ - lib/interactor/extended/version.rb
67
+ - lib/interactor/flow.rb
68
+ - lib/interactor/jobify.rb
69
+ - lib/interactor/light_context.rb
70
+ - lib/interactor/light_context_definition.rb
71
+ - lib/interactor/loggable.rb
72
+ - lib/interactor/operation.rb
73
+ - lib/interactor/organize.rb
74
+ - lib/interactor/populate.rb
75
+ - lib/interactor/threadable.rb
76
+ - sig/interactor/colorize.rbs
77
+ - sig/interactor/context_definition.rbs
78
+ - sig/interactor/contextable.rbs
79
+ - sig/interactor/duration.rbs
80
+ - sig/interactor/duration/base_formatter.rbs
81
+ - sig/interactor/duration/color_string_formatter.rbs
82
+ - sig/interactor/duration/json_formatter.rbs
83
+ - sig/interactor/duration/string_formatter.rbs
84
+ - sig/interactor/extended.rbs
85
+ - sig/interactor/extended/configuration.rbs
86
+ - sig/interactor/extended/error.rbs
87
+ - sig/interactor/extended/helpers.rbs
88
+ - sig/interactor/extended/version.rbs
89
+ - sig/interactor/flow.rbs
90
+ - sig/interactor/jobify.rbs
91
+ - sig/interactor/light_context.rbs
92
+ - sig/interactor/light_context_definition.rbs
93
+ - sig/interactor/loggable.rbs
94
+ - sig/interactor/operation.rbs
95
+ - sig/interactor/organize.rbs
96
+ - sig/interactor/populate.rbs
97
+ - sig/interactor/threadable.rbs
98
+ homepage: https://github.com/prizrack13/interactor-extended.git
99
+ licenses:
100
+ - MIT
101
+ metadata:
102
+ allowed_push_host: https://rubygems.org
103
+ homepage_uri: https://github.com/prizrack13/interactor-extended.git
104
+ github_repo: ssh://github.com/prizrack13/interactor-extended
105
+ source_code_uri: https://github.com/prizrack13/interactor-extended
106
+ changelog_uri: https://github.com/prizrack13/interactor-extended/master/CHANGELOG.md
107
+ rubygems_mfa_required: 'true'
108
+ post_install_message:
109
+ rdoc_options: []
110
+ require_paths:
111
+ - lib
112
+ required_ruby_version: !ruby/object:Gem::Requirement
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ version: 3.2.2
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ requirements:
119
+ - - ">="
120
+ - !ruby/object:Gem::Version
121
+ version: '0'
122
+ requirements: []
123
+ rubygems_version: 3.4.10
124
+ signing_key:
125
+ specification_version: 4
126
+ summary: Interactor Extensions
127
+ test_files: []