Skip to content

Commit c3bb746

Browse files
authored
Merge pull request #572 from sschuberth/master
Some minor code improvements
2 parents bbfdf33 + 1d81e25 commit c3bb746

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/thor/shell/basic.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
class Thor
22
module Shell
33
class Basic
4+
DEFAULT_TERMINAL_WIDTH = 80
5+
46
attr_accessor :base
57
attr_reader :padding
68

@@ -279,11 +281,11 @@ def terminal_width
279281
result = if ENV["THOR_COLUMNS"]
280282
ENV["THOR_COLUMNS"].to_i
281283
else
282-
unix? ? dynamic_width : 80
284+
unix? ? dynamic_width : DEFAULT_TERMINAL_WIDTH
283285
end
284-
result < 10 ? 80 : result
286+
result < 10 ? DEFAULT_TERMINAL_WIDTH : result
285287
rescue
286-
80
288+
DEFAULT_TERMINAL_WIDTH
287289
end
288290

289291
# Called if something goes wrong during the execution. This is used by Thor

0 commit comments

Comments
 (0)