Sha256: d21b473a9af708d2f36e0e4024d1f46cbdd523c58355c18beeb6f018a56e1264

Contents?: true

Size: 639 Bytes

Versions: 6

Compression:

Stored size: 639 Bytes

Contents

module PluginTool

  module LocalConfig

    LOCAL_CONFIG_FILENAME = "server.config.json"

    def self.load
      if File.exist? LOCAL_CONFIG_FILENAME
        @@local_config = JSON.parse(File.open(LOCAL_CONFIG_FILENAME) { |f| f.read })
      else
        @@local_config = {}
      end
    end

    def self.get_list(list_name)
      lookup = @@local_config[list_name]
      return [] unless lookup
      list = []
      server_name = PluginTool.get_server_hostname
      list.concat(lookup['*']) if lookup.has_key?('*')
      list.concat(lookup[server_name]) if server_name && lookup.has_key?(server_name)
      list
    end

  end

end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
haplo-2.1.0-java lib/local_config.rb
oneis-2.0.6-java lib/local_config.rb
oneis-2.0.5-java lib/local_config.rb
oneis-2.0.4-java lib/local_config.rb
oneis-2.0.3-java lib/local_config.rb
oneis-2.0.2-java lib/local_config.rb