= Hookin -- minimalist Ruby package manager Copyright (C) 2008 Christian Neukirchen Hookin is freely distributable under the terms of an MIT-style license. See COPYING or http://www.opensource.org/licenses/mit-license.php. == How to install Just copy bin/hookin into your $PATH and lib/hookin.rb into your Ruby library path. It is recommended to adapt $RUBYOPT to load Hookin automatically. == How to use Install new packages with hookin add PACKAGE LIBDIRS.... Remove old packages with hookin remove PACKAGE.... "Refresh" a package (that is, uninstall and reinstall from the old place) a package with hookin refresh PACKAGE. Check which packages need refreshing (if there differences between indexed and installed files) with hookin check --all. Print a list of installed packages with hookin installed. Print the files indexed for a package with hookin contents PACKAGE. == How Hookin works Hookin creates an index of which files belong to which packages and where they are located. "require"ing files in Ruby is adapted to first look into this index and find the file without scanning directories. The hookin index is created using the hookin tool, see above. The index is searched at these locations in this order: 1) The enviroment variable $HOOKINDB 2) The current directory (./hookin.db) 3) The user's home directory (~/.hookin.db) 4) The Ruby $LOADPATH (hookin.db) This allows to have global (4), user-specific (3), local (2) and overridable (1) Hookin indexes. Please note that only one index can be loaded at a time! The hookin utility defaults to *creating* the user-specific (3) index, override it by setting $HOOKINDB or touching the current-directory hookin.db first. The hookin utility defaults to *manipulating* modifying the first found index, override it by setting $HOOKINDB. == What Hookin doesn't do * track dependencies * track versions (but it will notice conflicts and path shadowings) * install programs to your path * install software automatically * move files around * make your programs slow The first four points will be addressed with future software. The last one already has been addressed by other package managers. Consider Hookin to be far more like "dpkg" than "apt-get". == Caveat user Please take note of these things: * Hookin *first* looks into the index, then falls back to the default require. Consider adding the Ruby stdlib to hookin. * Hookin will keep the index in main memory of the Ruby process, i.e. it will "bloat" all your Ruby processes that require other things roughly by the size of the index. Unless you install a huge amount of software, Hookin will still use less memory than other package managers due to it's compact implementation. If you really need to save memory (for example, because you have a big cluster of webservers), consider making a special index for your application or donate the index to garbage collection when you know nothing more will be required. (In Ruby, set $HOOKIN_DB = nil). The index will be reloaded on the next require. * Hookin is still experimental. It may break Ruby libraries that try to be clever by redefining +require+ or using dark corners in the behavior of +require+. (For example, require 'foobar.rb' will work if foobar.rb is in the load path, but not if it is only in the Hookin index. Use require 'foobar'.) == Contact Please mail bugs, suggestions and patches to . Darcs repository ("darcs send" is welcome for patches): http://chneukirchen.org/repos/hookin == Thanks to * Magnus Holm, for providing statistical data on big package sets. * Paul Feyerabend, for making me open my eyes. == Copyright Copyright (C) 2008 Christian Neukirchen Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.