MaxCDN / maxconf.rb

A sub-stack lib for configuring ruby-maxcdn using maxcli configuration method.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

A sub-stack lib for configuring ruby-maxcdn using maxcli configuration method.

License:MIT License


Languages

Language:Ruby 100.0%