# allow this to be used outside of full Rails init this_dir = File.dirname(__FILE__) $: << this_dir unless $:.include?(this_dir) #require 'faster_csv' require 'yaml' require 'hashie' require 'core_ext' require 'trigga/param_fu' require 'net_helper' #require 'trigga/param_fu' Dir[File.join(File.dirname(File.expand_path(__FILE__)),"admin_api_client","proxies","*.rb")].each {|f| require f } Dir[File.join(File.dirname(File.expand_path(__FILE__)),"admin_api_client","*.rb")].each {|f| require f } # load configuration unless defined? RAILS_ENV RAILS_ENV = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "development" end Trigga.add_log_line("", true) Trigga.add_log_line(" iTrigga Admin Client API") Trigga.add_log_line("", true) begin plugin_configuration_file = File.join(File.dirname(File.expand_path(__FILE__)),"..","..","configuration.yml") TRIGGA_ADMIN_API_CLIENT_CONFIG = Hashie::Mash.new(YAML.load_file(plugin_configuration_file)[RAILS_ENV]) rescue Exception => e Trigga.add_log_line("...disabled => Unable to load Admin Client API configuration from #{plugin_configuration_file}.\n") Trigga.add_log_line("Exception: #{e.message}") end