# Including a config file into a local directory

**URL:** <https://www.ruby-forum.com/t/including-a-config-file-into-a-local-directory/86747>\
**Category:** Ruby\
**Created:** [February 25, 2007, 9:11am UTC](https://www.ruby-forum.com/t/including-a-config-file-into-a-local-directory/86747 "2007-02-25T09:11:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eddieroger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/e/edb3f5/32.png) [@eddieroger](https://www.ruby-forum.com/u/eddieroger)\
**Post date:** [February 25, 2007, 9:11am UTC](https://www.ruby-forum.com/t/including-a-config-file-into-a-local-directory/86747/1 "2007-02-25T09:11:17Z")

</div>

Hello group,

I’m working on a library for accessing MediaWiki wikies through its  
new API, and I had a question about a config file and gem  
distribution. I’d like for my include to look in the working directory  
for a file called ‘config.yaml’ that will hold a set of variables for  
accessing the wiki - namely, the API URI, username and password. I  
have a backup plan if there’s just no way to do this, but I’m new to  
gems, and thought maybe there was a way to include a basic config  
template file that would install somewhere besides where gems normally  
go. Any insight?

An example: Writing a wikibot that named “Sentinel”. The Ruby program  
requires the gem I create, and is run using ‘ruby sentinel.rb’. I’d  
like it to look in whatever directory sentinel.rb lives for my file. I  
hope that helps.

Thanks in advance.  
eddieroger
