bbatsov/rubocop — pull request #968 by bquorning (2014-04-06 20:15:11+00:00)
Title: Expand base dir to avoid exception from Pathname

I have a `.rubocop.yml` in my project’s main folder, and a `.rubocop.yml` in my spec folder. After upgrading from 0.19.1 to 0.20.1, I have this issue when running Rubocop from my spec folder:

```
~$ cd spec && rubocop -c ./.rubocop.yml
different prefix: "/" and "."
/Users/bquorning/.rubies/ruby-2.1.0/lib/ruby/2.1.0/pathname.rb:500:in `relative_path_from'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/lib/rubocop/path_util.rb:10:in `relative_path'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/lib/rubocop/config.rb:91:in `path_relative_to_config'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/lib/rubocop/config.rb:71:in `file_to_include?'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/lib/rubocop/target_finder.rb:61:in `block in target_files_in_dir'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/lib/rubocop/target_finder.rb:57:in `select'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/lib/rubocop/target_finder.rb:57:in `target_files_in_dir'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/lib/rubocop/target_finder.rb:25:in `find'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/lib/rubocop/cli.rb:28:in `run'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/bin/rubocop:14:in `block in '
/Users/bquorning/.rubies/ruby-2.1.0/lib/ruby/2.1.0/benchmark.rb:294:in `realtime'
/Users/bquorning/.gem/ruby/2.1.0/gems/rubocop-0.20.1/bin/rubocop:13:in `'
/Users/bquorning/.gem/ruby/2.1.0/bin/rubocop:23:in `load'
/Users/bquorning/.gem/ruby/2.1.0/bin/rubocop:23:in `

'
```

Always using an expanded path solves the problem.

cc/ @jonas054