# File lib/nanoc/cli/commands/compile.rb, line 217 def start_filter_progress(rep, filter_name) # Only show progress on terminals return if !$stdout.tty? @progress_thread = Thread.new do delay = 1.0 step = 0 text = "Running #{filter_name} filter… " while !Thread.current[:stopped] sleep 0.1 # Wait for a while before showing text delay -= 0.1 next if delay > 0.05 # Print progress $stdout.print text + %w( | / - \\ )[step] + "\r" step = (step + 1) % 4 end # Clear text if delay < 0.05 $stdout.print ' ' * (text.length + 1 + 1) + "\r" end end end