require 'active_support' require 'active_support/core_ext' require 'nokogiri' require 'yaml' require 'openssl' require 'mechanize' require 'digest/md5' require "skio_sms_client/version" module SkioSmsClient class << self def configuration @configuration ||= begin if defined? Rails config_file = Rails.root.join('config/skio_sms_client.yml') else config_file = File.expand_path('../../config/skio_sms_client.yml', __FILE__) end if (File.exist?(config_file)) config = YAML.load(ERB.new(File.new(config_file).read).result) config = config[Rails.env] if defined? Rails end OpenStruct.new(config || {app_name: "", send_key: "", send_server: ""}) end end def configure yield(configuration) end end end