Sha256: 5f5f930ac853f5f142b5861f43c030d462b5aa4fe55307367ba1d69f92021d10
Contents?: true
Size: 868 Bytes
Versions: 8
Compression:
Stored size: 868 Bytes
Contents
#coding: utf-8 module Ns class ServiceConfig SERVICE_CONFIG_FILE = 'config/ns_services.yml' cattr_accessor :services @@services = {} def self.load_services!(config_file = SERVICE_CONFIG_FILE) return unless File.exists?(config_file) service_configs = YAML.load(File.read(SERVICE_CONFIG_FILE)) @@services.merge!(service_configs[Rails.env]) #load common parts if exists if (common_parts = service_configs['common']).is_a?(Hash) common_parts.each do |k, v| @@services[k] = if v.is_a?(Array) if v.size == 2 v[0] = @@services[v[0].to_sym] Util.concat_url(v[0], v[1]) else raise "Invalid path!" end #/if else v end #/if end #/do end #/if @@services end #/def end end
Version data entries
8 entries across 8 versions & 1 rubygems