Skip to content

Commit

Permalink
the #!hint marker overrides everything.
Browse files Browse the repository at this point in the history
  • Loading branch information
apotonick committed Nov 14, 2023
1 parent 6edd395 commit 10d24b6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/trailblazer/core/utils/convert_operation_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ def self.call(filepath, target:, source_gem:)
# puts "@@@@@ #{line.inspect}"
line = ""
else
line = line.sub("< Trailblazer::Activity::Railway", "< Trailblazer::Operation")
line = line.gsub("::Activity", "::Operation")

if match = line.match(/#!hint (.+)/)
ws = line.match(/^(\s+)/) # Find out number of whitespace before code starts.

line = (" " * ws[1].size) + match[1] + "\n"
else
line = line.sub("< Trailblazer::Activity::Railway", "< Trailblazer::Operation")
line = line.gsub("::Activity", "::Operation")

# if within_marker
line = line.sub("signal, (ctx, _) =", "result =")
Expand Down

0 comments on commit 10d24b6

Please sign in to comment.