Be careful when using read_multi with dalli: it may return nil-valued key instead of the correct key.
The issue is tracked here and thanks to this I dropped the read_multi usage in moebooru and used the much simpler (and most likely slower) single fetch (per entry) instead. There’s alternative way to use it – do a read_multi and refetch whatever missing/nil-keyed but apparently I’m too lazy to do it.
Finally reached the goal: Rails 3.2.6. The isn’t much change between 3.1 and 3.2 which is why I skipped 3.1. As there isn’t much front-end change, it means there isn’t any user-visible changes. Or at least there shouldn’t be.
Move to jQuery
Use paper_trail for versioning (or something else)
Add SVG support (and maybe drop SWF support)
Actual news ticker
3.2.0 has been branched and currently running on yande.re (and konachan). The next version, 3.2.1 is on default branch and being tested on moe.myconan.net. As (finally) there are database changes, it will not be tested directly on yande.re until it is stable enough.
Changes include better support for JRuby, use mini_magick instead of custom plug-in, less monkey-patches (but more bugs), and various clean-ups.
Update config.ru to understand the subdirectory mapping:
map (ENV['RAILS_RELATIVE_URL_ROOT'] || '/') do
And then start Rails with correct environment variable (example if you use Unicorn):
And that’s it. No need to mess with routes.rb as I previously thought after searching and experimenting for few hours. Links etc are properly generated with correct prefix. Or at least based on my quick testing.
May or may not work with earlier version(s) as I haven’t bothered to test it anywhere else.
After working on it for several weeks, finally it got to the point where it’s relatively usable. No more Bundler-on-Rails2 evilry and the fact that 3.0 branch is still supported.
The best part is the one above. Yes, Moebooru now runs on Rubinius/Puma. The only foreseeable problem is it uses Process.pid on file uploads which, when several people uploading (or working with) files at same time, the temporary filename will collide.
Though due to me aiming more for workable implementation instead of correct implementation, there are quite a lot legacy stuff still in there:
repeated_auto_complete doesn’t work in Rails 3 without vendoring or updating the gem itself (and I did both since Bundler’s git functionality seems broken in Rubinius).
prototype_legacy_helper must be used since I haven’t had time to upgrade the *_remote functions (and still thinking how to do it).
verification gem since I haven’t upgraded the route and its functionality, which previously built-in in Rails 2.3 has now removed.
Unsightly lib/core_ext. Just look at evilry I have added to make it behave like 2.3-stable.
On the brighter side, now I can start cleaning up the code. Or upgrade all the way to Rails 3.2 ( ¬‿¬)
And more!: I hope you didn’t expect me to do more while there are incomplete items above.
Sure looks good. Need more testing though. There’s also one part which I totally had no idea why should be changed when upgrading to 1.9. Just grep for FIXME to see which it is and hopefully fix it up for me (or explain what it does).
As usual, having completed the work for today, live demo is up and open for everyone to break (…if there’s anyone, that is).
bash initialization script, mainly tested on OpenIndiana but should also good for Linux, *BSD and other *nix
tcsh initialization script. Mainly tested on FreeBSD
my hgrc. Obviously shouldn’t be used as is except if you want to give me the copyright of whatever you’re committing
tmux config. Blue bars instead of green. And minor tweaking
vimrc. Guaranteed to break vim-lite or whatever the default vi in Ubuntu. Also shouldn’t be used for most administrative task where tab should be tab and it should be 8 spaces long. Mainly for ruby development.
inputrc. Makes various application using readline much more awesome – especially if you’re not emacs user
cek: check crc32 of a file and compares with the one in filename if exists. Useful for checking downloaded anime. Requires ruby
ed2k: generates ed2k link of a file. Useful for comparing against anidb database. Ruby is required.
putcrc: as the name says, puts crc32 of the file in its filename. Also requires ruby.
ren: rename anime files with whatever I like. In perl. Contains hundres of regexes. No test so it tends to break at unfortunate time.
This morning I randomly decided to try installing danbooru on Windows (7-x64). And indeed it works. Mostly.
Using mongrel and nginx since unicorn is not available on Windows.
Few things to note:
* system_timer is missing since I can’t seem to install it. Probably need to try ruby19 or ruby18-1.8.6-p27 (currently using ruby18-1.8.6-p383)
* manual initial database initialization since the script I made is specifically for *nix systems
* compiling danbooru_image_resizer is… *fun*
* for whatever reason I can’t install mongrel_service
* apparently there’s something missing. Or broken. Or both – there’s message “The system cannot find the path specified.” every time I start mongrel and do migrate
…anyone interested trying this on production server? 😛
_Last update 2011-07-18 21:01: formatting, also added rewrite rule for nginx to cope with uploaded media path change_