blog.segment7.net Archives - 27 May 2013, Monday

  • rdoc 4.0.0

    blog.segment7.net 24 Feb '13, 5pm

    The default output encoding for RDoc is now UTF-8. Previously RDoc used the default external encoding which was determined from your locale. Issue #106 by Justin Baker. RDoc::RI::Store is now RDoc::Store so ri data generated by RDoc 4 cannot be read by earlier versions of RDoc. RDoc::...

    Related:
    1. 4.0: Beta 1 released! weblog.rubyonrails.org 26 Feb '13, 12am
  • How to Name Gems

    blog.segment7.net 19 Jan '13, 9pm

    drbrain | Mon, 15 Nov 2010 22:12:20 GMT Posted in Rubygems If you went to the first round of RubyConf lightning talks you saw me say this already, but I got enough applause that this needs wider dissemination. Here is my STRONG recommendation on how to name gems: Use underscores fancy...

  • Ruby 1.9.3 Documentation Challenge

    blog.segment7.net 18 Nov '12, 11am

    Ruby 1.9.3 Documentation Challenge drbrain | Tue, 10 May 2011 00:33:00 GMT Posted in Ruby Yugui announced a draft Ruby 1.9.3 release plan today with a feature freeze of end of May and a release target of end of July or early August. I've seen many complaints in the form of "X lacks do...

  • Streaming zlib processing for Ruby

    blog.segment7.net 10 Jul '12, 8pm

    Earlier today I checked in a patch that adds streaming zlib processing to Ruby. This allows you to process a stream without needing to allocate space to hold the entire result. To add the streaming support I changed #inflate and #deflate to accept a block. A handful of other methods (...

  • Verifying benchmarks with ministat

    blog.segment7.net 27 Jun '12, 11pm

    Verifying benchmarks with ministat drbrain | Wed, 27 Jun 2012 23:48:50 GMT Posted in Ruby , Testing Most people know to benchmark to verify performance improvements, but comparing a handful of results isn't enough. You need to be sure your results are statistically significant. minist...

  • OptionParser Argument Casting

    blog.segment7.net 25 May '12, 2pm

    Argument casting allows you to validate a command-line option and convert it from the user-supplied String into whichever object you like. The ri for OptionParser has an example similar to this one for casting a floating-point argument into a Float value:

  • Mechanize 2.5

    blog.segment7.net 09 May '12, 8pm

    drbrain | Wed, 09 May 2012 20:48:00 GMT Posted in Software Documentation Source 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 popula...

  • Mechanics of Programming

    blog.segment7.net 04 May '12, 2am

    drbrain | Fri, 04 May 2012 00:57:28 GMT Posted in Misc I sat down with Elise Worthy at RailsConf to pair with her on a Rails application that used the Wunderground API to retrieve the weather for multiple cities. If you don't know Elise, she's a Hungry Academy student formerly of Seat...

  • Mechanize 2.4 Security Fix

    blog.segment7.net 21 Apr '12, 1am

    Mechanize#auth and Mechanize#basic_auth allowed disclosure of passwords to malicious servers and have been deprecated. 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 se...

    Related:
    1. Ruby 1.9.2-p320 is released ruby-lang.org 21 Apr '12, 11pm
  • $stdout vs STDOUT

    blog.segment7.net 16 Apr '12, 9am

    drbrain | Thu, 17 Aug 2006 16:47:00 GMT Posted in Ruby You may have noticed me using both $stdout and STDOUT in my last post and been puzzled by how I could use both. When Ruby starts up the process’ standard output file descriptor is stored in both the constant STDOUT and the global ...

  • Setting $stdout per-thread

    blog.segment7.net 16 Apr '12, 9am

    drbrain | Wed, 16 Aug 2006 18:58:00 GMT Posted in Hacking , Ruby cdfh on #ruby-lang asked how to redirect $stdout per-thread and I came up with this solution, redirect via a thread-local variable: ## # Allows $stdout to be set via Thread.current[:stdout] per thread. module ThreadOut #...

    Related:
    1. $stdout vs STDOUT blog.segment7.net 16 Apr '12, 9am
  • rdoc-spellcheck 1.0

    blog.segment7.net 10 Apr '12, 12am

    drbrain | Mon, 09 Apr 2012 23:34:30 GMT Posted in RDoc , Software Source Documentation Bug Reports 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 wor...

  • ruby-growl 4.0

    blog.segment7.net 05 Apr '12, 12am

    drbrain | Thu, 05 Apr 2012 00:36:32 GMT Posted in Software ruby-growl version 4.0 has been released! Documentation 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-...

  • return_bang 1.1

    blog.segment7.net 01 Apr '12, 9pm

    drbrain | Sun, 01 Apr 2012 20:10:28 GMT Posted in Software home github.com/drbrain/return_bang rdoc docs.seattlerb.org/return_bang bugs github.com/drbrain/return_bang/issues return_bang implements non-local exits for methods. As a bonus, you also get exception handling that ignores st...

  • On Community Funding of Open Source

    blog.segment7.net 30 Mar '12, 2am

    On Community Funding of Open Source drbrain | Fri, 30 Mar 2012 02:49:42 GMT Posted in Ruby The other day Yehuda Katz announced a kickstarter for creating Rails.app , an OS X application that makes it easy to bring new programmers to Rails and Ruby. I think the idea is fantastic. When ...

  • net-http-persistent 2.6

    blog.segment7.net 27 Mar '12, 12am

    drbrain | Mon, 26 Mar 2012 22:17:50 GMT Posted in Software docs.seattlerb.org/net-http-persistent github.com/drbrain/net-http-persistent Manages persistent connections using Net::HTTP plus a speed fix for Ruby 1.8. It’s thread-safe too! Using persistent HTTP connections can dramatical...

  • A use of Enumerable#chunk

    blog.segment7.net 16 Mar '12, 11pm

    drbrain | Fri, 16 Mar 2012 23:19:07 GMT Posted in Ruby 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 ...

  • hoe-travis

    blog.segment7.net 02 Mar '12, 12am

    drbrain | Fri, 02 Mar 2012 00:46:15 GMT Posted in Ruby github.com/drbrain/hoe-travis docs.seattlerb.org/hoe-travis hoe-travis is a Hoe plugin that allows your gem to gain maximum benefit from travis-ci.org . The plugin contains a .travis.yml generator and a pre-defined rake task which...

  • mechanize 2.3

    blog.segment7.net 21 Feb '12, 1am

    drbrain | Tue, 21 Feb 2012 01:18:20 GMT Posted in Software mechanize.rubyforge.org github.com/tenderlove/mechanize The Mechanize library is used for automating interaction with websites. Mechanize automatically stores and sends cookies, follows redirects, and can follow links and subm...