<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" xml:lang="en-US">
  <id>tag:blog.segment7.net,2005:/articles</id>
  <link type="text/html" rel="alternate" href="http://blog.segment7.net" />
  
  <title>Segment7</title>
  <subtitle type="html">The Blog</subtitle>
  <updated>2012-05-09T13:48:00-07:00</updated>
  <generator uri="http://www.typosphere.org" version="5.x">Typo</generator>
  <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/Segment7" /><feedburner:info uri="segment7" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><link rel="license" type="text/html" href="http://creativecommons.org/licenses/by-sa/3.0/" /><entry>
    <id>tag:blog.segment7.net,2005:Article/1339</id>
    <published>2012-05-09T13:48:00-07:00</published>
    <updated>2012-05-09T13:48:00-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/PybJSZ7VsYM/mechanize-2-5" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">Mechanize 2.5</title>
    <category term="software" label="Software" scheme="http://blog.segment7.net/category/software" />
    <content type="html">&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;a href="http://mechanize.rubyforge.org"&gt;Documentation&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;a
href="https://github.com/tenderlove/mechanize"&gt;Source&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;The Mechanize library is used for automating interaction with websites.
Mechanize automatically stores and sends cookies, follows redirects, and
can follow links and submit forms.  Form fields can be populated and
submitted.  Mechanize also keeps track of the sites that you have visited
as a history.&lt;/p&gt;

&lt;h3 id="label-Changes"&gt;Changes&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Minor enhancement&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Added Mechanize#ignore_bad_chunking for working around servers that don&amp;rsquo;t
terminate chunked transfer-encoding properly.  Enabling this may cause data
loss.  Issue #116&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Removed content-type check from Mechanize::Page allowing forced parsing of
incorrect or missing content-types.  Issue #221 by GarthSnyder&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Bug fixes&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Fixed typos in EXAMPLES and GUIDES.  Pull Request #213 by Erkan Yilmaz.&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Fixed handling of a quoted content-disposition size.  Pull Request #220 by
Jason Rust&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Mechanize now ignores a missing gzip footer like browsers do.  Issue #224
by afhbl&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Mechanize handles saving of files with the same name better now.  Pull
Request #223 by Godfrey Chan, Issue #219 by Jon Hart&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Mechanize now sends headers across redirects.  Issue #215 by Chris Gahan&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Mechanize now raises Mechanize::ResponseReadError when the server does not
terminate chunked transfer-encoding properly.  Issue #116&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Mechanize no longer raises an exception when multiple identical
radiobuttons are checked.  Issue #214 by Matthias Guenther&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Fixed documentation for pre_connect_hooks and post_connect_hooks.  Issue
#226 by Robert Poor&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Worked around ruby 1.8 run with -Ku and ISO-8859-1 encoded characters in
URIs.  Issue #228 by Stanislav O.Pogrebnyak&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;


&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/PybJSZ7VsYM" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/05/09/mechanize-2-5</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1338</id>
    <published>2012-05-03T17:57:28-07:00</published>
    <updated>2012-05-03T17:57:28-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/UHm8_HYNzG8/mechanics-of-programming" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">Mechanics of Programming</title>
    <category term="misc" label="Misc" scheme="http://blog.segment7.net/category/misc" />
    <content type="html">&lt;p&gt;I sat down with &lt;a href="http://eliseworthy.com/"&gt;Elise Worthy&lt;/a&gt; at &lt;a href="http://railsconf2012.com/"&gt;RailsConf&lt;/a&gt; to pair with her on a Rails application that used the &lt;a href="http://www.wunderground.com/weather/api/"&gt;Wunderground API&lt;/a&gt; to retrieve the weather for multiple cities.  If you don't know Elise, she's a &lt;a href="http://hungryacademy.com/"&gt;Hungry Academy&lt;/a&gt; student formerly of Seattle.  You can read about &lt;a href="http://blog.hungryacademy.com/blog/2012/05/03/personal-weather/"&gt;how she built her app&lt;/a&gt; on the &lt;a href="http://blog.hungryacademy.com/"&gt;Hungry Academy Blog&lt;/a&gt;.  Since Elise is new to programming, pairing with her made me think about how I work on small tasks when implementing a larger feature.

&lt;p&gt;When I first sat down, Elise had a class to retrieve the weather for Washington D.C., a controller and a view to display it.  Our task was to add a search box so you could show the weather for any ZIP code in addition to Washington D.C.

&lt;p&gt;By implementing weather for a fixed city first Elise had followed the most difficult lesson for me to learn, only implement one idea, or story, at a time.  When I try to add too much I can't fit all the details in my head.  By making the weather work for one fixed city she had a solid base of work she could revert to to try again if she got stuck.

&lt;p&gt;I mostly helped her with the question of "what should I do next?"  Elise knew which steps she needed to perform but didn't know what the best order was.  I've found that working on the easiest task first is best.  By picking the easiest task you have time to think about the hard tasks in the back of your mind.  By the time you get around to them you may have made them easier or you may have come up with an easier way to implement them.

&lt;p&gt;In the course of doing the easiest thing next we switched back and forth between the API wrapper, the controller and the view.  Each change we made was very small.  For example, first add the search form, next extract the ZIP code from &lt;code&gt;params&lt;/code&gt;, then replace showing Washington D.C. with the user's choice.

&lt;p&gt;Each step only changed a couple lines that we verified in the browser so we didn't get ahead of ourselves.  By first changing from a fixed city to an arbitrary city we advanced towards our goal without confusing ourselves with extra details.  While this broke one feature of the app, it was obvious that it would be easy to restore in the future when we were ready to address it.

&lt;p&gt;I also find it useful to add &lt;code&gt;TODO&lt;/code&gt; comments when I know I need to change or fix something but don't want to do it yet.  The &lt;code&gt;TODO&lt;/code&gt; item may be a distraction at this time or something difficult that a future step will make easier.  I find it easy to forget some necessary cleanup without them.  We added a few when Elise would think of something she needed to change but I didn't want to get us distracted.

&lt;p&gt;There was one other tip I had for Elise, as she was adding support for both Washington D.C. and the user's ZIP her first idea was to use two instance variables to provide the data to the view, one for Washington D.C. and the other for the user's city.  She also asked if I thought this was the best way.

&lt;p&gt;I told her that it is easier for me to think of handling just one item or handling many items, but not just two items.  By having only these two categories of items to display it makes it easier to maintain your code by preventing duplication.

&lt;p&gt;The best thing that came out of pairing with Elise was that I got to think about how I program at the lowest level.  While I got to show Elise some tips I've learned over the years, she showed me the details of my own internal process that I barely think about anymore.

&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/UHm8_HYNzG8" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/05/03/mechanics-of-programming</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1337</id>
    <published>2012-04-20T17:53:57-07:00</published>
    <updated>2012-04-20T17:53:57-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/8jt5f-DthX4/mechanize-2-4-security-fix" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">Mechanize 2.4 Security Fix</title>
    <category term="software" label="Software" scheme="http://blog.segment7.net/category/software" />
    <content type="html">&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;a href="http://mechanize.rubyforge.org"&gt;mechanize.rubyforge.org&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;a
href="https://github.com/tenderlove/mechanize"&gt;github.com/tenderlove/mechanize&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;The Mechanize library is used for automating interaction with websites.
Mechanize automatically stores and sends cookies, follows redirects, and
can follow links and submit forms.  Form fields can be populated and
submitted.  Mechanize also keeps track of the sites that you have visited
as a history.&lt;/p&gt;

&lt;h3 id="label-Changes"&gt;Changes&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Security fix:&lt;/p&gt;

&lt;p&gt;Mechanize#auth and Mechanize#basic_auth allowed disclosure of passwords to
malicious servers and have been deprecated.&lt;/p&gt;

&lt;p&gt;In prior versions of mechanize only one set of HTTP authentication
credentials were allowed for all connections.  If a mechanize instance
connected to more than one server then a malicious server detecting
mechanize could ask for HTTP Basic authentication.  This would expose the
username and password intended only for one server.&lt;/p&gt;

&lt;p&gt;Mechanize#auth and Mechanize#basic_auth now warn when used.&lt;/p&gt;

&lt;p&gt;To fix the warning switch to &lt;a href="http://mechanize.rubyforge.org/Mechanize.html#method-i-add_auth"&gt;Mechanize#add_auth&lt;/a&gt; which requires the URI
the credentials are intended for, the username and the password. Optionally
an HTTP authentication realm or NTLM domain may be provided.&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Minor enhancement&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Improved exception messages for 401 Unauthorized responses.  Mechanize now
tells you if you were missing credentials, had an incorrect password, etc.&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;


&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/8jt5f-DthX4" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/04/20/mechanize-2-4-security-fix</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1336</id>
    <published>2012-04-09T16:34:30-07:00</published>
    <updated>2012-04-09T16:34:30-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/qrFkWpa7FUU/rdoc-spellcheck-1-0" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">rdoc-spellcheck 1.0</title>
    <category term="rdoc" label="RDoc" scheme="http://blog.segment7.net/category/rdoc" />
    <category term="software" label="Software" scheme="http://blog.segment7.net/category/software" />
    <content type="html">&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/rdoc/rdoc-spellcheck"&gt;Source&lt;/a&gt;
&lt;li&gt;&lt;a href="http://docs.seattlerb.org/rdoc-spellcheck"&gt;Documentation&lt;/a&gt;
&lt;li&gt;&lt;a href="https://github.com/rdoc/rdoc-spellcheck/issues"&gt;Bug Reports&lt;/a&gt;
&lt;/ul&gt;

&lt;p&gt;rdoc-spellcheck checks your documentation for spelling errors.  File,
class, and method names are automatically excluded from the results and you
can add your own words to the default word list.&lt;/p&gt;

&lt;h3 id="label-Features"&gt;Features&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Checks documentation for pages, classes, modules, methods, constants, etc.&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Prints a report showing each misspelled word and correction suggestions&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;h3 id="label-Synopsis"&gt;Synopsis&lt;/h3&gt;

&lt;pre&gt;$ rdoc -f spellcheck lib *.rdoc&lt;/pre&gt;

&lt;h3 id="label-Requirements"&gt;Requirements&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;rdoc&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;libaspell &amp;#8211; See &lt;a
href="https://github.com/evan/raspell/blob/master/README.rdoc"&gt;github.com/evan/raspell/blob/master/README.rdoc&lt;/a&gt;
for installation instructions for aspell&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;h3 id="label-Install"&gt;Install&lt;/h3&gt;

&lt;pre&gt;sudo gem install rdoc-spellcheck&lt;/pre&gt;


&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/qrFkWpa7FUU" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/04/09/rdoc-spellcheck-1-0</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1335</id>
    <published>2012-04-04T17:36:32-07:00</published>
    <updated>2012-04-04T17:36:32-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/E0hNyQXC4WY/ruby-growl-4-0" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">ruby-growl 4.0</title>
    <category term="software" label="Software" scheme="http://blog.segment7.net/category/software" />
    <content type="html">
&lt;p&gt;ruby-growl version 4.0 has been released!&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;a
href="http://docs.seattlerb.org/ruby-growl"&gt;Documentation&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;A pure-ruby growl notifier for UDP and GNTP growl protocols.  ruby-growl
allows you to perform Growl notifications from machines without growl
installed (for example, non-OSX machines).&lt;/p&gt;

&lt;p&gt;What is growl?  Growl is a really cool &amp;ldquo;global notification system
originally for Mac OS X&amp;rdquo;.&lt;/p&gt;

&lt;p&gt;You can receive Growl notifications on various platforms and send them from
any machine that runs Ruby.&lt;/p&gt;

&lt;p&gt;OS X: &lt;a href="http://growl.info"&gt;growl.info&lt;/a&gt; Windows: &lt;a
href="http://www.growlforwindows.com/gfw"&gt;www.growlforwindows.com/gfw&lt;/a&gt;/
Linux: &lt;a
href="http://github.com/mattn/growl-for-linux"&gt;github.com/mattn/growl-for-linux&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;ruby-growl also contains a command-line notification tool named &amp;lsquo;growl&amp;rsquo;. 
It is almost completely option-compatible with growlnotify.  (All except
for -p is supported, use &amp;#8211;priority instead.)&lt;/p&gt;

&lt;h3 id="label-Changes%3A"&gt;Changes:&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;API changes:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Growl is now a wrapper for Growl::UDP (1.2 and older) and Growl::GNTP (1.3
and newer).  The main difference is that notifications need to be
registered with Growl#add_notification instead of via Growl#initialize.&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Ruby 1.9.2 or newer is required to use ruby-growl&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Major enhancements&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Added GNTP protocol support for registration and notification including
application and notification icons and callbacks.&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Moved UDP protocol support to Growl::UDP&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Growl automatically determines if the growl server supports GNTP or UDP and
uses the best protocol.&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;


&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/E0hNyQXC4WY" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/04/04/ruby-growl-4-0</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1334</id>
    <published>2012-04-01T13:10:29-07:00</published>
    <updated>2012-04-01T13:10:29-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/G4pjFBq_IeQ/return_bang-1-1" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">return_bang 1.1</title>
    <category term="software" label="Software" scheme="http://blog.segment7.net/category/software" />
    <content type="html">&lt;dl class="rdoc-list note-list"&gt;&lt;dt&gt;home 
&lt;dd&gt;
&lt;p&gt;&lt;a
href="https://github.com/drbrain/return_bang"&gt;github.com/drbrain/return_bang&lt;/a&gt;&lt;/p&gt;
&lt;/dd&gt;&lt;dt&gt;rdoc 
&lt;dd&gt;
&lt;p&gt;&lt;a
href="http://docs.seattlerb.org/return_bang"&gt;docs.seattlerb.org/return_bang&lt;/a&gt;&lt;/p&gt;
&lt;/dd&gt;&lt;dt&gt;bugs 
&lt;dd&gt;
&lt;p&gt;&lt;a
href="https://github.com/drbrain/return_bang/issues"&gt;github.com/drbrain/return_bang/issues&lt;/a&gt;&lt;/p&gt;
&lt;/dd&gt;&lt;/dl&gt;

&lt;p&gt;return_bang implements non-local exits for methods.  As a bonus, you also
get exception handling that ignores standard Ruby&amp;rsquo;s inflexible begin;
rescue; ensure; end syntax.&lt;/p&gt;

&lt;p&gt;Use return_bang to exit back to a processing loop from deeply nested code,
or just to confound your enemies &lt;strong&gt;and&lt;/strong&gt; your friends!  What
could possibly go wrong?&lt;/p&gt;

&lt;h3 id="label-1.1+%2F+2012-04-01"&gt;1.1 / 2012-04-01&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Minor enhancements&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Added raise! to raise exceptions&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Added rescue! to rescue exceptions raised&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Added ensure! to always execute a block of code to perform cleanup&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;


&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/G4pjFBq_IeQ" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/04/01/return_bang-1-1</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1333</id>
    <published>2012-03-29T19:49:42-07:00</published>
    <updated>2012-03-29T19:49:42-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/iuKDCKp5dwg/on-community-funding-of-open-source" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">On Community Funding of Open Source</title>
    <category term="ruby" label="Ruby" scheme="http://blog.segment7.net/category/ruby" />
    <content type="html">&lt;p&gt;The other day &lt;a href="http://yehudakatz.com/"&gt;Yehuda Katz&lt;/a&gt; announced a &lt;a href="http://www.kickstarter.com/projects/1397300529/railsapp"&gt;kickstarter for creating Rails.app&lt;/a&gt;, an OS X application that makes it easy to bring new programmers to Rails and Ruby.

&lt;p&gt;I think the idea is fantastic.  When I first started learning Ruby I had to do battle with compilers, RubyGems didn't exist, the &lt;a href="http://raa.ruby-lang.org/"&gt;RAA&lt;/a&gt; had but a handful of libraries, and there weren't really even any tutorials for learning Ruby around.  I had either fortitude or stubbornness on my side to get through the much steeper learning curve than many of you had to deal with to get where I am today, and it sucked.

&lt;p&gt;I think the idea of soliciting community for funding is fantastic.  It's not the first time a Rubyist has solicited money to work on open source.  I funded &lt;a href="http://majesticseacreature.com/"&gt;Gregory Brown's&lt;/a&gt; work on &lt;a href="http://prawn.majesticseacreature.com/"&gt;Prawn&lt;/a&gt; a few years ago and was happy to do so even though I've never used Prawn (although I'd like to someday) I was incredibly happy to support it.  I'll probably never use Rails.app, either, but that doesn't mean I'm not happy to support it, nor that Rubyists are wrong to support it.

&lt;p&gt;Now, to get to my point, I don't understand why I keep seeing such negative feedback around Yehuda's choice of soliciting money to bring us Rails.app.  Sure, it may just be a few of you, but if you don't want to give Yehuda money, fine, just don't.  If you think Yehuda is asking for too much money, fine, just don't donate.  If you just don't like Yehuda, fine, just don't donate.

&lt;p&gt;But stop with the personal attacks, even the snarky ones and the jokes at Yehuda's expense.

&lt;p&gt;You would not find it so funny if people were ganging up on you.

&lt;p&gt;This is a fantastic idea Yehuda has presented and if he had the ability he would bring it to us for free.  Right now he doesn't have that ability so he's asking for our help.

&lt;p&gt;Being a major contributor to open source is incredibly difficult.  While thousands or even millions of people may be happily using your software, you mostly hear from the people who are having problems with it, especially after they're extremely frustrated.  Throwing insults atop this is incredibly demotivating and depressing, so cut it out.

&lt;p&gt;If want to continue to complain, whinge or make cruel jokes, towards Yehuda or any other Rubyist, why not take that effort and put it towards something positive.  Do something that is welcoming to new Rubyists like improving some ruby documentation, submitting a bug report or submitting a patch to fix a bug.

&lt;p&gt;Stop making our community look like a bunch of jerks.  It's fine if you disagree with another Rubyist, especially one who has contributed so heavily to Ruby, but you should have enough respect for them to be polite.

&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/iuKDCKp5dwg" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/03/29/on-community-funding-of-open-source</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1332</id>
    <published>2012-03-26T15:17:50-07:00</published>
    <updated>2012-03-26T15:17:50-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/fTWyhIcNOlY/net-http-persistent-2-6" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">net-http-persistent 2.6</title>
    <category term="software" label="Software" scheme="http://blog.segment7.net/category/software" />
    <content type="html">&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;a
href="http://docs.seattlerb.org/net-http-persistent"&gt;docs.seattlerb.org/net-http-persistent&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;a
href="https://github.com/drbrain/net-http-persistent"&gt;github.com/drbrain/net-http-persistent&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;Manages persistent connections using Net::HTTP plus a speed fix for Ruby
1.8. It&amp;rsquo;s thread-safe too!&lt;/p&gt;

&lt;p&gt;Using persistent HTTP connections can dramatically increase the speed of
HTTP. Creating a new HTTP connection for every request involves an extra
TCP round-trip and causes TCP congestion avoidance negotiation to start
over.&lt;/p&gt;

&lt;p&gt;Net::HTTP supports persistent connections with some API methods but does
not handle reconnection gracefully.  Net::HTTP::Persistent supports
reconnection and retry according to RFC 2616.&lt;/p&gt;

&lt;h3 id="label-Changes%3A"&gt;Changes:&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Minor enhancement&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;Net::HTTP::Persistent#idle_timeout may be set to nil to disable expiration
of connections.  Pull Request #21 by Aaron Stone&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;
&lt;/li&gt;&lt;/ul&gt;


&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/fTWyhIcNOlY" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/03/26/net-http-persistent-2-6</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1331</id>
    <published>2012-03-16T16:19:07-07:00</published>
    <updated>2012-03-16T16:19:07-07:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/7TXeyHlXX-A/a-use-of-enumerable-chunk" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">A use of Enumerable#chunk</title>
    <category term="ruby" label="Ruby" scheme="http://blog.segment7.net/category/ruby" />
    <content type="html">&lt;p&gt;In Ruby 1.9, Enumerable has a few new methods including Enumerable#chunk (which was added for 1.9.2).  The #chunk method walks your Enumerable and divides it into chunks based on a selecting block.  Unlike Enumerable#partition, the chunks are returned in-order.  Here's an example from the documentation:

&lt;pre&gt;&lt;code&gt;[3, 1, 4, 1, 5, 9, 2, 6, 5, 3, 5].chunk { |n|
  n.even?
}.each { |even, ary|
  p [even, ary]
}
#=&gt; [false, [3, 1]]
#   [true, [4]]
#   [false, [1, 5, 9]]
#   [true, [2, 6]]
#   [false, [5, 3, 5]]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;When I first saw this method I thought, "this looks like a useful method&amp;#8230; but how?"

&lt;p&gt;I'm working on bringing Markdown support to RDoc and the last remaining base Markdown feature I need to support is a hard break due to two spaces at the end of a line in a paragraph.

&lt;p&gt;For background, RDoc parses various formats into a common syntax tree which is can then be transformed for any supported output (such as HTML, colored ANSI text, etc.).  In this syntax tree a paragraph can contain one or more strings which are joined at output time into the paragraph you see.

&lt;p&gt;To add hard line breaks, I decided to create a new HardBreak object and inject it into the paragraph where two trailing spaces are encountered in the source document.  The formatters can then be updated to insert the appropriate line break character when emitting a paragraph.

&lt;p&gt;Enumerable#chunk comes in because the Markdown parser doesn't join strings as it's parsing (since the grammar rules get re-used) and is instead performed as a post-processing step.  (String joining as a post-processing step also makes the parser cleaner by hiding the ugliness in one spot rather than spreading it across multiple grammar rules.)  Before inserting HardBreak objects this was sufficient:

&lt;pre&gt;&lt;code&gt;parts = paragraph.parts.join.rstrip
paragraph.parts.replace [parts]&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;But now I need to join String chunks and include HardBreaks as-is which is a perfect use of Enumerable#chunk:

&lt;pre&gt;&lt;code&gt;parts = paragraph.parts.chunk do |part|
  String === part
end.map do |string, chunk|
  string ? chunk.join.rstrip : chunk
end.flatten

paragraph.parts.replace parts&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The 1.8-compatible implementation is much uglier since I have to track whether I'm in a String chunk or not in addition to performing the processing.  I'm too embarrassed to post it, but you'll be able to find it in the rdoc source once I commit and push it.

&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/7TXeyHlXX-A" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/03/16/a-use-of-enumerable-chunk</feedburner:origLink></entry>
  <entry>
    <id>tag:blog.segment7.net,2005:Article/1330</id>
    <published>2012-03-01T16:46:15-08:00</published>
    <updated>2012-03-01T16:46:15-08:00</updated>
    <link type="text/html" rel="alternate" href="http://feedproxy.google.com/~r/Segment7/~3/NrW28U26JtI/hoe-travis" />
    <author>
      <name>drbrain</name>
    </author>
    <title type="html">hoe-travis</title>
    <category term="ruby" label="Ruby" scheme="http://blog.segment7.net/category/ruby" />
    <content type="html">&lt;ul&gt;&lt;li&gt;
&lt;p&gt;&lt;a
href="https://github.com/drbrain/hoe-travis"&gt;github.com/drbrain/hoe-travis&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;&lt;a
href="http://docs.seattlerb.org/hoe-travis"&gt;docs.seattlerb.org/hoe-travis&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;p&gt;hoe-travis is a Hoe plugin that allows your gem to gain maximum benefit
from &lt;a href="http://travis-ci.org"&gt;travis-ci.org&lt;/a&gt;.  The plugin contains
a &lt;code&gt;.travis.yml&lt;/code&gt; generator and a pre-defined rake task which runs
the tests and ensures your manifest file is correct.&lt;/p&gt;

&lt;p&gt;With hoe-travis it is easy to add additional checks.  Custom checks can be
easily verified locally by simply running a rake task instead of committing
and pushing a change, waiting for travis to run your tests, then trying a
new commit if you didn&amp;rsquo;t fix the problem.&lt;/p&gt;

&lt;h3 id="label-Features"&gt;Features&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;
&lt;p&gt;.travis.yml generation task&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Pre-defined rake tasks which are run by travis-ci&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;
&lt;p&gt;Easy to hook up rake tasks for additional travis-ci setup or checks&lt;/p&gt;
&lt;/li&gt;&lt;/ul&gt;

&lt;h3 id="label-Getting+Started"&gt;Getting Started&lt;/h3&gt;

&lt;p&gt;If you&amp;rsquo;re not already using Hoe with your project, see: &lt;a
href="http://docs.seattlerb.org/hoe/Hoe.pdf"&gt;docs.seattlerb.org/hoe/Hoe.pdf&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To get started with hoe-travis, first install it:&lt;/p&gt;

&lt;pre&gt;sudo gem install hoe-travis&lt;/pre&gt;

&lt;p&gt;Then add hoe-travis as a plugin to your Rakefile:&lt;/p&gt;

&lt;pre&gt;Hoe.plugin :travis&lt;/pre&gt;

&lt;p&gt;Then generate a .travis.yml&lt;/p&gt;

&lt;pre&gt;$ rake travis:generate&lt;/pre&gt;

&lt;p&gt;This will bring up your EDITOR with your travis.yml for any desired tweaks.
Save the file when you&amp;rsquo;re done, then check in your .travis.yml.  For
further details of how the configuration is generated see &lt;a href="http://docs.seattlerb.org/hoe-travis/Hoe/Travis.html#label-Setup"&gt;Setup at Hoe::Travis&lt;/a&gt;
and &lt;a href="http://docs.seattlerb.org/hoe-travis/Hoe/Travis.html#label-Hoe+Configuration"&gt;Configuration at Hoe::Travis&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;(If you don&amp;rsquo;t have the EDITOR environment variable set to your favorite
editor, please do so.  Note that some editors may need extra flags to wait
for files to be edited.  For MacVIM, &lt;code&gt;export EDITOR=&amp;quot;mvim
--remote-wait&amp;quot;&lt;/code&gt; will wait for the file to be closed before
returning.)&lt;/p&gt;

&lt;p&gt;If you would like to make future changes to your .travis.yml you can run:&lt;/p&gt;

&lt;pre&gt;$ rake travis:edit&lt;/pre&gt;

&lt;p&gt;Which, like &lt;code&gt;travis:generate&lt;/code&gt;, will bring up your EDITOR with
your .travis.yml.  When you&amp;rsquo;ve saved the file the changes will be checked
by travis-lint before writing back to .travis.yml and give you a chance to
correct them.&lt;/p&gt;

&lt;p&gt;If you&amp;rsquo;ve edited your .travis.yml by hand you can run:&lt;/p&gt;

&lt;pre&gt;$ rake travis:check&lt;/pre&gt;

&lt;p&gt;to check it.&lt;/p&gt;

&lt;p&gt;Testing your travis-ci setup is easy with hoe-travis.  You can run:&lt;/p&gt;

&lt;pre&gt;$ rake travis&lt;/pre&gt;

&lt;p&gt;to run the same checks travis-ci will.  By default this includes running
the tests and ensuring the Manifest.txt file is complete.  There is also
the before script:&lt;/p&gt;

&lt;pre&gt;$ rake travis:before&lt;/pre&gt;

&lt;p&gt;Which will run the setup tasks needed for your project.&lt;/p&gt;

&lt;p&gt;You can also enable and disable travis-ci using &lt;code&gt;rake
travis:enable&lt;/code&gt; and &lt;code&gt;rake travis:disable&lt;/code&gt;.  See
&lt;a href="http://docs.seattlerb.org/hoe-travis/Hoe/Travis.html#label-Setup"&gt;Setup at Hoe::Travis&lt;/a&gt; for details.&lt;/p&gt;


&lt;img src="http://feeds.feedburner.com/~r/Segment7/~4/NrW28U26JtI" height="1" width="1"/&gt;</content>
  <feedburner:origLink>http://blog.segment7.net/2012/03/01/hoe-travis</feedburner:origLink></entry>
</feed>

