/usr/lib/ruby/vendor_ruby/thor/line_editor/basic.rb is in ruby-thor 0.19.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | class Thor
module LineEditor
class Basic
attr_reader :prompt, :options
def self.available?
true
end
def initialize(prompt, options)
@prompt = prompt
@options = options
end
def readline
$stdout.print(prompt)
get_input
end
private
def get_input
if echo?
$stdin.gets
else
$stdin.noecho(&:gets)
end
end
def echo?
options.fetch(:echo, true)
end
end
end
end
|