Forum: Ruby putting plugins/config in gem

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.
5224d56434a3d237408c217605df8a56?d=identicon&s=25 Payton Swick (Guest)
on 2006-02-10 00:31
(Received via mailing list)
I wrote a tool in ruby which I want to put entirely in a gem.  The tool,
however, requires a directory of plugins and a config file, which the
tool should ideally be able to find in default locations.

I can include the plugin and config directories in the GemSpec without
any trouble, but when the tool is run, it needs to be able to find them.

The only way I could figure out to do this was to hard-code this into
the tool:

def where_am_i?
   "#{Gem.path}/gems/tool-#{VERSION}"
end

And append the plugin and config paths to it.  Surely there's a better
way to do all of this. Suggestions?

-Payton
5224d56434a3d237408c217605df8a56?d=identicon&s=25 Payton Swick (Guest)
on 2006-02-10 18:30
(Received via mailing list)
I realize that I could have the config file automatically created in the
user's home directory, but what about the plugins directory?  I guess
that should be user-centric also, by default, but GemSpec doesn't
provide (afaik) a mechanism to install files in arbitrary locations.

-Payton
This topic is locked and can not be replied to.