# File lib/ruby-progressbar/output.rb, line 17 def self.detect(options = {}) if options[:output].is_a?(Class) && options[:output] <= ProgressBar::Output options[:output].new(options) elsif (options[:output] || DEFAULT_OUTPUT_STREAM).tty? Outputs::Tty.new(options) else Outputs::NonTty.new(options) end end