= What's New 0.2
== YAML Support
RCAP now supports the generation of YAML documents to represent each alert.
This YAML message can then be parsed back into it's constituent RCAP
objects using the Alert.from_yaml method.
== IRb Console Formatting
All RCAP classes now have custom inspect methods which enables them to
be displayed in a helpful and clear manner to end users in an IRb
console.
For more detailed release notes see
http://www.aimred.com/news/developers/2009/11/20/rcap_0_2_released or
view the RCAP project page at http://www.aimred.com/projects/rcap
Farrel
--
Aimred - Ruby Development and Consulting
http://www.aimred.com
--
Aimred - Ruby Development and Consulting
http://www.aimred.com
On Nov 20, 9:13 am, Farrel Lifson <farrel.lif...@gmail.com> wrote:
> I'm pleased to announce the release of RCAP 0.2. RCAP is a Ruby
> implementation of the Common Alerting Protocol(CAP). This release is
> release is aimred at developers and adds YAML generation and parsing
> support as well as functionality allowing RCAP objects to be displayed
> easily in the IRb command console.
>
> = What's New 0.2
>
> == YAML Support
>
> RCAP now supports the generation of YAML documents to represent each alert.
>
> This YAML message can then be parsed back into it's constituent RCAP
> objects using the Alert.from_yaml method.
>
> == IRb Console Formatting
>
> All RCAP classes now have custom inspect methods which enables them to
> be displayed in a helpful and clear manner to end users in an IRb
> console.
>
> For more detailed release notes seehttp://www.aimred.com/news/developers/2009/11/20/rcap_0_2_releasedor
> view the RCAP project page athttp://www.aimred.com/projects/rcap
Hi Farrel
I'm curious. What does CAP get used for / who is using CAP?
Also, if I might offer a suggestion or two...
You might allow symbols in place of constants, eg.
alert = Alert.new( :sender =>
'cape_town_di...@capetown.municipal.za',
:status => :STATUS_ACTUAL, # instead of
Alert::STATUS_ACTUAL
:msg_type => :MSG_TYPE_ALERT,
:scope => :SCOPE_PUBLIC,
:infos => Info.new( :event => 'Liquid
Petroleoum Tanker Fire',
:language => 'en-ZA',
:categories =>
[ :CATEGORY_TRANSPORT, :CATEGORY_FIRE ],
:urgency
=> :URGENCY_IMMEDIATE,
:severity
=> :SEVERITY_SEVERE,
:certainty
=> :CERTAINTY_OBSERVED,
:headline => 'LIQUID
PETROLEOUM TANKER FIRE ON N2 INCOMING FREEWAY',
:description => 'A liquid
petroleoum tanker has caught fire on the N2 incoming freeway 1km
after the
R300 interchange. Municipal fire fighting crews have been dispatched.
Traffic
control officers are on the scene and have diverted traffic onto
alternate
routes.' ))
Internally the symbols can be translated into the constants.
Also, considering how it used, it seems like the perfect candidate for
a simple DSL.
alert = Alert do
sender
'cape_town_di...@capetown.municipal.za'
status :STATUS_ACTUAL
msg_type :MSG_TYPE_ALERT
scope :SCOPE_PUBLIC
info do
event 'Liquid Petroleoum Tanker Fire'
language 'en-ZA'
categories
[ :CATEGORY_TRANSPORT, :CATEGORY_FIRE ]
urgency :URGENCY_IMMEDIATE
severity :SEVERITY_SEVERE
certainty :CERTAINTY_OBSERVED
headline 'LIQUID PETROLEOUM TANKER FIRE ON N2
INCOMING FREEWAY'
description 'A liquid petroleoum tanker has
caught fire on the N2 incoming freeway 1km
after the R300 interchange.
Municipal fire fighting crews have been dispatched.
Traffic control officers are
on the scene and have diverted traffic onto
alternate routes.'
end
end