Sha256: 47c1a53fde6e387a4ff1ca22bdc92fec68cd4c4b99d3fe85945d26325bfcbcb0

Contents?: true

Size: 585 Bytes

Versions: 5

Compression:

Stored size: 585 Bytes

Contents

require 'yaml'
module DyndocServers
	@@cfg=nil
	@@servers_cfg_file=File.join(ENV["HOME"],".dyndoc-servers.yml")
	def DyndocServers.cfg
      unless @@cfg
        @@cfg=(File.exist? @@servers_cfg_file) ? ::YAML::load_file(@@servers_cfg_file) : {}
      end
      @@cfg
	end

	def DyndocServers.dyn_cli_port?
		DyndocServers.cfg["ports"] ? @@cfg["ports"]["dyn-cli"] : nil
	end

	def DyndocServers.dyn_srv_port?
		DyndocServers.cfg["ports"] ? @@cfg["ports"]["dyn-srv"] : nil
	end

	def DyndocServers.dyn_http_port?
		DyndocServers.cfg["ports"] ? @@cfg["ports"]["dyn-http"] : nil
	end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dyndoc-ruby-1.5.0 lib/dyndoc-servers-cfg.rb
dyndoc-ruby-1.4.7 lib/dyndoc-servers-cfg.rb
dyndoc-ruby-1.4.6 lib/dyndoc-servers-cfg.rb
dyndoc-ruby-1.4.5 lib/dyndoc-servers-cfg.rb
dyndoc-ruby-1.4.2 lib/dyndoc-servers-cfg.rb