roast-ai 0.4.8 → 0.4.9

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 (81) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.rubocop.yml +1 -0
  4. data/Gemfile.lock +3 -3
  5. data/README.md +9 -5
  6. data/dsl/less_simple.rb +112 -0
  7. data/dsl/prototype.rb +17 -0
  8. data/dsl/simple.rb +5 -7
  9. data/dsl/step_communication.rb +18 -0
  10. data/examples/grading/README.md +46 -0
  11. data/examples/grading/analyze_coverage/prompt.md +52 -0
  12. data/examples/grading/calculate_final_grade.rb +64 -0
  13. data/examples/grading/format_result.rb +61 -0
  14. data/examples/grading/generate_grades/prompt.md +105 -0
  15. data/examples/grading/generate_recommendations/output.txt +17 -0
  16. data/examples/grading/generate_recommendations/prompt.md +60 -0
  17. data/examples/grading/read_dependencies/prompt.md +15 -0
  18. data/examples/grading/verify_mocks_and_stubs/prompt.md +12 -0
  19. data/examples/grading/verify_test_helpers/prompt.md +53 -0
  20. data/examples/grading/workflow.md +5 -0
  21. data/examples/grading/workflow.yml +28 -0
  22. data/lib/roast/dsl/cog/config.rb +31 -0
  23. data/lib/roast/dsl/cog/stack.rb +21 -0
  24. data/lib/roast/dsl/cog/store.rb +26 -0
  25. data/lib/roast/dsl/cog.rb +70 -0
  26. data/lib/roast/dsl/cog_execution_context.rb +29 -0
  27. data/lib/roast/dsl/cogs/cmd.rb +55 -0
  28. data/lib/roast/dsl/cogs/graph.rb +53 -0
  29. data/lib/roast/dsl/cogs.rb +65 -0
  30. data/lib/roast/dsl/config_context.rb +54 -0
  31. data/lib/roast/dsl/executor.rb +62 -7
  32. data/lib/roast/dsl/workflow_execution_context.rb +47 -0
  33. data/lib/roast/error.rb +7 -0
  34. data/lib/roast/errors.rb +3 -3
  35. data/lib/roast/graph/edge.rb +25 -0
  36. data/lib/roast/graph/node.rb +40 -0
  37. data/lib/roast/graph/quantum_edge.rb +27 -0
  38. data/lib/roast/graph/threaded_exec.rb +93 -0
  39. data/lib/roast/graph.rb +233 -0
  40. data/lib/roast/resources/api_resource.rb +2 -2
  41. data/lib/roast/resources/url_resource.rb +2 -2
  42. data/lib/roast/tools/apply_diff.rb +1 -1
  43. data/lib/roast/tools/ask_user.rb +1 -1
  44. data/lib/roast/tools/bash.rb +1 -1
  45. data/lib/roast/tools/cmd.rb +2 -2
  46. data/lib/roast/tools/coding_agent.rb +2 -2
  47. data/lib/roast/tools/grep.rb +1 -1
  48. data/lib/roast/tools/read_file.rb +1 -1
  49. data/lib/roast/tools/search_file.rb +1 -1
  50. data/lib/roast/tools/swarm.rb +1 -1
  51. data/lib/roast/tools/update_files.rb +2 -2
  52. data/lib/roast/tools/write_file.rb +1 -1
  53. data/lib/roast/tools.rb +1 -1
  54. data/lib/roast/value_objects/api_token.rb +1 -1
  55. data/lib/roast/value_objects/uri_base.rb +1 -1
  56. data/lib/roast/value_objects/workflow_path.rb +1 -1
  57. data/lib/roast/version.rb +1 -1
  58. data/lib/roast/workflow/base_workflow.rb +38 -2
  59. data/lib/roast/workflow/command_executor.rb +1 -1
  60. data/lib/roast/workflow/configuration_loader.rb +1 -1
  61. data/lib/roast/workflow/error_handler.rb +1 -1
  62. data/lib/roast/workflow/step_executor_registry.rb +1 -1
  63. data/lib/roast/workflow/step_loader.rb +1 -1
  64. data/lib/roast/workflow/workflow_executor.rb +1 -1
  65. data/lib/roast.rb +1 -1
  66. data/sorbet/config +2 -0
  67. data/sorbet/rbi/annotations/.gitattributes +1 -0
  68. data/sorbet/rbi/annotations/activesupport.rbi +495 -0
  69. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  70. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  71. data/sorbet/rbi/annotations/mocha.rbi +34 -0
  72. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  73. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  74. data/sorbet/rbi/gems/rbs-inline@0.12.0.rbi +2170 -0
  75. data/sorbet/rbi/gems/{rexml@3.4.1.rbi → rexml@3.4.2.rbi} +284 -239
  76. data/sorbet/rbi/shims/lib/roast/dsl/config_context.rbi +11 -0
  77. data/sorbet/rbi/shims/lib/roast/dsl/workflow_execution_context.rbi +11 -0
  78. data/sorbet/rbi/todo.rbi +7 -0
  79. metadata +46 -5
  80. data/package-lock.json +0 -6
  81. /data/sorbet/rbi/gems/{rack@2.2.17.rbi → rack@2.2.18.rbi} +0 -0
@@ -113,7 +113,7 @@ module Roast
113
113
  log_and_raise_error(error, message, step_model || model, kwargs, execution_time)
114
114
  rescue => e
115
115
  execution_time = Time.now - start_time
116
- log_and_raise_error(e, e.message, step_model || model, kwargs, execution_time)
116
+ log_and_raise_error(e, enhanced_message(e), step_model || model, kwargs, execution_time)
117
117
  end
118
118
 
119
119
  def with_model(model)
@@ -142,7 +142,43 @@ module Roast
142
142
  execution_time: execution_time,
143
143
  })
144
144
 
145
- raise error
145
+ # If we have an enhanced message, create a new error with it
146
+ if message != error.message
147
+ new_error = error.class.new(message)
148
+ new_error.set_backtrace(error.backtrace) if error.backtrace
149
+ raise new_error
150
+ else
151
+ raise error
152
+ end
153
+ end
154
+
155
+ def enhanced_message(error)
156
+ original_message = error.message
157
+
158
+ url, status = if error.respond_to?(:response) && error.response.is_a?(Hash)
159
+ [error.response[:url], error.response[:status]]
160
+ elsif error.respond_to?(:response_status)
161
+ [nil, error.response_status]
162
+ end
163
+
164
+ message = if url && status
165
+ "API call to #{url} failed with status #{status}: #{original_message}"
166
+ elsif status
167
+ "API call failed with status #{status}: #{original_message}"
168
+ else
169
+ original_message
170
+ end
171
+
172
+ message += if error.respond_to?(:response_body)
173
+ body = error.response_body
174
+ error_detail = body.is_a?(Hash) ? body.dig("error", "message") : body.to_s
175
+
176
+ if error_detail && !error_detail.empty? && !message.include?(error_detail)
177
+ " (#{error_detail})"
178
+ end
179
+ end
180
+
181
+ message
146
182
  end
147
183
 
148
184
  def read_sidecar_prompt
@@ -4,7 +4,7 @@
4
4
  module Roast
5
5
  module Workflow
6
6
  class CommandExecutor
7
- class CommandExecutionError < StandardError
7
+ class CommandExecutionError < Roast::Error
8
8
  attr_reader :command, :exit_status, :original_error, :output
9
9
 
10
10
  def initialize(message, command:, exit_status: nil, original_error: nil)
@@ -5,7 +5,7 @@ module Roast
5
5
  module Workflow
6
6
  # Handles loading and parsing of workflow configuration files
7
7
  class ConfigurationLoader
8
- class ValidationError < StandardError; end
8
+ class ValidationError < Roast::Error; end
9
9
 
10
10
  class << self
11
11
  # Load configuration from a YAML file
@@ -27,7 +27,7 @@ module Roast
27
27
  current_attempt += 1
28
28
  result = block.call
29
29
  break
30
- rescue StandardError => e
30
+ rescue Roast::Error => e
31
31
  remaining_attempts = maximum_attempts - current_attempt
32
32
  raise e if remaining_attempts == 0
33
33
 
@@ -6,7 +6,7 @@ module Roast
6
6
  # Registry pattern for step executors - eliminates case statements
7
7
  # and follows Open/Closed Principle
8
8
  class StepExecutorRegistry
9
- class UnknownStepTypeError < StandardError; end
9
+ class UnknownStepTypeError < Roast::Error; end
10
10
 
11
11
  @executors = {}
12
12
  @type_matchers = []
@@ -8,7 +8,7 @@ module Roast
8
8
  DEFAULT_MODEL = "gpt-4o-mini"
9
9
 
10
10
  # Custom exception classes
11
- class StepLoaderError < StandardError
11
+ class StepLoaderError < Roast::Error
12
12
  attr_reader :step_name, :original_error
13
13
 
14
14
  def initialize(message, step_name: nil, original_error: nil)
@@ -11,7 +11,7 @@ module Roast
11
11
  # by introducing the StepRunner interface.
12
12
  class WorkflowExecutor
13
13
  # Define custom exception classes for specific error scenarios
14
- class WorkflowExecutorError < StandardError
14
+ class WorkflowExecutorError < Roast::Error
15
15
  attr_reader :step_name, :original_error
16
16
 
17
17
  def initialize(message, step_name: nil, original_error: nil)
data/lib/roast.rb CHANGED
@@ -280,7 +280,7 @@ module Roast
280
280
  output_path = generator.generate(options[:output])
281
281
 
282
282
  puts ::CLI::UI.fmt("{{success:✓}} Diagram generated: #{output_path}")
283
- rescue StandardError => e
283
+ rescue Roast::Error => e
284
284
  raise Thor::Error, "Error generating diagram: #{e.message}"
285
285
  end
286
286
 
data/sorbet/config CHANGED
@@ -1,5 +1,7 @@
1
1
  --dir
2
2
  .
3
+ --ignore=.git/
4
+ --ignore=.idea/
3
5
  --ignore=tmp/
4
6
  --ignore=vendor/
5
7
  --ignore=test/
@@ -0,0 +1 @@
1
+ **/*.rbi linguist-vendored=true
@@ -0,0 +1,495 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This file was pulled from a central RBI files repository.
5
+ # Please run `bin/tapioca annotations` to update it.
6
+
7
+ module ActiveSupport::Testing::Declarative
8
+ sig { params(name: String, block: T.proc.bind(T.untyped).void).void }
9
+ def test(name, &block); end
10
+ end
11
+
12
+ class ActiveSupport::EnvironmentInquirer
13
+ sig { returns(T::Boolean) }
14
+ def development?; end
15
+
16
+ sig { returns(T::Boolean) }
17
+ def production?; end
18
+
19
+ sig { returns(T::Boolean) }
20
+ def test?; end
21
+
22
+ # @method_missing: delegated to String through ActiveSupport::StringInquirer
23
+ sig { returns(T::Boolean) }
24
+ def staging?; end
25
+ end
26
+
27
+ module ActiveSupport::Testing::SetupAndTeardown::ClassMethods
28
+ sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void }
29
+ def setup(*args, &block); end
30
+
31
+ sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.untyped).void)).void }
32
+ def teardown(*args, &block); end
33
+ end
34
+
35
+ class ActiveSupport::TestCase
36
+ sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void }
37
+ def self.setup(*args, &block); end
38
+
39
+ sig { params(args: T.untyped, block: T.nilable(T.proc.bind(T.attached_class).void)).void }
40
+ def self.teardown(*args, &block); end
41
+
42
+ sig { params(name: String, block: T.proc.bind(T.attached_class).void).void }
43
+ def self.test(name, &block); end
44
+ end
45
+
46
+ class ActiveSupport::TimeWithZone
47
+ # @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing
48
+ include ::DateAndTime::Zones
49
+
50
+ # @shim: Methods on ActiveSupport::TimeWithZone are delegated to `Time` using `method_missing
51
+ include ::DateAndTime::Calculations
52
+
53
+ sig { returns(FalseClass) }
54
+ def blank?; end
55
+
56
+ # @shim: since `present?` is always true, `presence` always returns `self`
57
+ sig { returns(T.self_type) }
58
+ def presence; end
59
+
60
+ # @shim: since `blank?` is always false, `present?` always returns `true`
61
+ sig { returns(TrueClass) }
62
+ def present?; end
63
+ end
64
+
65
+ class Object
66
+ sig { returns(T::Boolean) }
67
+ def blank?; end
68
+
69
+ sig { returns(FalseClass) }
70
+ def html_safe?; end
71
+
72
+ sig { returns(T.nilable(T.self_type)) }
73
+ def presence; end
74
+
75
+ sig { params(another_object: T.untyped).returns(T.nilable(T.self_type)) }
76
+ def presence_in(another_object); end
77
+
78
+ sig { returns(T::Boolean) }
79
+ def present?; end
80
+ end
81
+
82
+ class Hash
83
+ sig { returns(T::Boolean) }
84
+ def blank?; end
85
+
86
+ sig { returns(T::Boolean) }
87
+ def present?; end
88
+
89
+ sig { returns(T::Boolean) }
90
+ def extractable_options?; end
91
+
92
+ # @version >= 6.1.0
93
+ sig { returns(T::Hash[K, V]) }
94
+ def compact_blank; end
95
+ end
96
+
97
+ class Array
98
+ sig { returns(T::Boolean) }
99
+ def blank?; end
100
+
101
+ sig { returns(T::Boolean) }
102
+ def present?; end
103
+
104
+ sig { params(position: Integer).returns(T.self_type) }
105
+ def from(position); end
106
+
107
+ sig { params(position: Integer).returns(T.self_type) }
108
+ def to(position); end
109
+
110
+ sig { params(elements: T.untyped).returns(T::Array[T.untyped]) }
111
+ def including(*elements); end
112
+
113
+ sig { params(elements: T.untyped).returns(T.self_type) }
114
+ def excluding(*elements); end
115
+
116
+ sig { params(elements: T.untyped).returns(T.self_type) }
117
+ def without(*elements); end
118
+
119
+ sig { returns(T.nilable(Elem)) }
120
+ def second; end
121
+
122
+ sig { returns(T.nilable(Elem)) }
123
+ def third; end
124
+
125
+ sig { returns(T.nilable(Elem)) }
126
+ def fourth; end
127
+
128
+ sig { returns(T.nilable(Elem)) }
129
+ def fifth; end
130
+
131
+ sig { returns(T.nilable(Elem)) }
132
+ def forty_two; end
133
+
134
+ sig { returns(T.nilable(Elem)) }
135
+ def third_to_last; end
136
+
137
+ sig { returns(T.nilable(Elem)) }
138
+ def second_to_last; end
139
+
140
+ sig { params(options: T::Hash[T.untyped, T.untyped]).returns(String) }
141
+ def to_sentence(options = {}); end
142
+
143
+ sig { params(format: Symbol).returns(String) }
144
+ def to_fs(format = :default); end
145
+
146
+ sig { params(format: Symbol).returns(String) }
147
+ def to_formatted_s(format = :default); end
148
+
149
+ sig { returns(String) }
150
+ def to_xml; end
151
+
152
+ sig { returns(T::Hash[T.untyped, T.untyped]) }
153
+ def extract_options!; end
154
+
155
+ sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) }
156
+ def in_groups(number, fill_with = T.unsafe(nil), &block); end
157
+
158
+ sig { type_parameters(:FillType).params(number: Integer, fill_with: T.type_parameter(:FillType), block: T.nilable(T.proc.params(group: T::Array[T.any(Elem, T.type_parameter(:FillType))]).void)).returns(T::Array[T::Array[T.any(Elem, T.type_parameter(:FillType))]]) }
159
+ def in_groups_of(number, fill_with = T.unsafe(nil), &block); end
160
+
161
+ sig { params(value: T.untyped, block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T::Array[T::Array[Elem]]) }
162
+ def split(value = nil, &block); end
163
+
164
+ sig { params(block: T.nilable(T.proc.params(element: Elem).returns(T.untyped))).returns(T.any(T::Array[Elem], T::Enumerator[Elem])) }
165
+ def extract!(&block); end
166
+
167
+ sig { returns(ActiveSupport::ArrayInquirer) }
168
+ def inquiry; end
169
+
170
+ sig { params(object: T.untyped).returns(T::Array[T.untyped]) }
171
+ def self.wrap(object); end
172
+ end
173
+
174
+ class Date
175
+ sig { returns(FalseClass) }
176
+ def blank?; end
177
+
178
+ # @shim: since `present?` is always true, `presence` always returns `self`
179
+ sig { returns(T.self_type) }
180
+ def presence; end
181
+
182
+ # @shim: since `blank?` is always false, `present?` always returns `true`
183
+ sig { returns(TrueClass) }
184
+ def present?; end
185
+ end
186
+
187
+ class DateTime
188
+ sig { returns(FalseClass) }
189
+ def blank?; end
190
+
191
+ # @shim: since `present?` is always true, `presence` always returns `self`
192
+ sig { returns(T.self_type) }
193
+ def presence; end
194
+
195
+ # @shim: since `blank?` is always false, `present?` always returns `true`
196
+ sig { returns(TrueClass) }
197
+ def present?; end
198
+ end
199
+
200
+ module Enumerable
201
+ sig { type_parameters(:Block).params(block: T.proc.params(arg0: Elem).returns(T.type_parameter(:Block))).returns(T::Hash[T.type_parameter(:Block), Elem]) }
202
+ sig { returns(T::Enumerable[T.untyped]) }
203
+ def index_by(&block); end
204
+
205
+ sig { type_parameters(:Block).params(block: T.proc.params(arg0: Elem).returns(T.type_parameter(:Block))).returns(T::Hash[Elem, T.type_parameter(:Block)]) }
206
+ sig { returns(T::Enumerable[T.untyped]) }
207
+ sig { type_parameters(:Default).params(default: T.type_parameter(:Default)).returns(T::Hash[Elem, T.type_parameter(:Default)]) }
208
+ def index_with(default = nil, &block); end
209
+
210
+ sig { params(block: T.proc.params(arg0: Elem).returns(BasicObject)).returns(T::Boolean) }
211
+ sig { returns(T::Boolean) }
212
+ def many?(&block); end
213
+
214
+ sig { params(object: BasicObject).returns(T::Boolean) }
215
+ def exclude?(object); end
216
+
217
+ # @version >= 6.1.0
218
+ sig { returns(T::Array[Elem]) }
219
+ def compact_blank; end
220
+
221
+ # @version >= 7.0.0
222
+ sig { returns(Elem) }
223
+ def sole; end
224
+ end
225
+
226
+ class NilClass
227
+ sig { returns(TrueClass) }
228
+ def blank?; end
229
+
230
+ # @shim: since `present?` is always false, `presence` always returns `nil`
231
+ sig { returns(NilClass) }
232
+ def presence; end
233
+
234
+ # @shim: since `blank?` is always true, `present?` always returns `false`
235
+ sig { returns(FalseClass) }
236
+ def present?; end
237
+ end
238
+
239
+ class FalseClass
240
+ sig { returns(TrueClass) }
241
+ def blank?; end
242
+
243
+ # @shim: since `present?` is always false, `presence` always returns `nil`
244
+ sig { returns(NilClass) }
245
+ def presence; end
246
+
247
+ # @shim: since `blank?` is always true, `present?` always returns `false`
248
+ sig { returns(FalseClass) }
249
+ def present?; end
250
+ end
251
+
252
+ class TrueClass
253
+ sig { returns(FalseClass) }
254
+ def blank?; end
255
+
256
+ # @shim: since `present?` is always true, `presence` always returns `self`
257
+ sig { returns(T.self_type) }
258
+ def presence; end
259
+
260
+ # @shim: since `blank?` is always false, `present?` always returns `true`
261
+ sig { returns(TrueClass) }
262
+ def present?; end
263
+ end
264
+
265
+ class Numeric
266
+ sig { returns(FalseClass) }
267
+ def blank?; end
268
+
269
+ sig { returns(TrueClass) }
270
+ def html_safe?; end
271
+
272
+ # @shim: since `present?` is always true, `presence` always returns `self`
273
+ sig { returns(T.self_type) }
274
+ def presence; end
275
+
276
+ # @shim: since `blank?` is always false, `present?` always returns `true`
277
+ sig { returns(TrueClass) }
278
+ def present?; end
279
+ end
280
+
281
+ class Time
282
+ sig { returns(FalseClass) }
283
+ def blank?; end
284
+
285
+ # @shim: since `present?` is always true, `presence` always returns `self`
286
+ sig { returns(T.self_type) }
287
+ def presence; end
288
+
289
+ # @shim: since `blank?` is always false, `present?` always returns `true`
290
+ sig { returns(TrueClass) }
291
+ def present?; end
292
+
293
+ sig { returns(ActiveSupport::TimeZone) }
294
+ def self.zone; end
295
+
296
+ sig { returns(T.any(ActiveSupport::TimeWithZone, ::Time)) }
297
+ def self.current; end
298
+ end
299
+
300
+ class Symbol
301
+ sig { returns(T::Boolean) }
302
+ def blank?; end
303
+
304
+ sig { returns(T::Boolean) }
305
+ def present?; end
306
+
307
+ # alias for `#start_with?`
308
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
309
+ def starts_with?(*string_or_regexp); end
310
+
311
+ # alias for `#end_with?`
312
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
313
+ def ends_with?(*string_or_regexp); end
314
+ end
315
+
316
+ class String
317
+ sig { returns(TrueClass) }
318
+ def acts_like_string?; end
319
+
320
+ # This is the subset of `#[]` sigs that have just 1 parameter.
321
+ # https://github.com/sorbet/sorbet/blob/40ad87b4dc7be23fa00c1369ac9f927053c68907/rbi/core/string.rbi#L270-L303
322
+ sig { params(position: Integer).returns(T.nilable(String)) }
323
+ sig { params(position: T.any(T::Range[Integer], Regexp)).returns(T.nilable(String)) }
324
+ sig { params(position: String).returns(T.nilable(String)) }
325
+ def at(position); end
326
+
327
+ sig { returns(String) }
328
+ def as_json; end
329
+
330
+ sig { returns(T::Boolean) }
331
+ def blank?; end
332
+
333
+ sig { params(first_letter: Symbol).returns(String) }
334
+ def camelcase(first_letter = :upper); end
335
+
336
+ sig { params(first_letter: Symbol).returns(String) }
337
+ def camelize(first_letter = :upper); end
338
+
339
+ sig { returns(String) }
340
+ def classify; end
341
+
342
+ sig { returns(T.untyped) }
343
+ def constantize; end
344
+
345
+ sig { returns(String) }
346
+ def dasherize; end
347
+
348
+ sig { returns(String) }
349
+ def deconstantize; end
350
+
351
+ sig { returns(String) }
352
+ def demodulize; end
353
+
354
+ # alias for `#end_with?`
355
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
356
+ def ends_with?(*string_or_regexp); end
357
+
358
+ sig { returns(String) }
359
+ def downcase_first; end
360
+
361
+ sig { params(string: String).returns(T::Boolean) }
362
+ def exclude?(string); end
363
+
364
+ sig { params(limit: Integer).returns(String) }
365
+ def first(limit = 1); end
366
+
367
+ sig { params(separate_class_name_and_id_with_underscore: T::Boolean).returns(String) }
368
+ def foreign_key(separate_class_name_and_id_with_underscore = true); end
369
+
370
+ sig { params(position: Integer).returns(String) }
371
+ def from(position); end
372
+
373
+ sig { returns(ActiveSupport::SafeBuffer) }
374
+ def html_safe; end
375
+
376
+ sig { params(capitalize: T::Boolean, keep_id_suffix: T::Boolean).returns(String) }
377
+ def humanize(capitalize: true, keep_id_suffix: false); end
378
+
379
+ sig { params(zone: T.nilable(T.any(ActiveSupport::TimeZone, String))).returns(T.any(ActiveSupport::TimeWithZone, Time)) }
380
+ def in_time_zone(zone = ::Time.zone); end
381
+
382
+ sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(String) }
383
+ def indent(amount, indent_string = nil, indent_empty_lines = false); end
384
+
385
+ sig { params(amount: Integer, indent_string: T.nilable(String), indent_empty_lines: T::Boolean).returns(T.nilable(String)) }
386
+ def indent!(amount, indent_string = nil, indent_empty_lines = false); end
387
+
388
+ sig { returns(ActiveSupport::StringInquirer) }
389
+ def inquiry; end
390
+
391
+ sig { returns(T::Boolean) }
392
+ def is_utf8?; end
393
+
394
+ sig { params(limit: Integer).returns(String) }
395
+ def last(limit = 1); end
396
+
397
+ sig { returns(ActiveSupport::Multibyte::Chars) }
398
+ def mb_chars; end
399
+
400
+ sig { params(separator: String, preserve_case: T::Boolean, locale: T.nilable(Symbol)).returns(String) }
401
+ def parameterize(separator: "-", preserve_case: false, locale: nil); end
402
+
403
+ sig { params(count: T.nilable(T.any(Integer, Symbol)), locale: T.nilable(Symbol)).returns(String) }
404
+ def pluralize(count = nil, locale = :en); end
405
+
406
+ sig { returns(T::Boolean) }
407
+ def present?; end
408
+
409
+ sig { params(patterns: T.any(String, Regexp)).returns(String) }
410
+ def remove(*patterns); end
411
+
412
+ sig { params(patterns: T.any(String, Regexp)).returns(String) }
413
+ def remove!(*patterns); end
414
+
415
+ sig { returns(T.untyped) }
416
+ def safe_constantize; end
417
+
418
+ sig { params(locale: Symbol).returns(String) }
419
+ def singularize(locale = :en); end
420
+
421
+ sig { returns(String) }
422
+ def squish; end
423
+
424
+ sig { returns(String) }
425
+ def squish!; end
426
+
427
+ # alias for `#start_with?`
428
+ sig { params(string_or_regexp: T.any(String, Regexp)).returns(T::Boolean) }
429
+ def starts_with?(*string_or_regexp); end
430
+
431
+ sig { returns(String) }
432
+ def strip_heredoc; end
433
+
434
+ sig { returns(String) }
435
+ def tableize; end
436
+
437
+ sig { params(keep_id_suffix: T::Boolean).returns(String) }
438
+ def titlecase(keep_id_suffix: false); end
439
+
440
+ sig { params(keep_id_suffix: T::Boolean).returns(String) }
441
+ def titleize(keep_id_suffix: false); end
442
+
443
+ sig { params(position: Integer).returns(String) }
444
+ def to(position); end
445
+
446
+ sig { returns(::Date) }
447
+ def to_date; end
448
+
449
+ sig { returns(::DateTime) }
450
+ def to_datetime; end
451
+
452
+ sig { params(form: T.nilable(Symbol)).returns(T.nilable(Time)) }
453
+ def to_time(form = :local); end
454
+
455
+ sig { params(truncate_to: Integer, options: T::Hash[Symbol, T.anything]).returns(String) }
456
+ def truncate(truncate_to, options = {}); end
457
+
458
+ sig { params(truncate_to: Integer, omission: T.nilable(String)).returns(String) }
459
+ def truncate_bytes(truncate_to, omission: "…"); end
460
+
461
+ sig { params(words_count: Integer, options: T::Hash[Symbol, T.anything]).returns(String) }
462
+ def truncate_words(words_count, options = {}); end
463
+
464
+ sig { returns(String) }
465
+ def underscore; end
466
+
467
+ sig { returns(String) }
468
+ def upcase_first; end
469
+ end
470
+
471
+ class ActiveSupport::ErrorReporter
472
+ # @version >= 7.1.0.beta1
473
+ sig { type_parameters(:Block, :Fallback).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), fallback: T.nilable(T.proc.returns(T.type_parameter(:Fallback))), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.any(T.type_parameter(:Block), T.type_parameter(:Fallback))) }
474
+ def handle(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), fallback: T.unsafe(nil), source: T.unsafe(nil), &blk); end
475
+
476
+ # @version >= 7.1.0.beta1
477
+ sig { type_parameters(:Block).params(error_classes: T.class_of(Exception), severity: T.nilable(Symbol), context: T.nilable(T::Hash[Symbol, T.untyped]), source: T.nilable(String), blk: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) }
478
+ def record(*error_classes, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil), &blk); end
479
+
480
+ # @version >= 7.1.0.beta1
481
+ sig { params(error: Exception, handled: T::Boolean, severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void }
482
+ def report(error, handled: true, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
483
+
484
+ # @version >= 7.2.0.beta1
485
+ sig { params(error: T.any(Exception, String), severity: T.nilable(Symbol), context: T::Hash[Symbol, T.untyped], source: T.nilable(String)).void }
486
+ def unexpected(error, severity: T.unsafe(nil), context: T.unsafe(nil), source: T.unsafe(nil)); end
487
+ end
488
+
489
+ module ActiveSupport::Testing::Assertions
490
+ sig { type_parameters(:Block).params(block: T.proc.returns(T.type_parameter(:Block))).returns(T.type_parameter(:Block)) }
491
+ def assert_nothing_raised(&block); end
492
+
493
+ sig { type_parameters(:TResult).params(expression: T.any(Proc, Kernel), message: Kernel, from: T.anything, to: T.anything, block: T.proc.returns(T.type_parameter(:TResult))).returns(T.type_parameter(:TResult)) }
494
+ def assert_changes(expression, message = T.unsafe(nil), from: T.unsafe(nil), to: T.unsafe(nil), &block); end
495
+ end
@@ -0,0 +1,17 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This file was pulled from a central RBI files repository.
5
+ # Please run `bin/tapioca annotations` to update it.
6
+
7
+ module Faraday
8
+ class << self
9
+ sig { params(url: T.untyped, options: T::Hash[Symbol, T.untyped], block: T.nilable(T.proc.params(connection: Faraday::Connection).void)).returns(Faraday::Connection) }
10
+ def new(url = nil, options = {}, &block); end
11
+ end
12
+ end
13
+
14
+ class Faraday::Response
15
+ sig { returns(T::Boolean) }
16
+ def success?; end
17
+ end