Skip to content

Latest commit

 

History

History
23 lines (15 loc) · 491 Bytes

File metadata and controls

23 lines (15 loc) · 491 Bytes

LoadingBar in ruby

How to use :

call LoadingBar.output in each of the iterations of your program

Output takes two arguments : The current progression and the total progression.

If you have already calculated your completion rate (in %), you can simply print LoadingBar.output_string(completion_rate)

Exemple use :

start = 0
51.times do 
	# Using print is very important! Do not use p or puts !
	print(LoadingBar.output(start, 50))
	sleep(0.1)
	start +=1
end