tags:

views:

37

answers:

1

I'm authoring a gem and would like to copy template files that are packaged in my gem into the local directory that the gem is being called from.

+1  A: 

Create an install script (place it to 'bin' directory of your gem), that will copy template files to user specified directory.

Dmitry Maksimov
Right, I guess my original question had more to do with: when running the script in 'bin' in your gem, the local path is relative to wherever the gem is installed right? How do you know which directory the user's terminal is in?
Trevor Hartman
File.expand_path(File.dirname(\__FILE\__)) will show you path of your installation script (that will be 'bin' directory of your gem).Dir.pwd - path to the directory from where user runs your script.
Dmitry Maksimov
Excellent, thank you.
Trevor Hartman