<?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>RubyScale</title>
	<atom:link href="http://rubyscale.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rubyscale.com</link>
	<description>Web Apps, DevOps, Ruby, and More.</description>
	<lastBuildDate>Fri, 02 Aug 2013 00:43:43 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.4.2</generator>
	<item>
		<title>Using Ruby with MiOS from Mi Casa Verde</title>
		<link>http://rubyscale.com/blog/2013/01/01/using-ruby-with-mios-from-mi-casa-verde/</link>
		<comments>http://rubyscale.com/blog/2013/01/01/using-ruby-with-mios-from-mi-casa-verde/#respond</comments>
		<pubDate>Tue, 01 Jan 2013 13:42:04 +0000</pubDate>
		<dc:creator><![CDATA[Kelley Reynolds]]></dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[mios]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[zwave]]></category>

		<guid isPermaLink="false">http://rubyscale.com/?p=444</guid>
		<description><![CDATA[Mi Casa Verde. You can read the specifications of the devices for yourself but I like them because they are inexpensive, have low-power requirements, are capable of interfacing with a number of different kind of home automation systems, and most importantly, have a documented JSON/XML API. Coincidentally, they also have a developer special program and [&#8230;]]]></description>
				<content:encoded><![CDATA[<p><a title="Mi Casa Verde" href="http://www.micasaverde.com" target="_blank"><a href="http://rubyscale.com/?attachment_id=446" rel="attachment wp-att-446"><img class="alignright size-medium wp-image-446" alt="Vera Lite" src="http://rubyscale.com/wp-content/uploads/2013/01/Vera-Lite1-300x236.png" width="300" height="236" srcset="http://rubyscale.com/wp-content/uploads/2013/01/Vera-Lite1-300x236.png 300w, http://rubyscale.com/wp-content/uploads/2013/01/Vera-Lite1.png 454w" sizes="(max-width: 300px) 100vw, 300px" /></a>Mi Casa Verde</a>. You can read the specifications of the devices for yourself but I like them because they are inexpensive, have low-power requirements, are capable of interfacing with a number of different kind of home automation systems, and most importantly, have a documented JSON/XML API. Coincidentally, they also have a <a title="Developer Special Program" href="http://www.micasaverde.com/develop-an-app.php" target="_blank">developer special program</a> and lack a ruby gem, so another rainy day project is born!</p>
<p><span id="more-444"></span></p>
<p>The operating system these devices run is called MiOS which is essentially Linux/ARM and lots of glue. Mi Casa Verde operates a free VPN service that allows you to operate them remotely, and there are a number of free/paid smartphone apps available (though none struck me as particularly special). All of the interactions with MiOS work on a job queue basis. When a job is submitted, it&#8217;s status must be polled for success/failure. The Ruby library embraces this and allows jobs to be run synchronously or asynchronously.</p>
<p>Some snippets from the github page:</p>
<pre><code>mios = MiOS::Interface.new('http://192.168.15.1:3480')
switch = mios.devices[0]
switch.off! { |obj|
  puts "The #{obj.name} is now off"
}
puts "This will get printed once the switch is off and the block has been executed"

switch.on!(true) { |obj|
  puts "The #{obj.name} is now on"
}
puts "This will output immediately"
sleep(5) # Sleep to wait for the thread to finish

</code></pre>
<p>Every device is supported by manually issuing commands as listed <a title="Mi Casa Verde Luup variables and actions" href="http://wiki.micasaverde.com/index.php/Luup_UPnP_Variables_and_Actions" target="_blank">in the wiki</a> and the devices that I currently use have nice wrappers around those for idiomatic usage (<a title="Example of Door Lock API" href="https://github.com/kreynolds/ruby-mios/blob/master/lib/mios/services/door_lock1.rb" target="_blank">example</a>).</p>
<p>Installation instructions and additional usage examples can be found on github under the <a title="Ruby MiOS" href="https://github.com/kreynolds/ruby-mios" target="_blank">ruby-mios project</a>.</p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://rubyscale.com/blog/2013/01/01/using-ruby-with-mios-from-mi-casa-verde/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Being Classy with HTTParty</title>
		<link>http://rubyscale.com/blog/2012/09/24/being-classy-with-httparty/</link>
		<comments>http://rubyscale.com/blog/2012/09/24/being-classy-with-httparty/#respond</comments>
		<pubDate>Mon, 24 Sep 2012 14:26:07 +0000</pubDate>
		<dc:creator><![CDATA[Kelley Reynolds]]></dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://rubyscale.com/?p=417</guid>
		<description><![CDATA[I recently has a use for HTTParty in a project that potentially required multiple base_uri references at the same time. Just changing the base_uri isn&#8217;t thread-safe so you can&#8217;t do that so the most common way around this with HTTParty is to make an instance variable and pass that around to all of the calls [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I recently has a use for <a title="HTTParty" href="https://github.com/jnunemaker/httparty" target="_blank">HTTParty</a> in a project that potentially required multiple base_uri references at the same time. Just changing the base_uri isn&#8217;t thread-safe so you can&#8217;t do that so the most common way around this with HTTParty is to make an instance variable and pass that around to all of the calls to get/post/etc. I find that a little cumbersome so instead I made use of dynamic classes to hide all of that nonsense.</p>
<p><span id="more-417"></span></p>
<p>In a stripped down example, an HTTParty class looks somewhat like this:</p>
<pre>class Foo
  include HTTParty
  base_uri 'http://example.com'

  def bar
    self.class.get '/some/resource'
  end
end</pre>
<p>&nbsp;</p>
<p>But rewriting it like so allows the same class usage but with variable base_uris:</p>
<pre>class Foo
  class &lt;&lt; self
    def new(uri, *args)
      Class.new(AbstractFoo) { |klass|
        klass.base_uri(uri)
      }.new(*args)
    end
  end

  class AbstractFoo
    include HTTParty

    def bar
      self.class.get '/some/resource'
    end
  end
end

foo1 = Foo.new('http://example.com')
foo2 = Foo.new('http://otherexample.com')</pre>
<p>&nbsp;</p>
<p>Thread-safe and no passing around stuff .. my little amusement for the day.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubyscale.com/blog/2012/09/24/being-classy-with-httparty/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cassandra-CQL 1.1.0</title>
		<link>http://rubyscale.com/blog/2012/09/20/cassandra-cql-1-1-0/</link>
		<comments>http://rubyscale.com/blog/2012/09/20/cassandra-cql-1-1-0/#respond</comments>
		<pubDate>Thu, 20 Sep 2012 20:28:09 +0000</pubDate>
		<dc:creator><![CDATA[Kelley Reynolds]]></dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[cassandra]]></category>
		<category><![CDATA[cql]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://rubyscale.com/?p=410</guid>
		<description><![CDATA[It&#8217;s been a while since the last release of the cassandra-cql gem, and this version fixes a few long-standing encoding and data-access bugs as well as support for CQL3. The driver now also uses Travis for continuous integration. The largest improvement is the ability to cast single columns at a time. One of the major [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been a while since the last release of the <a title="Cassandra-CQL" href="https://github.com/kreynolds/cassandra-cql" target="_blank">cassandra-cql gem</a>, and this version fixes a few long-standing encoding and data-access bugs as well as support for <a title="Datastax CQL Reference" href="http://www.datastax.com/docs/1.1/references/cql/index" target="_blank">CQL3</a>. The driver now also uses <a title="Cassandra-CQL in Travis" href="http://travis-ci.org/#!/kreynolds/cassandra-cql" target="_blank">Travis</a> for continuous integration.</p>
<p><span id="more-410"></span></p>
<p>The largest improvement is the ability to cast single columns at a time. One of the major pain points previously was that if a column in Cassandra had existing data and it&#8217;s validation changed to make that data invalid (empty string in an Integer-validated column for instance), none of the data in that row would be accessible as the entire row was casted at once. Each column is now individually casted and cached and if there is invalid data in a validated column, it will raise a CastException that contains a useful description of the problem as well as the bytes that raised the exception.</p>
<p>Another important bug fix is for character encoding in Ruby 1.9. The previous version incorrectly used ASCII-8BIT on data retrieved from ASCII-validated columns which when stored back into Cassandra, would encode it as binary. A simple change to US-ASCII in the casting has fixed that.</p>
<p><code>gem install cassandra-cql</code></p>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://rubyscale.com/blog/2012/09/20/cassandra-cql-1-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios check for WooFramework</title>
		<link>http://rubyscale.com/blog/2012/04/30/nagios-check-for-wooframework/</link>
		<comments>http://rubyscale.com/blog/2012/04/30/nagios-check-for-wooframework/#respond</comments>
		<pubDate>Mon, 30 Apr 2012 18:36:23 +0000</pubDate>
		<dc:creator><![CDATA[Kevin Way]]></dc:creator>
				<category><![CDATA[Kevin's Notes]]></category>

		<guid isPermaLink="false">http://rubyscale.com/?p=238</guid>
		<description><![CDATA[We just released check_woo, a nagios plugin to monitor the WooThemes WooFramework. It&#8217;s a quick way to make sure that the WooFramework piece of a WooTheme&#8217;d WordPress installation is up-to-date.]]></description>
				<content:encoded><![CDATA[<p>We just released <a href="https://github.com/kway/check_woo">check_woo</a>, a nagios plugin to monitor the WooThemes WooFramework.  It&#8217;s a quick way to make sure that the WooFramework piece of a WooTheme&#8217;d WordPress installation is up-to-date. </p>
]]></content:encoded>
			<wfw:commentRss>http://rubyscale.com/blog/2012/04/30/nagios-check-for-wooframework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby for Phidgets</title>
		<link>http://rubyscale.com/blog/2011/12/16/ruby-for-phidgets/</link>
		<comments>http://rubyscale.com/blog/2011/12/16/ruby-for-phidgets/#respond</comments>
		<pubDate>Fri, 16 Dec 2011 20:00:53 +0000</pubDate>
		<dc:creator><![CDATA[Kevin Way]]></dc:creator>
				<category><![CDATA[Blog]]></category>

		<guid isPermaLink="false">http://rubyscale.com/?p=185</guid>
		<description><![CDATA[We&#8217;re pleased to announce that you can now control Phidgets using Ruby.  Phidgets are low-cost USB building blocks, that make it easy to interact with the real world programmatically.  They provide a wide range of sensors (distance, force, touch, motion, environmental, input, current), motors (servos, steppers, DC motors), RFID readers, displays and other goodies. We [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>We&#8217;re pleased to announce that you can now control Phidgets using Ruby.  Phidgets are low-cost USB building blocks, that make it easy to interact with the real world programmatically.  They provide a wide range of sensors (distance, force, touch, motion, environmental, input, current), motors (servos, steppers, DC motors), RFID readers, displays and other goodies.</p>
<p>We worked with the great team over at <a href="http://www.phidgets.com/">Phidgets</a> to add Ruby to their supported languages.  You can check out the <a href="http://www.phidgets.com/documentation/Tutorials/Getting_Started_Ruby.pdf">Getting Started with Phidgets in Ruby</a> guide, or check out <a href="https://github.com/kreynolds/phidgets-ffi">phidgets-ffi</a> on github.</p>
]]></content:encoded>
			<wfw:commentRss>http://rubyscale.com/blog/2011/12/16/ruby-for-phidgets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
