Project

empezar

0.0
No commit activity in last 3 years
No release in over 3 years
A simple Ruby library to enforce a convention for configuration, logging and execution
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
>= 0

Runtime

 Project Readme

Empezar

A simple Ruby library to enforce a convention for configuration, logging and execution

Install

gem install empezar

Usage

To start, you must create a config directory containing at least a main.yaml file with at least one configuration. Currently Empezar supports the verbosity flag, which can be setted to silent and the application's log will not be echoed in command line (otherwise it will be):

#config/main.yaml
verbosity: normal # `silent` will silence stdout

Then create a ruby script anywhere in the folder and run it

# script.rb

require 'empezar/run'
# Maps config/main.yaml to Configuration as SymbolMatrix
# Gets ready Log as a logger in log/main.log
# Also gets $stdout setted as the output IO
# and gets ARGV passed as arguments for the configuration to be completed

Log.info "This will be logged and written in the shell"

Configuration.each do |key, value|
  Log.debug "#{key}: #{value}"
end

...and then

ruby script.rb speak.only:truth

You will see some output in the terminal after that.

This is really short, so here, have a picture of a monkey . Enjoy