<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Virtuous Code &#187; releases</title>
	<atom:link href="http://devblog.avdi.org/tag/releases/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.avdi.org</link>
	<description>&#34;The three virtues of a programmer: laziness, impatience, and hubris&#34; -- Larry Wall</description>
	<lastBuildDate>Tue, 21 May 2013 18:19:00 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>[ANN] HookR 1.0.0</title>
		<link>http://devblog.avdi.org/2008/12/05/ann-hookr-100/</link>
		<comments>http://devblog.avdi.org/2008/12/05/ann-hookr-100/#comments</comments>
		<pubDate>Fri, 05 Dec 2008 16:58:13 +0000</pubDate>
		<dc:creator>Avdi Grimm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[hookr]]></category>
		<category><![CDATA[releases]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/2008/12/05/ann-hookr-100/</guid>
		<description><![CDATA[I&#8217;m pleased to announce the availability of &#8220;HookR&#8221;:http://hookr.rubyforge.org 1.0.0 h2. Description HookR is a publish/subscribe callback hook facility for Ruby. h2. What is it? HookR can be understood in a few different ways. * If you are familiar with Events &#8230; <a href="http://devblog.avdi.org/2008/12/05/ann-hookr-100/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m pleased to announce the availability of &#8220;HookR&#8221;:http://hookr.rubyforge.org 1.0.0</p>
<p>h2. Description</p>
<p>HookR is a publish/subscribe callback hook facility for Ruby.</p>
<p>h2. What is it?</p>
<p>HookR can be understood in a few different ways.</p>
<p>* If you are familiar with Events and Event Listeners in &#8220;Java&#8221;:http://java.sun.com/docs/books/tutorial/javabeans/events/index.html or &#8220;C#&#8221;:http://msdn.microsoft.com/en-us/library/aa645739(VS.71).aspx; &#8220;Hooks&#8221;:http://www.gnu.org/software/emacs/manual/html_node/elisp/Hooks.html#Hooks in Emacs-lisp; or signals-and-slots as implemented in the &#8220;Qt&#8221;:http://doc.trolltech.com/4.4/signalsandslots.html, &#8220;Boost.Signals&#8221;:http://www.boost.org/doc/libs/1_37_0/doc/html/signals.html, or &#8220;libsigc++&#8221;:http://libsigc.sourceforge.net/ frameworks &#8211; HookR provides a very similar facility.<br />
* If you&#8217;ve ever used the Observer standard library, but wished you could have more than one type of notification per observable object, HookR is the library for you.<br />
* HookR is an easy way to add &#8220;Rails-style&#8221;:http://api.rubyonrails.org/classes/ActiveRecord/Callbacks.html before- and after-filters to your own classes.<br />
* HookR is an &#8220;Inversion-of-Control&#8221;:http://martinfowler.com/bliki/InversionOfControl.html framework in that it makes it easy to write event-driven code.<br />
* HookR is a way to support a limited, structured form of Aspect Oriented Programming (&#8220;AOP&#8221;:http://en.wikipedia.org/wiki/Aspect-oriented_programming) where the advisable events are explicitly defined. </p>
<p>h2. What HookR is not:</p>
<p>* HookR is not (yet) an asynchronous event notification system.  No provision is made for multi-threaded operation or event queueing.<br />
* HookR will show you a good time, but it will not make you breakfast in the morning.</p>
<p>h2. Synopsis</p>
<pre name="code" class="ruby">
  require 'rubygems'
  require 'hookr'

  class ZeroWing
    include HookR::Hooks
    define_hook :we_get_signal, :message

    def start_game
      execute_hook(:we_get_signal, "How are you gentlemen?")
    end

    def bomb(event, message)
      puts "somebody set us up the bomb!"
    end

    we_get_signal do |event, message|
      puts "Main screen turn on!"
      puts "Cats: #{message}"
    end

    we_get_signal :bomb

  end

  zw = ZeroWing.new
  zw.we_get_signal do
    puts "Take off every zig!"
  end

  zw.start_game
  # >> Main screen turn on!
  # >> Cats: How are you gentlemen?
  # >> somebody set us up the bomb!
  # >> Take off every zig!
</pre>
<p>h2. Get it Now</p>
<p>Pull your hat way down over your eyes, drive over to the your local red-light district, and type:</p>
<p>  <tt>sudo gem install hookr</tt></p>
<p>For more information, check out the website: http://hookr.rubyforge.org</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.avdi.org/2008/12/05/ann-hookr-100/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[ANN] fail-fast 1.0.0 Released</title>
		<link>http://devblog.avdi.org/2008/11/30/ann-fail-fast-100-released/</link>
		<comments>http://devblog.avdi.org/2008/11/30/ann-fail-fast-100-released/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 19:50:36 +0000</pubDate>
		<dc:creator>Avdi Grimm</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[assertions]]></category>
		<category><![CDATA[dbc]]></category>
		<category><![CDATA[fail-fast]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[libraries]]></category>
		<category><![CDATA[releases]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://avdi.org/devblog/2008/11/30/ann-fail-fast-100-released/</guid>
		<description><![CDATA[Number two out of three in my weekend releasing spree, I&#8217;m happy to announce the availability of &#8220;FailFast&#8221;:http://fail-fast.rubyforge.org v.1.0.0. h2. Description FailFast is a collection of assertion methods intended for lightweight contract checking. h2. Installing sudo gem install fail-fast h2. &#8230; <a href="http://devblog.avdi.org/2008/11/30/ann-fail-fast-100-released/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Number two out of three in my weekend releasing spree, I&#8217;m happy to announce the availability of &#8220;FailFast&#8221;:http://fail-fast.rubyforge.org v.1.0.0.</p>
<hr/>
<p>h2. Description</p>
<p>FailFast is a collection of assertion methods intended for lightweight contract checking.  </p>
<p>h2. Installing</p>
<pre>sudo gem install fail-fast</pre>
<p>h2. Synopsis</p>
<pre lang="ruby">
  def try
    yield
  rescue FailFast::AssertionFailureError
    "<Assertion Failure>"
  end

  include FailFast::Assertions

  try { assert(true) }            # => true
  try { assert(false) }           # => "<Assertion Failure>"
  try { assert(nil) }             # => "<Assertion Failure>"

  # We can check multiple values at once
  try { assert("foo", :bar, 42) } # => 42
  try { assert(1, 2, nil) }       # => "<Assertion Failure>"

  # assert_exists only checks for nil-ness - false is OK.
  try { assert_exists(true) }     # => true
  try { assert_exists(false) }    # => false
  try { assert_exists(nil) }      # => "<Assertion Failure>"

  # check further constraints after verifying the object is non-nil
  try { assert_exists(99) {|n| n > 100 } } # => "<Assertion Failure>"

  # Assert that a collection is non-empty
  try { assert_one_or_more([1]) }         # => [1]
  try { assert_one_or_more(:foo => :bar) } # => {:foo=>:bar}
  try { assert_one_or_more([]) }           # => "<Assertion Failure>"

  # #deny is the opposite of #assert
  try {  deny(true) }             # => "<Assertion Failure>"
  try { deny(false) }             # => false
  try { deny(nil) }               # => nil

  # Assert that an object is hash-like and contains non-nil values for given keys
  h = {:foo => 1, :bar => 2, :baz => nil}
  try { assert_keys(h, :foo, :bar) } # => {:foo=>1, :bar=>2, :baz=>nil}
  try { assert_keys(h, :baz) }       # => "<Assertion Failure>"
  try { assert_keys(h, :buz) }       # => "<Assertion Failure>"
</pre>
<p>h2. Rationale</p>
<p>Unexpected <tt>nil</tt>s and other bad values will usually bring a Ruby program down eventually, but the actual point of failure might be deep down the call stack and the error message less than revealing.  Judicious use of FailFast assertions to check your assumptions can ensures that the program will end as soon as a contract violation is detected, with a stack trace that points directly at the assertion which failed.</p>
<p>One of the primary goals of FailFast is to make assumption-checking declarative.  Assumption checking should be simple and concise so that we can get to the meat of a method without getting bogged down in verifications.  At the same time, FailFast is <em>lightweight</em>.  It is not a metaprogrammed Design-by-Contract DSL.  It is a simple set of shorthand methods for validating values.</p>
<p>It is not the intent of FailFast to have specialized assertions for every eventuality.  Rather, it seeks to cover a few common cases where there is a potential for significantly increased clarity and declarativeness.</p>
<p>h2. Features</p>
<p>* Fully spec&#8217;d/tested.<br />
* In most cases assertions return their last argument.  This makes it easy to check values inline.  For instance: <code>assert_exists(obj).foo()</code><br />
* Most assertions can take a block where a further boolean check can be performed. For instance, use <code>assert_exists(x) { x.predicate? }</code> to check first that <code>x</code> is not nil, and then that it satisfies a predicate.<br />
* <tt>AssertionFailure</tt> derives directly from <tt>Exception</tt> so that it will never be silently eaten by no-argument <tt>catch</tt> statements.</p>
<p>h2. Documentation</p>
<p>See the <a href="http://fail-fast.rubyforge.org/rdoc/">RDoc</a>.</p>
<hr/>
<p>See the &#8220;project site&#8221;:http://fail-fast.rubyforge.org for more.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.avdi.org/2008/11/30/ann-fail-fast-100-released/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
