roast-ai 0.5.0 → 0.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ee882d792c1c09ecc9a023aa1f26825dff3442a8c4152da789078157e26540e
4
- data.tar.gz: 51d5d1238e32c5ad6ce9f3d24c3d224d0709da3f3da4e10905f75049dd02f6d7
3
+ metadata.gz: e19ea3373017e147359ddf4c1f6ccf340bd7d7ac50a870be68f78f15cf80b5d8
4
+ data.tar.gz: c6fb3bc056f2112ced9719aef312bb8ed2d2ccbd2eac6e44996ab329b36722b8
5
5
  SHA512:
6
- metadata.gz: 440bdf957c01418d111bdea73de04b707baf7034f1277ddc5c78fa09ee68833cf1f4538d0f0a5eb691ece68f9c80ad9f159949b818658e4a97ef029a6ec999a3
7
- data.tar.gz: dc01a98d049b9fae42a28697bb09eacf9dc0766c734eafa6bd1bc1402d8c50109d79d5e03304a3e9914e92a718a4fbbd5cf58cbb7beeeee46a643aa167090e5a
6
+ metadata.gz: b8cf9c2e98c8475f64a4b81cb002ccd254fd483cf97fd718eb9a07952b2423965c7813ea212110819456793c37d412bbdd808ef35d3f176085768bde9ddce9e7
7
+ data.tar.gz: 0bf31300a5a3463211435ede98a8826a3dfcf8207198184aada65ce1f0e64efeb8ac78a1b4b3fa41dbfb03b7337f63076186c5bd02ff849ee789796e3b4060de
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.4.2
1
+ 3.4.7
data/Gemfile.lock CHANGED
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- roast-ai (0.5.0)
11
+ roast-ai (0.5.1)
12
12
  activesupport (>= 7.0)
13
13
  async (~> 2.34)
14
14
  benchmark (~> 0.4.1)
data/dsl/next_break.rb CHANGED
@@ -17,6 +17,11 @@ execute do
17
17
  puts "Iteration #{index}: #{iteration_results.presence || "did not run at all"}"
18
18
  end
19
19
  end
20
+
21
+ call(:once, run: :loop_body) do |my|
22
+ my.value = 1
23
+ my.index = 1
24
+ end
20
25
  end
21
26
 
22
27
  execute(:loop_body) do
data/exe/roast CHANGED
@@ -13,5 +13,5 @@ unshift_path.call("lib")
13
13
  require "bundler/setup"
14
14
  require "roast"
15
15
 
16
- $stderr.puts "🔥🔥🔥 Everyone loves a good roast 🔥🔥🔥\n\n"
16
+ $stderr.puts "🔥🔥🔥 Everyone loves a good roast 🔥🔥🔥\n\n" if $stderr.tty?
17
17
  Roast::CLI.start(ARGV)
@@ -231,7 +231,7 @@ module Roast
231
231
  #
232
232
  #: () -> bool
233
233
  def abort_on_failure?
234
- @values[:abort_on_failure] ||= true
234
+ !!@values[:abort_on_failure]
235
235
  end
236
236
 
237
237
  # Configure the cog to run external commands in the specified working directory
@@ -310,6 +310,9 @@ module Roast
310
310
  stdout_handler: stdout_handler,
311
311
  stderr_handler: stderr_handler,
312
312
  )
313
+ if !status.success? && config.fail_on_error?
314
+ raise ControlFlow::FailCog, "Process exited with status code #{status.exitstatus}"
315
+ end
313
316
 
314
317
  Output.new(stdout, stderr, status)
315
318
  end
@@ -65,7 +65,7 @@ module Roast
65
65
  stdin, stdout, stderr, wait_thread = Open3 #: as untyped
66
66
  .popen3(
67
67
  { "PWD" => working_directory&.to_s }.compact,
68
- *args,
68
+ *args.map(&:to_s),
69
69
  { chdir: working_directory }.compact,
70
70
  )
71
71
  stdin.puts stdin_content if stdin_content.present?
@@ -106,9 +106,10 @@ module Roast
106
106
  em.prepare!
107
107
  begin
108
108
  em.run!
109
- rescue ControlFlow::Break
109
+ rescue ControlFlow::Next, ControlFlow::Break
110
110
  # treat `break!` like `next!` in a `call` invocation
111
- # TODO: maybe do something with the message passed to break!
111
+ # just end the execution early and return like normal
112
+ # TODO: maybe do something with the message passed to next! or break!
112
113
  end
113
114
  Output.new(em)
114
115
  end
@@ -292,6 +292,9 @@ module Roast
292
292
  ems << em = create_execution_manager_for_map_item(run, item, index + input.initial_index)
293
293
  em.prepare!
294
294
  em.run!
295
+ rescue ControlFlow::Next
296
+ # TODO: do something with the message passed to next!
297
+ # proceed to next iteration
295
298
  rescue ControlFlow::Break
296
299
  # TODO: do something with the message passed to break!
297
300
  break
@@ -311,6 +314,9 @@ module Roast
311
314
  ems[index] = em = create_execution_manager_for_map_item(run, item, index + input.initial_index)
312
315
  em.prepare!
313
316
  em.run!
317
+ rescue ControlFlow::Next
318
+ # TODO: do something with the message passed to next!
319
+ # proceed to next iteration
314
320
  end
315
321
  end #: Array[Async::Task]
316
322
 
@@ -7,7 +7,7 @@ require "minitest"
7
7
  # Disable the built-in `at_exit` hook for Minitest before anything else
8
8
  module Minitest
9
9
  class << self
10
- alias_method :original_at_exit, :at_exit
10
+ alias_method :original2_at_exit, :at_exit
11
11
  def at_exit(*)
12
12
  # Do nothing to prevent autorun hooks
13
13
  end
data/lib/roast/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
  # frozen_string_literal: true
3
3
 
4
4
  module Roast
5
- VERSION = "0.5.0"
5
+ VERSION = "0.5.1"
6
6
  end
data/lib/roast.rb CHANGED
@@ -83,7 +83,7 @@ module Roast
83
83
  workflow_path, *files = paths
84
84
 
85
85
  if options[:executor] == "dsl"
86
- $stderr.puts "⚠️ WARNING: You are using Roast 1.0 feature preview. This syntax has not yet been officially released and should not be considered fully stable."
86
+ $stderr.puts "⚠️ WARNING: You are using Roast 1.0 feature preview. This syntax has not yet been officially released and should not be considered fully stable." if $stderr.tty?
87
87
  targets, workflow_args, workflow_kwargs = parse_custom_workflow_args(files, ARGV)
88
88
  targets.unshift(options[:target]) if options[:target]
89
89
  workflow_params = Roast::DSL::WorkflowParams.new(targets, workflow_args, workflow_kwargs)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: roast-ai
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify