lib/recurly.rb
# allows configuration from a yml file that contains the fields:
# username,password,site,private_key
allows configuration from a yml file that contains the fields:
username,password,site,private_key
allows configuration from a yml file that contains the fields : username password site private_key
def configure_from_yaml(path = nil)
      configure do |c|
        recurly_config = ConfigParser.parse(path)
        if recurly_config.present?
          recurly_env = Rails.env if defined?(Rails) and Rails.respond_to?(:env)
          recurly_env ||= ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development"
          recurly_config = recurly_config[recurly_env] if recurly_config.has_key?(recurly_env)
          c.username = recurly_config["username"]
          c.password = recurly_config["password"]
          c.subdomain = recurly_config["subdomain"]
          c.private_key = recurly_config["private_key"]
          c.environment = recurly_config["environment"]
        end
      end
    end
def configure_from_yaml ( path = nil ) configure do | c | recurly_config = ConfigParser . parse ( path ) if recurly_config . present? recurly_env = Rails . env if defined? ( Rails ) and Rails . respond_to? ( :env ) recurly_env ||= ENV [ "RAILS_ENV" ] || ENV [ "RACK_ENV" ] || "development" recurly_config = recurly_config [ recurly_env ] if recurly_config . has_key? ( recurly_env ) c . username = recurly_config [ "username" ] c . password = recurly_config [ "password" ] c . subdomain = recurly_config [ "subdomain" ] c . private_key = recurly_config [ "private_key" ] c . environment = recurly_config [ "environment" ] end end end
allows configuration from a yml file that contains the fields:
username,password,site,private_key
allows configuration from a yml file that contains the fields : username password site private_key
# parse configuration from yml # check for environment specific config
path
<not_specific>