Skip to content

Latest commit

 

History

History
52 lines (40 loc) · 993 Bytes

README.md

File metadata and controls

52 lines (40 loc) · 993 Bytes

maxconf.rb Build Status

A sub-stack lib for loading MaxCDN configuration files using the standard set forth by MaxCLI.

Install

gem install maxconf

Use

###
# option:  default   :: description
# ------------------------------------
# "file":  undefined :: config file to be used, default is
#                      '$HOME/.maxcdn.yml'
# "[opt]": n/a       :: set or overide [opt]
###

require 'maxconf'

# default
###
conf = MaxConf.load()
puts conf["alias"]
# => YOUR_ALIAS

# custom file path
###
conf = MaxConf.load("/path/to/maxcdn.yml")
puts conf["alias"]
# => YOUR_ALIAS

# option overides
###
opts = {
  "file" => "/path/to/maxcdn.yml",
  "alias" => "ALIAS_OVERIDE"
}

conf = MaxConf.load(opts)
puts conf["alias"]
# => ALIAS_OVERIDE

Tests

$ ruby ./test/maxconf_test.rb