-
Notifications
You must be signed in to change notification settings - Fork 2
More tests, add filename
to Torrent, fast Database#include? method
#14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I suggest so squash something if you can and eventually fix |
@@ -0,0 +1,5 @@ | |||
nguage: ruby |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is that a typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
For me now we're ok 👍 @hydride0? |
Please wait until a patch for this issue is added (test has to be un-skipped and code modified to guarantee uniqueness) |
Ok, fixed the filename non-uniqueness. Ok for me too. |
Good, can you also squash something too? There a lots of commits there. Then let's wait for @hydride0. |
Torrent.filename: it'll contain the path a torrent was downloaded to. Add tests: Yamazaki now has more tests, covering the usual behaviour of the library. A travis.yml has been added too. `Database#size` returns the number of saved items inside the database.
…database also refactor spec_helper a bit
Switching to Array#bsearch (with database sorting) makes yamazaki a lot faster (25-56x)
ruby1.9.3 is removed because `Array#bsearch` is not supported from <2.x ruby releases Roxas noticed a lot of imperfections and little problems, they're fixed now.
Filenames should be considered unique in the database, so duplicates are not allowed. If duplicates are present in the source file, they won't be deleted after the JSON load (and it would be very, very time consuming to do this, unless we switch to hashtables).
Fake database files were created under `/tmp`, and it may break compatibility with non-posix platform. Moreover they were not deleted, leaving a lot of random files around: now they are.
669ef4f
to
686ec74
Compare
squashed and forced things, is it ok for you @RoxasShadow ? |
👍 |
More tests, add `filename` to Torrent, fast Database#include? method
\o/ |
I'm sorry I did not make separated Pull Requests, but I got carried out and pushed too much.
This PR adds some tests (and travis-ci support!) to yamazaki libraries.
filename
to Torrent classThis modification is needed for some modifications in Miyuki, but it may be useful for several clients who just want to know where are the downloaded torrents.
Database#include?
methodTrack databases will only grow larger and larger, even though the rate is low. It should be noted that clients will perform more searches than insertions, so a faster
#include
is key to a faster Yamazaki. Yes, 56x faster.Unfortunately, the modification requires
Array#bsearch
, which is available only on ruby 2.x. Let me know if you think it has to be compatible with 1.9.x rubies (still shipped by LTS linux distros), we can get around it.