muina 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/main.yml +16 -0
  3. data/.gitignore +5 -0
  4. data/.mutant.yml +38 -0
  5. data/.rspec +4 -0
  6. data/.rubocop.yml +172 -0
  7. data/.ruby-version +1 -0
  8. data/.simplecov +14 -0
  9. data/CHANGELOG.md +38 -0
  10. data/Gemfile +34 -0
  11. data/Gemfile.lock +265 -0
  12. data/Guardfile +24 -0
  13. data/README.md +36 -0
  14. data/Rakefile +13 -0
  15. data/SECURITY.md +14 -0
  16. data/bin/bundle +114 -0
  17. data/bin/console +15 -0
  18. data/bin/flay +29 -0
  19. data/bin/flog +29 -0
  20. data/bin/guard +29 -0
  21. data/bin/irb +29 -0
  22. data/bin/lefthook +29 -0
  23. data/bin/mutant +29 -0
  24. data/bin/parlour +29 -0
  25. data/bin/rake +29 -0
  26. data/bin/rspec +29 -0
  27. data/bin/rubocop +29 -0
  28. data/bin/setup +8 -0
  29. data/bin/srb +29 -0
  30. data/bin/srb-rbi +29 -0
  31. data/bin/tapioca +29 -0
  32. data/exe/muina +11 -0
  33. data/lefthook.yml +39 -0
  34. data/lib/muina/action/params_factory.rb +17 -0
  35. data/lib/muina/action/step/command.rb +31 -0
  36. data/lib/muina/action/step/failure.rb +18 -0
  37. data/lib/muina/action/step/query.rb +31 -0
  38. data/lib/muina/action/step/result.rb +51 -0
  39. data/lib/muina/action/step.rb +13 -0
  40. data/lib/muina/action.rb +73 -0
  41. data/lib/muina/any.rb +7 -0
  42. data/lib/muina/classes.rb +7 -0
  43. data/lib/muina/module.rb +6 -0
  44. data/lib/muina/parameters.rb +7 -0
  45. data/lib/muina/params.rb +19 -0
  46. data/lib/muina/private_creation.rb +12 -0
  47. data/lib/muina/result/factory.rb +37 -0
  48. data/lib/muina/result/failure.rb +31 -0
  49. data/lib/muina/result/null.rb +25 -0
  50. data/lib/muina/result/success.rb +31 -0
  51. data/lib/muina/result.rb +17 -0
  52. data/lib/muina/service.rb +37 -0
  53. data/lib/muina/symbol_hash.rb +7 -0
  54. data/lib/muina/unit.rb +10 -0
  55. data/lib/muina/untyped_array.rb +7 -0
  56. data/lib/muina/untyped_hash.rb +7 -0
  57. data/lib/muina/value.rb +16 -0
  58. data/lib/muina/version.rb +7 -0
  59. data/lib/muina.rb +42 -0
  60. data/muina.gemspec +35 -0
  61. data/rbi/muina.rbi +268 -0
  62. data/sorbet/config +2 -0
  63. data/sorbet/rbi/gems/actionpack@6.1.4.rbi +5045 -0
  64. data/sorbet/rbi/gems/actionview@6.1.4.rbi +2416 -0
  65. data/sorbet/rbi/gems/activesupport@6.1.4.rbi +3778 -0
  66. data/sorbet/rbi/gems/ast@2.4.2.rbi +54 -0
  67. data/sorbet/rbi/gems/awesome_print@1.9.2.rbi +322 -0
  68. data/sorbet/rbi/gems/builder@3.2.4.rbi +8 -0
  69. data/sorbet/rbi/gems/byebug@11.1.3.rbi +18 -0
  70. data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
  71. data/sorbet/rbi/gems/colorize@0.8.1.rbi +39 -0
  72. data/sorbet/rbi/gems/commander@4.6.0.rbi +8 -0
  73. data/sorbet/rbi/gems/concurrent-ruby@1.1.9.rbi +2403 -0
  74. data/sorbet/rbi/gems/crass@1.0.6.rbi +123 -0
  75. data/sorbet/rbi/gems/diff-lcs@1.4.4.rbi +185 -0
  76. data/sorbet/rbi/gems/docile@1.4.0.rbi +54 -0
  77. data/sorbet/rbi/gems/erubi@1.10.0.rbi +36 -0
  78. data/sorbet/rbi/gems/erubis@2.7.0.rbi +8 -0
  79. data/sorbet/rbi/gems/faker@2.18.0.rbi +2469 -0
  80. data/sorbet/rbi/gems/ffi@1.15.3.rbi +8 -0
  81. data/sorbet/rbi/gems/flay@2.12.1.rbi +178 -0
  82. data/sorbet/rbi/gems/flog@4.6.4.rbi +70 -0
  83. data/sorbet/rbi/gems/formatador@0.3.0.rbi +8 -0
  84. data/sorbet/rbi/gems/guard-compat@1.2.1.rbi +49 -0
  85. data/sorbet/rbi/gems/guard-rspec@4.7.3.rbi +233 -0
  86. data/sorbet/rbi/gems/guard-rubocop@1.4.0.rbi +66 -0
  87. data/sorbet/rbi/gems/guard-shell@0.7.2.rbi +69 -0
  88. data/sorbet/rbi/gems/guard@2.18.0.rbi +617 -0
  89. data/sorbet/rbi/gems/highline@2.0.3.rbi +8 -0
  90. data/sorbet/rbi/gems/i18n@1.8.10.rbi +616 -0
  91. data/sorbet/rbi/gems/io-console@0.5.9.rbi +8 -0
  92. data/sorbet/rbi/gems/irb@1.3.6.rbi +452 -0
  93. data/sorbet/rbi/gems/lefthook@0.7.6.rbi +8 -0
  94. data/sorbet/rbi/gems/listen@3.6.0.rbi +476 -0
  95. data/sorbet/rbi/gems/loofah@2.10.0.rbi +223 -0
  96. data/sorbet/rbi/gems/lumberjack@1.2.8.rbi +431 -0
  97. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  98. data/sorbet/rbi/gems/minitest@5.14.4.rbi +344 -0
  99. data/sorbet/rbi/gems/mutant-license@0.1.1.1.4043027289354708743625974235631451632228.0.rbi +8 -0
  100. data/sorbet/rbi/gems/mutant-rspec@0.10.32.rbi +8 -0
  101. data/sorbet/rbi/gems/mutant@0.10.32.rbi +4154 -0
  102. data/sorbet/rbi/gems/nenv@0.3.0.rbi +88 -0
  103. data/sorbet/rbi/gems/nokogiri@1.11.7.rbi +1422 -0
  104. data/sorbet/rbi/gems/notiffany@0.1.3.rbi +331 -0
  105. data/sorbet/rbi/gems/parallel@1.20.1.rbi +113 -0
  106. data/sorbet/rbi/gems/parlour@6.0.1.rbi +1726 -0
  107. data/sorbet/rbi/gems/parser@3.0.2.0.rbi +1683 -0
  108. data/sorbet/rbi/gems/path_expander@1.1.0.rbi +24 -0
  109. data/sorbet/rbi/gems/polyfill@1.9.0.rbi +393 -0
  110. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  111. data/sorbet/rbi/gems/racc@1.5.2.rbi +47 -0
  112. data/sorbet/rbi/gems/rack-test@1.1.0.rbi +272 -0
  113. data/sorbet/rbi/gems/rack@2.2.3.rbi +1618 -0
  114. data/sorbet/rbi/gems/rails-dom-testing@2.0.3.rbi +92 -0
  115. data/sorbet/rbi/gems/rails-html-sanitizer@1.3.0.rbi +183 -0
  116. data/sorbet/rbi/gems/rainbow@3.0.0.rbi +153 -0
  117. data/sorbet/rbi/gems/rake@13.0.6.rbi +808 -0
  118. data/sorbet/rbi/gems/rb-fsevent@0.11.0.rbi +8 -0
  119. data/sorbet/rbi/gems/rb-inotify@0.10.1.rbi +8 -0
  120. data/sorbet/rbi/gems/regexp_parser@2.1.1.rbi +1120 -0
  121. data/sorbet/rbi/gems/reline@0.2.6.rbi +662 -0
  122. data/sorbet/rbi/gems/rexml@3.2.5.rbi +672 -0
  123. data/sorbet/rbi/gems/rspec-core@3.10.1.rbi +2509 -0
  124. data/sorbet/rbi/gems/rspec-expectations@3.10.1.rbi +1574 -0
  125. data/sorbet/rbi/gems/rspec-mocks@3.10.2.rbi +1462 -0
  126. data/sorbet/rbi/gems/rspec-support@3.10.2.rbi +509 -0
  127. data/sorbet/rbi/gems/rspec@3.10.0.rbi +38 -0
  128. data/sorbet/rbi/gems/rubocop-ast@1.8.0.rbi +2194 -0
  129. data/sorbet/rbi/gems/rubocop-performance@1.11.4.rbi +899 -0
  130. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +118 -0
  131. data/sorbet/rbi/gems/rubocop-rspec@2.4.0.rbi +1805 -0
  132. data/sorbet/rbi/gems/rubocop-sorbet@0.6.2.rbi +288 -0
  133. data/sorbet/rbi/gems/rubocop@1.18.4.rbi +13197 -0
  134. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +405 -0
  135. data/sorbet/rbi/gems/ruby_parser@3.16.0.rbi +4528 -0
  136. data/sorbet/rbi/gems/safe_type@1.1.1.rbi +157 -0
  137. data/sorbet/rbi/gems/sexp_processor@4.15.3.rbi +359 -0
  138. data/sorbet/rbi/gems/shellany@0.0.1.rbi +28 -0
  139. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +89 -0
  140. data/sorbet/rbi/gems/simplecov@0.21.2.rbi +577 -0
  141. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.3.rbi +8 -0
  142. data/sorbet/rbi/gems/sorbet-coerce@0.5.0.rbi +42 -0
  143. data/sorbet/rbi/gems/sorbet-rails@0.7.4.rbi +8 -0
  144. data/sorbet/rbi/gems/sorbet-struct-comparable@1.1.0.rbi +17 -0
  145. data/sorbet/rbi/gems/spoom@1.1.1.rbi +1193 -0
  146. data/sorbet/rbi/gems/tapioca@0.4.23.rbi +1826 -0
  147. data/sorbet/rbi/gems/thor@1.1.0.rbi +838 -0
  148. data/sorbet/rbi/gems/tzinfo@2.0.4.rbi +856 -0
  149. data/sorbet/rbi/gems/unicode-display_width@2.0.0.rbi +26 -0
  150. data/sorbet/rbi/gems/unparser@0.6.0.rbi +2037 -0
  151. data/sorbet/rbi/gems/zeitwerk@2.4.2.rbi +173 -0
  152. data/sorbet/rbi/todo.rbi +8 -0
  153. data/sorbet/rbi/typed_params.rbi +7 -0
  154. data/sorbet/tapioca/require.rb +16 -0
  155. metadata +269 -0
data/rbi/muina.rbi ADDED
@@ -0,0 +1,268 @@
1
+ # typed: strong
2
+ # frozen_string_literal: true
3
+
4
+ M = Muina
5
+
6
+ class Module
7
+ include T::Sig
8
+ end
9
+
10
+ module Muina
11
+ Any = T.type_alias { T.untyped }
12
+ Classes = T.type_alias { T.any(Class, T::Array[Class]) }
13
+ Parameters = T.type_alias { T.any(UntypedHash, ActionController::Parameters) }
14
+ SymbolHash = T.type_alias { T::Hash[Symbol, T.untyped] }
15
+ UntypedArray = T.type_alias { T::Array[T.untyped] }
16
+ UntypedHash = T.type_alias { T::Hash[T.untyped, T.untyped] }
17
+ UNIT = T.let(Unit.instance, Unit)
18
+ VERSION = '0.2.7'
19
+
20
+ class Error < StandardError; end
21
+
22
+ sig { params(value: T.untyped).returns(Muina::Result::Success) }
23
+ def self.Success(value); end
24
+
25
+ sig { params(error: T.untyped).returns(Muina::Result::Failure) }
26
+ def self.Failure(error); end
27
+
28
+ sig { params(blk: T.untyped).returns(Muina::Result) }
29
+ def self.Result(&blk); end
30
+
31
+ class Action
32
+ include T::Props
33
+ include T::Props::Constructor
34
+
35
+ class DoubleResultError < Error
36
+ end
37
+
38
+ @steps = T.let(@steps, T.nilable(T::Array[Muina::Action::Step]))
39
+ @parameters = T.let(@parameters, T.untyped)
40
+ @__result_set__ = T.let(@__result_set__, T::Boolean)
41
+ @__failure_set__ = T.let(@__failure_set__, T::Boolean)
42
+
43
+ def initialize(hash)
44
+ @__failure__ = T.let(@__failure__, T.nilable(Muina::Result::Failure))
45
+ @__result__ = T.let(@__result__, T.nilable(Muina::Result::Success))
46
+ end
47
+
48
+ sig { returns(T::Array[Muina::Action::Step]) }
49
+ def self.steps; end
50
+
51
+ sig { params(params: T.untyped).returns(T.untyped) }
52
+ def self.extract(params); end
53
+
54
+ sig { params(blk: T.untyped).returns(T.untyped) }
55
+ def self.result(&blk); end
56
+
57
+ sig { params(blk: T.untyped).returns(T.untyped) }
58
+ def self.failure(&blk); end
59
+
60
+ sig { params(_name: T.untyped, blk: T.untyped).returns(T.untyped) }
61
+ def self.command(_name = nil, &blk); end
62
+
63
+ sig { params(name: T.untyped, type: T.untyped, blk: T.untyped).returns(T.untyped) }
64
+ def self.query(name, type, &blk); end
65
+
66
+ sig { params(blk: T.untyped).returns(T.untyped) }
67
+ def self.parameters(&blk); end
68
+
69
+ sig { params(hash: SymbolHash).returns(T.untyped) }
70
+ def self.call(hash = {}); end
71
+
72
+ sig { returns(T.untyped) }
73
+ def perform; end
74
+
75
+ module ParamsFactory
76
+ sig { params(params: T.untyped).returns(T.untyped) }
77
+ def self.build(params); end
78
+ end
79
+
80
+ class Step < Value
81
+ const :step, T.untyped
82
+
83
+ sig { params(action: T.untyped).returns(T.untyped) }
84
+ def call(action); end
85
+
86
+ class Command < self
87
+ sig { params(action: T.untyped).returns(T.untyped) }
88
+ def call(action); end
89
+
90
+ private
91
+
92
+ sig { void }
93
+ def success; end
94
+
95
+ sig { params(action: T.untyped, result: T.untyped).void }
96
+ def failure(action, result); end
97
+ end
98
+
99
+ class Failure < self
100
+ sig { params(action: T.untyped).returns(T.untyped) }
101
+ def call(action); end
102
+ end
103
+
104
+ class Query < self
105
+ const :name, Symbol
106
+
107
+ sig { params(action: T.untyped).void }
108
+ def call(action); end
109
+
110
+ private
111
+
112
+ sig { params(action: T.untyped, result: T.untyped).void }
113
+ def success(action, result); end
114
+
115
+ sig { params(action: T.untyped, result: T.untyped).void }
116
+ def failure(action, result); end
117
+ end
118
+
119
+ class Result < self
120
+ sig { params(action: T.untyped).void }
121
+ def call(action); end
122
+
123
+ private
124
+
125
+ sig { params(action: T.untyped, value: T.untyped).void }
126
+ def success(action, value); end
127
+
128
+ sig { params(action: T.untyped, value: T.untyped).void }
129
+ def failure(action, value); end
130
+ end
131
+ end
132
+ end
133
+
134
+ class Params
135
+ include T::Props
136
+ include T::Props::Constructor
137
+
138
+ sig { params(params: Parameters).returns(T.attached_class) }
139
+ def self.extract(params); end
140
+
141
+ sig { params(other: Class).returns(T::Boolean) }
142
+ def self.<(other); end
143
+ end
144
+
145
+ module PrivateCreation
146
+ sig { params(klass: Class).void }
147
+ def self.included(klass); end
148
+ end
149
+
150
+ class Result < Value
151
+ include PrivateCreation
152
+
153
+ sig { returns(Muina::Result::Null) }
154
+ def self.Null; end
155
+
156
+ sig { params(success_klass: T.untyped, error_klass: T.untyped).returns(T.untyped) }
157
+ def self.[](success_klass, error_klass); end
158
+
159
+ sig { returns(T.untyped) }
160
+ def value!; end
161
+
162
+ class Factory < T::Struct
163
+ prop :success_klass, T.any(Classes, T::Types::Base)
164
+ prop :error_klass, T.any(Classes, T::Types::Base)
165
+
166
+ sig { params(value: T.untyped).returns(Success) }
167
+ def success(value); end
168
+
169
+ sig { params(error: T.untyped).returns(Failure) }
170
+ def failure(error); end
171
+
172
+ private
173
+
174
+ sig { returns(Class) }
175
+ def success_subclass; end
176
+
177
+ sig { returns(Class) }
178
+ def failure_subclass; end
179
+
180
+ sig { params(klass: Class, symbol: Symbol, sklass: T.untyped).returns(Class) }
181
+ def klass_factory(klass, symbol, sklass); end
182
+ end
183
+
184
+ class Failure < self
185
+ ValueCalledOnFailureError = Class.new(Error)
186
+
187
+ const :error, T.untyped
188
+
189
+ sig { returns(T.noreturn) }
190
+ def value!; end
191
+
192
+ sig { returns(T.untyped) }
193
+ def error!; end
194
+
195
+ sig { params(_block: T.untyped).returns(Muina::Result::Failure) }
196
+ def and_then(&_block); end
197
+
198
+ sig { params(block: T.untyped).returns(Muina::Result::Failure) }
199
+ def or_else(&block); end
200
+ end
201
+
202
+ class Null < self
203
+ sig { returns(T.noreturn) }
204
+ def value!; end
205
+
206
+ sig { returns(T.noreturn) }
207
+ def error!; end
208
+
209
+ sig { returns(Null) }
210
+ def and_then(&_block); end
211
+
212
+ sig { returns(Null) }
213
+ def or_else(&_block); end
214
+ end
215
+
216
+ class Success < self
217
+ ErrorCalledOnSuccessError = Class.new(Error)
218
+
219
+ const :value, T.untyped
220
+
221
+ sig { returns(T.untyped) }
222
+ def value!; end
223
+
224
+ sig { returns(T.noreturn) }
225
+ def error!; end
226
+
227
+ sig { params(block: T.untyped).returns(T.untyped) }
228
+ def and_then(&block); end
229
+
230
+ sig { params(_block: T.untyped).returns(T.untyped) }
231
+ def or_else(&_block); end
232
+ end
233
+ end
234
+
235
+ class Service
236
+ include T::Props
237
+ include T::Props::Constructor
238
+ include PrivateCreation
239
+
240
+ sig { params(subklass: Class).void }
241
+ def self.inherited(subklass); end
242
+
243
+ sig { params(hash: SymbolHash).returns(T.untyped) }
244
+ def self.call(hash = {}); end
245
+ class << self; alias_method :[], :call; end
246
+
247
+ sig { params(args: Symbol, opts: T.untyped).void }
248
+ def self.arguments(*args, **opts); end
249
+
250
+ private
251
+
252
+ sig { returns(T.untyped) }
253
+ def perform; end
254
+ end
255
+
256
+ class Unit
257
+ include Singleton
258
+ end
259
+
260
+ class Value
261
+ include T::Props
262
+ include T::Props::Constructor
263
+ include T::Struct::ActsAsComparable
264
+
265
+ sig { params(hash: SymbolHash).void }
266
+ def initialize(hash = {}); end
267
+ end
268
+ end
data/sorbet/config ADDED
@@ -0,0 +1,2 @@
1
+ --dir
2
+ .