Skip to content

Commit

Permalink
Ooops! RAILS_ROOT is not in the ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
nando committed Jan 2, 2010
1 parent 7cebeef commit 0712f5b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/randypot/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Randypot
class Config
CONFIG_YAMLS = [ # IN ORDER OF RELEVANCE
'randypot.yml',
"#{ENV['RAILS_ROOT']}/config/randypot.yml",
"#{RAILS_ROOT}/config/randypot.yml",
'~/.randypot/configuration.yml',
'/etc/randypot/configuration.yml'
].reverse.map {|f| File.expand_path(f)}
Expand Down
4 changes: 2 additions & 2 deletions spec/lib/randypot_config_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ENV['RAILS_ROOT'] = '/home/rails'
RAILS_ROOT = '/home/rails'
require File.expand_path(File.join(File.dirname(__FILE__), '../spec_helper'))

describe Randypot::Config do
Expand All @@ -9,7 +9,7 @@
}
YAMLS = {
:current_directory => 'randypot.yml',
:rails_directory => ENV['RAILS_ROOT'] + '/config/randypot.yml',
:rails_directory => RAILS_ROOT + '/config/randypot.yml',
:home_directory => '~/.randypot/configuration.yml',
:etc_directory => '/etc/randypot/configuration.yml'
}.inject({}) {|h, kv| h.merge(kv[0] => File.expand_path(kv[1]))}
Expand Down

0 comments on commit 0712f5b

Please sign in to comment.