Open notjames opened 4 months ago
I specifically used this tool to help me track the progress of my rails db:seed
command by creating a max element counter to replace the 100
and different incrementing commands throughout the db/seeds.rb
to track how far along it had progressed.
I extracted it as this gem to use it in my other projects.
Yes, you're right about it needing more documentation and explaining.
Assuming that you want the public to use this tool...
I'm considering using it and I've already started a quick implementation. My use-case is to show a progress bar for downloading a file. My problem is the following:
my read of this is that there is a manual sequential counter starting at 0 and incrementing to 100, but it doesn't make sense to me what real-world application this has as it's not tied to any objective purpose. It's just going to count from 0 to 100 with a sleep in the middle of .1 seconds.
This is not a real-world applicable use-case. I take it that the 0 to 100 sequence might be arbitrary in terms of the example? I decided to try using the file size (0 to size-of-file) as the sequence, but that doesn't work. In fact, the following code in an attempt to get this to work as expected failed:
all this does is produce a counter starting from zero incrementing every .1 seconds despite the fact that I'm pulling the size of the file. I'm assuming due to lack of documentation, I'm just missing something. I've briefly looked at the code but I need to look at it more in depth I believe.