We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ebf0cae commit 6784709Copy full SHA for 6784709
Rakefile
@@ -58,12 +58,13 @@ end
58
desc("Format `*.rbs`")
59
multitask(:"format:syntax_tree") do
60
find = %w[find ./sig -type f -name *.rbs -print0]
61
- inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? %w[-i''] : %w[-i]
+ inplace = /darwin|bsd/ =~ RUBY_PLATFORM ? ["-i", ""] : %w[-i]
62
uuid = SecureRandom.uuid
63
64
# `syntax_tree` has trouble with `rbs`'s class & module aliases
65
66
- sed = xargs + %w[sed -E] + inplace + %w[-e]
+ sed_bin = /darwin/ =~ RUBY_PLATFORM ? "/usr/bin/sed" : "sed"
67
+ sed = xargs + [sed_bin, "-E", *inplace, "-e"]
68
# annotate unprocessable aliases with a unique comment
69
pre = sed + ["s/(class|module) ([^ ]+) = (.+$)/# \\1 #{uuid}\\n\\2: \\3/", "--"]
70
fmt = xargs + %w[stree write --plugin=rbs --]
0 commit comments