# Rcap 0.2

**URL:** <https://www.ruby-forum.com/t/rcap-0-2/179254>\
**Category:** Ruby\
**Created:** [November 20, 2009, 3:13pm UTC](https://www.ruby-forum.com/t/rcap-0-2/179254 "2009-11-20T15:13:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Farrel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9d8465/32.png) [@Farrel\_L](https://www.ruby-forum.com/u/Farrel_L)\
**Post date:** [November 20, 2009, 3:13pm UTC](https://www.ruby-forum.com/t/rcap-0-2/179254/1 "2009-11-20T15:13:41Z")

</div>

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 see  
[Aimred - RCAP 0.2 Released](http://www.aimred.com/news/developers/2009/11/20/rcap_0_2_released) or  
view the RCAP project page at [Aimred - RCAP - Common Alerting Protocol for Ruby](http://www.aimred.com/projects/rcap)

## Farrel

Aimred - Ruby Development and Consulting

> **[Aimred - Home - Ruby and Rails Development in Cape Town, South
  Africa](http://www.aimred.com)**
>
> Aimred is a specialist Ruby and Ruby on Rails development house and consultancy based in Cape Town, South Africa.

---

<div class="post-metadata">

**Author:** ![Farrel\_L](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9d8465/32.png) [@Farrel\_L](https://www.ruby-forum.com/u/Farrel_L)\
**Post date:** [November 20, 2009, 4:39pm UTC](https://www.ruby-forum.com/t/rcap-0-2/179254/2 "2009-11-20T16:39:43Z")

</div>

On Nov 20, 9:13 am, Farrel L. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> RCAP now supports the generation of YAML documents to represent each alert.  
> 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 =>

```

‘removed\_email\_address@domain.invalid’,  
: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

```

‘removed\_email\_address@domain.invalid’  
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
