Giter Club home page Giter Club logo

egi's Introduction

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

egi's People

Contributors

okitan avatar

Stargazers

 avatar

Watchers

 avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.