Project

porteo

0.0
No commit activity in last 3 years
No release in over 3 years
Send all messages that you want in any protocol, its ready to send mail messages, twitts and sms with the apropiate gateway
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.1.0
~> 0.10.5
~> 1.6.0
>= 2.1.1
~> 0.9.2
~> 2.6.0
>= 0.3.8
~> 0.7.1

Runtime

~> 0.2.0
~> 1.2
~> 1.5.0
 Project Readme

Porteo

A Ruby gem that send messages via any protocol/gateway with programable templates and emitters.

Usage

All you have to do is to create a new Message object like this:

my_msg = Porteo::Message.new()

my_msg.configure do |m|
  # set the template named foo
  # The template must be set in the template path (./config/templates/ by default)
  m.template = "foo"
  # set the emitter named bar
  # The emitter must be set in config path (./config/ by default)
  # by default get the "default" profile in emitter
  m.emitter = "bar"
  # Set the protocol
  m.protocol = "desired_protocol"
end

Now you only have to set the params on the template (if you required it) like this:

my_msg.set_template_params = { :name_of_the_param => value_of_the_param }

Or this:

my_msg.name_of_the_param = value_of_the_param

Configuration Files

The files that are strictly necesaries are: a emitter, and a template. Their construction are the folloing:

Emitter

An emitter must be constructed using YAML like this:

:protocolName:
  :profileName:
    :configParam1: :valueParamSymbol
    :configParamFoo: 'valueParamString'
    :configParambar: 'etc'
  :otherProfile:
    :configParam: :value
    :bar: 'foo'
:otherProtocol:
  :profileName:
    :protocolconfigparam: 'value'

Template

A template file must be constructed using YAML + ERB like this:

:requires: [:parameterName]
:template:
  :fieldOfTemplate: "This is a Example of a template file, a parameter must be given, its value is: <%= param[:parameterName] %>"

The template file must be named with "templateName.protocolName", ONLY templateName must be given to the Message class to know which template to use.

About

Porteo is developed by NoSoloSoftware.

License

Porteo is Copyright 2011 NoSoloSoftware, it is free software.

Porteo is distributed under GPLv3 license. More details can be found at COPYING file.