Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Backwards-compatible support for environment-specific twilio configur…

…ation
  • Loading branch information...
commit 806bebe79491fc04f984d89aee099f094a49df25 1 parent 9235925
@hbhanoo authored
Showing with 14 additions and 2 deletions.
  1. +4 −0 History.txt
  2. +1 −1  lib/trails.rb
  3. +9 −1 lib/trails/twilio/account.rb
View
4 History.txt
@@ -1,3 +1,7 @@
+=== 1.1.4 / 2010-05-09
+
+Backwards-compatible support for environment-specific twilio configuration
+
=== 1.1.1 / 2010-03-16
Typo fix.
View
2  lib/trails.rb
@@ -1,5 +1,5 @@
module Trails
- VERSION = '1.1.3'
+ VERSION = '1.1.4'
end
begin
TwilioRest
View
10 lib/trails/twilio/account.rb
@@ -178,7 +178,15 @@ def self.logger
return @logger
end
def self.config
- @@cfg ||= YAML::load_file( config_file )
+ @@all_cfg ||= YAML::load_file( config_file ).freeze
+ # allow per-environment configuration
+ @@cfg ||= if ( @@all_cfg.has_key?( RAILS_ENV ) )
+ @@all_cfg[ RAILS_ENV ]
+ elsif( @@all_cfg.has_key?( 'default' ) )
+ @@all_cfg['default']
+ else
+ @@all_cfg
+ end
end
def self.config_file
Please sign in to comment.
Something went wrong with that request. Please try again.