Skip to content
This repository was archived by the owner on Oct 22, 2020. It is now read-only.

Commit 93125d9

Browse files
committed
Remove new lines prior to module desc wrapping
1 parent cb05b5f commit 93125d9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/cli/module_info.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def print_description
1616
if context.module.module_description_preformatted
1717
print_std(indent_without_wrap(context.module.module_desc))
1818
else
19-
print_std(wrap_text(context.module.module_desc))
19+
print_std(wrap_text(context.module.module_desc).strip)
2020
end
2121
end
2222
end

lib/cli/output.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ def indent_cursor(level = 1)
88
end
99

1010
def wrap_text(s, padding = 0, width = 78)
11-
s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n#{@indent * @indent_level}#{' ' * padding}").chomp
11+
s.tr("\n", '')
12+
.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n#{@indent * @indent_level}#{' ' * padding}").chomp
1213
.gsub(/\s+$/, '')
1314
end
1415

0 commit comments

Comments
 (0)