senchalabs/jsduck — Issue #99: Unable to specify relative path to meta-tags
Author: burnnat
Created: 2011-11-15 16:28:50+00:00
State: open

When attempting to run JSDuck via a command like `jsduck src/main --meta-tags=docs-include/meta-tags.rb`, I'm greeted with the following unhappy exception:
```
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': no such file to load -- docs-include/meta-tags.rb (LoadError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/gems/jsduck-3.0.1/lib/jsduck/meta_tag_loader.rb:25:in `block in load'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/gems/jsduck-3.0.1/lib/jsduck/meta_tag_loader.rb:18:in `each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/gems/jsduck-3.0.1/lib/jsduck/meta_tag_loader.rb:18:in `load'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/gems/jsduck-3.0.1/lib/jsduck/options.rb:124:in `parse!'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/gems/jsduck-3.0.1/bin/jsduck:25:in `'
from C:/Ruby192/bin/jsduck:19:in `load'
from C:/Ruby192/bin/jsduck:19:in `

'
```
Specifying an absolute path, however, fixes the problem: `jsduck src/main --meta-tags=/full/path/all/the/way/to/docs-include/meta-tags.rb`

I'm on Ruby 1.9.2 - I'm guessing this is because the working directory is no longer included in `LOAD_PATH` in Ruby 1.9.2 and above. Seems like a simple `File.expand_path(metaFile, '.')` would do the trick.