Class: Byebug::WidthSetting
- Defined in:
- lib/byebug/settings/width.rb
Instance Attribute Summary
Attributes inherited from Setting
Instance Method Summary collapse
- #help ⇒ Object
-
#initialize ⇒ WidthSetting
constructor
A new instance of WidthSetting.
- #to_s ⇒ Object
Methods inherited from Setting
[], []=, #boolean?, boolean?, exists?, find, format, #integer?, integer?, load, settings, #to_sym
Constructor Details
#initialize ⇒ WidthSetting
Returns a new instance of WidthSetting.
3 4 5 6 7 8 9 10 11 |
# File 'lib/byebug/settings/width.rb', line 3 def initialize if ENV['COLUMNS'] =~ /^\d+$/ @value = ENV['COLUMNS'].to_i elsif STDIN.tty? && exists?('stty') @value = `stty size`.scan(/\d+/)[1].to_i else @value = 160 end end |
Instance Method Details
#help ⇒ Object
13 14 15 |
# File 'lib/byebug/settings/width.rb', line 13 def help "Number of characters per line in byebug's output" end |
#to_s ⇒ Object
17 18 19 |
# File 'lib/byebug/settings/width.rb', line 17 def to_s "Maximum width of byebug's output is #{value}" end |