diff options
| author | pboling | 2009-10-22 15:37:50 -0400 | 
|---|---|---|
| committer | pboling | 2009-10-22 15:37:50 -0400 | 
| commit | 8ce7858e829bb409febe5da6e47fa7d2a691e3d2 (patch) | |
| tree | 3303d67305f691c5dedc28f1e46758f7277ed5b3 /lib | |
| parent | e010096f2a9c1f5ddecbad998051b210ba47b3dd (diff) | |
| download | sms-fu-8ce7858e829bb409febe5da6e47fa7d2a691e3d2.tar.bz2 | |
improved setting of RAILS_CONFIG_ROOT
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/sms_fu.rb | 8 | 
1 files changed, 7 insertions, 1 deletions
| diff --git a/lib/sms_fu.rb b/lib/sms_fu.rb index b8b56bd..7ffdfd6 100644 --- a/lib/sms_fu.rb +++ b/lib/sms_fu.rb @@ -30,7 +30,13 @@ module SMSFu      end    end -  RAILS_CONFIG_ROOT = defined?(RAILS_ROOT) ? "#{RAILS_ROOT}/config" : "#{File.dirname(__FILE__)}/../templates" unless defined?(RAILS_CONFIG_ROOT) +  RAILS_CONFIG_ROOT = defined?(Rails) ? +          Rails.env == 'test' ? +            "#{File.dirname(__FILE__)}/../templates" : +            "#{RAILS_ROOT}/config" : +          RAILS_ENV == 'test' ? +            "#{File.dirname(__FILE__)}/../templates" : +            "#{RAILS_ROOT}/config"    @config     ||= YAML::load(File.open("#{RAILS_CONFIG_ROOT}/sms_fu.yml"))    @@carriers  ||= @config['carriers']     @@from_address = @config['config']['from_address'] | 
