Append version string to engine-dir

Hi,
I’m a developer of the Rails-CMS RailFrog (www.railfrog.com). We want to
use RailsEngines as part of our plugin system. So far it works great but
now we want to append a version string to the engine-dir (i.e.
railfrog_admin_ui-0.5.3), so that the user can have multiple versions of
the same engine in /vendor/plugins with only one being active at one
time. But since RailsEngines uses the directory name to get the engine
name, migrations from one version to another won’t work because migrate
uses the engine name with the version string in the schema info table.
So my question is, if either there is a way to set the engine name
manually or if you think that it would be a good idea to replace the
current naming convention with one that supports this kind of directory
names and uses the name before the version string as engine name.

Thanks
Daniel

It seems like inviting trouble to have multiple versions of a
particular framework or plugin sitting side-by-side in the location
from which they are loaded. Certainly this is going to be problematic
if engines ever start up automatically (like plugins do, and this
may happen).

With this in mind, I’d recommend that you use an alternative strategy.
One suggestion might be to store your multiple copies in
/vendor/some_other_dir, and create symlinks (or just delete and
re-copy on Windows) to the particular version you want. Another option
might be to use SVN, either directly or via some set of rake tasks, to
up/downgrade the engine at will, and migrate the engine down and back
up to the latest set of migrations for that particular version of the
engine. Again - getting complex, and the recommended mechanism for
performing engine migrations is going to change in a not-too-distant
version too.

I guess in summary - not really a good idea to hve multiple version of
the same component sitting in a directory where things might get
automatically loaded.

Incidentally, why did you want the user to have multiple versions?

  • james

On 5/2/06, Daniel S. [email protected] wrote:

manually or if you think that it would be a good idea to replace the

  • J *
    ~

“James A.” [email protected] wrote in
message
news:[email protected]

One suggestion might be to store your multiple copies in
/vendor/some_other_dir, and create symlinks (or just delete and
re-copy on Windows) to the particular version you want.

Just want to mention that Windows NT based OSes have the ability to do
hard
links in NTFS file systems. They are called reparse points and the
resource
kits for your particular OS flavor have a utility that can create them.
Alternatively, Sysinternals has a free little utility named Junction
that
can be used to create them as well.

Very handy for solving this type of problem in the same way you’d use
symlinks to solve it on *nix.

Daniel