Skip to content

Commit 405ad90

Browse files
committed
improve Command#catch_all_label
1 parent 374db71 commit 405ad90

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

lib/bashly/script/command.rb

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,11 @@ def caption_string
3232

3333
# Returns a label for the catch_all directive
3434
def catch_all_label
35-
return nil unless catch_all
36-
37-
if catch_all.is_a? String
38-
"#{catch_all.upcase}..."
39-
elsif catch_all.is_a?(Hash)
40-
"#{catch_all['label'].upcase}..."
41-
else
42-
"..."
35+
case catch_all
36+
when nil then nil
37+
when String then "#{catch_all.upcase}..."
38+
when Hash then "#{catch_all['label'].upcase}..."
39+
else "..."
4340
end
4441
end
4542

0 commit comments

Comments
 (0)