Forum: Rails Engines development Append version string to engine-dir

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
277eae401957e894d53c2973a4658d2d?d=identicon&s=25 Daniel Siemssen (Guest)
on 2006-05-03 18:59
(Received via mailing list)
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
05d703f649ef1d07e78d7b479fb4c4ac?d=identicon&s=25 James Adam (Guest)
on 2006-05-03 18:59
(Received via mailing list)
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 Siemssen <daniel@dr-siemssen.de> wrote:
> manually or if you think that it would be a good idea to replace the
>
--
* J *
  ~
4a49a0deabf200b0183ef889134ec4c6?d=identicon&s=25 Daniel Einspanjer (Guest)
on 2006-06-05 19:06
(Received via mailing list)
"James Adam" <james.adam@gmail.com> wrote in
message
news:9ec5d0aa0605020913t7e436617q2fd6165779ccddd2@mail.gmail.com...
...
> 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
This topic is locked and can not be replied to.