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
2010-07-19 07:37:33
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
2010-07-19 16:35:28
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
2010-07-20 04:15:12
Excellent, thank you.
Trevor Hartman
2010-07-21 00:00:57