[ANN] MagicLoader 0.10.0: painless code dependency management

Discussion in 'Ruby' started by Tony Arcieri, Oct 26, 2010.

  1. Tony Arcieri

    Tony Arcieri Guest

    [Note: parts of this message were removed to make it a legal post.]

    Think Bundler for your require statements:

    Github: http://github.com/tarcieri/magicloader
    Gemcutter: http://rubygems.org/gems/magicloader

    MagicLoader uses a special algorithm to calculate the order in which various
    files in your project must be required in order for your project to load
    successfully. If you've been manually maintaining a dependencies list,
    MagicLoader provides for your code the same automation that Bundler provides
    for your gem dependencies.

    You can let MagicLoader loose on a big directory of code and it will figure
    out the require statement ordering and automatically write it out to a file
    of your choosing. Once it's worked its magic, MagicLoader writes the
    dependency list out to the given file in the form of a list of meticulously
    ordered require statements. You can even use MagicLoader once then never use
    it again, because the output is little different from what you might've
    thrown together manually.

    MagicLoader represents the evolution of the require_all gem (
    http://github.com/jarmo/require_all), except rather than calculating the
    dependency order at load time, MagicLoader lets you calculate it ahead of
    time in a sandboxed, thread-free environment, then write it out to a given
    file ensuring that your dependencies are precalculated and not subject to
    environmental challenges like threads or previously defined constants.

    TODO
    ----

    MagicLoader presently doesn't load your code under pristine conditions. It
    runs as a Rake task and thus brings with it everything which is already
    loaded in your Rake environment. You may very well be pulling in the
    MagicLoad target in your Rake environment ahead of time, which can break all
    sorts of things.

    To really be effective, MagicLoader needs a completely clean environment.
    The easiest way to implement this is to have a separate "magicload" script
    distributed with the gem that spawns a new, fresh Ruby interpreter and loads
    all your code there.

    In order for this to work effectively, MagicLoader needs some way of knowing
    all of the gem dependencies that need to get loaded before it attempts to
    load the given set of code. This requires at least one of two things (or
    preferably, support for both):

    - A way to specify a list of gem dependencies to be loaded when
    MagicLoader::Task.new is invoked.
    - An interface to Bundler to pull in your project's bundled Gem dependencies
    which you can pass to MagicLoader::Task.new.

    This remains the one unsolved problem preventing a MagicLoader 1.0.0
    release. Pull requests for this sort of functionality are welcomed!

    --
    Tony Arcieri
    Medioh! A Kudelski Brand
    Tony Arcieri, Oct 26, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Floris van Haaster

    Project management / bug management

    Floris van Haaster, Sep 23, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    1,229
    Jon Paal
    Sep 23, 2005
  2. Peter Beattie

    Painless way to do 3D visualization

    Peter Beattie, Oct 7, 2006, in forum: Python
    Replies:
    4
    Views:
    280
    Erik Max Francis
    Oct 8, 2006
  3. Tori
    Replies:
    1
    Views:
    339
  4. Tori
    Replies:
    1
    Views:
    340
  5. Adelbert Chang

    Dependency management in Python?

    Adelbert Chang, Jan 11, 2013, in forum: Python
    Replies:
    8
    Views:
    171
    Thomas Bach
    Jan 12, 2013
Loading...

Share This Page