putting plugins/config in gem

P

Payton Swick

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
 
P

Payton Swick

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,202
Messages
2,571,057
Members
47,663
Latest member
josh5959

Latest Threads

Top