Project

egi

0.0
No commit activity in last 3 years
No release in over 3 years
manage multi-environments
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0
>= 0
 Project Readme

egi Build Status

tested in ruby 1.8.7, 1.9.2, 1.9.3, and head

About egi

environment, group, and item

USAGE

% cat egi.conf
env(:development) {
  item :vhost0301, { :tags => [ :mysqld, :rails ] }
}
env(:production) {
  group(:mysqld) {
    item :vhost0421, { :tags => [ :master ] }
    item :vhost0422
  }

  # you can define item without group
  item :vhost0423, { :tags => [ :rails ] }
}
% EGI_ENV=production irb
> require 'egi'
> # find by group or tag
> Egi.env.mysqld #=> [ { :name => :vhost0421, :tags => [ :mysqld, :master ] },
                       { :name => :vhost0422, :tags => [ :mysqld ] }
                     ]
> Egi.env.master #=> [ { :name => :vhost0421, :tags => [ :mysqld, :master ] } ]
> # fetch by name
> Egi.env.vhost0423 #=> { :name => :vhost0423, :tags => [ :rails ]}, 
% EGI_ENV=development irb
> require 'egi'
> Egi.env.mysqld #=> [ { :name => :vhost0301, :tags => [ :mysqld, :rails ] } ]
# can not fetch other envs
> Egi.env.vhost0421 #=> nil

Syntax

env

env(name, &block)
  • name
    • the name of env
  • &block
    • to define item

group

tag to the member of the group.

group(name, &block)
  • name
    • the name of group
    • tagged to the member of the group
  • &block
    • to define item for the member of the group

item

item(name, hash)
  • name
    • the name of item
    • if defined the same name, hash will be merged
  • hash
    • the property of item
    • :tags
      • you can search by tags

Aliases

not yet implemented