From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6939 64.71.128.0/18 X-Spam-Status: No, score=-1.9 required=3.0 tests=AWL,BAYES_00, MSGID_FROM_MTA_HEADER shortcircuit=no autolearn=unavailable version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.raindrops.general Subject: Re: [PATCH] Adds pathname support Date: Tue, 5 Jun 2012 00:47:38 +0000 Message-ID: <20120605004738.GA11265@dcvr.yhbt.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1338857288 21699 80.91.229.3 (5 Jun 2012 00:48:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 5 Jun 2012 00:48:08 +0000 (UTC) To: raindrops@librelist.org Original-X-From: raindrops@librelist.org Tue Jun 05 02:48:06 2012 Return-path: Envelope-to: gclrrg-raindrops@m.gmane.org List-Archive: List-Help: List-Id: List-Post: List-Subscribe: List-Unsubscribe: Precedence: list Original-Sender: raindrops@librelist.org Xref: news.gmane.org gmane.comp.lang.ruby.raindrops.general:76 Archived-At: Received: from zedshaw.xen.prgmr.com ([64.71.167.205]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SbhwA-0000Bq-7A for gclrrg-raindrops@m.gmane.org; Tue, 05 Jun 2012 02:47:54 +0200 Received: from zedshaw.xen.prgmr.com (localhost [IPv6:::1]) by zedshaw.xen.prgmr.com (Postfix) with ESMTP id C866021DD9B for ; Tue, 5 Jun 2012 00:55:53 +0000 (UTC) Brian Corrigan wrote: > Hi Guys - I've never submitted a patch via email before. Apologies if > I get this completely wrong (go easy!) Thanks. I prefer patches inline since it's easier to apply/review, but some mail clients mangle them. git send-email comes with git and is a good way to send email if you're stuck on a mail client than mangles email. Also, don't include HTML parts/attachments to your email (ever :P). > Also, I had a problem getting > the tests to run on 1.9.3. In any case, here goes.. What was the error? 1.9.3 is my primary platform. I've inlined your patch below and have a few comments inline: > From fd82f8f1e0d8fa91b90235a066d1c5ad936cbc0d Mon Sep 17 00:00:00 2001 > From: Brian Corrigan > Date: Mon, 4 Jun 2012 16:50:07 -0400 > Subject: [PATCH 1/2] Adds pathname support The commit message should explain why the change is necessary. > --- a/lib/raindrops/linux.rb > +++ b/lib/raindrops/linux.rb No require for 'pathname'? > @@ -41,6 +41,7 @@ module Raindrops::Linux > else > paths = paths.map do |path| > path = path.dup > + path = Pathname.new(path).realpath.to_s It should be possible to safely remove the "path = path.dup" line above. > path.force_encoding(Encoding::BINARY) if defined?(Encoding) > rv[path] > Regexp.escape(path) > diff --git a/test/test_linux.rb b/test/test_linux.rb > index 65f25e0..953549e 100644 > --- a/test/test_linux.rb > +++ b/test/test_linux.rb > @@ -1,6 +1,7 @@ > # -*- encoding: binary -*- > require 'test/unit' > require 'tempfile' > +require 'tmpdir' > require 'raindrops' > require 'socket' > require 'pp' I noticed your second patch reverted this change. Better to use "git commit --amend" to rewrite changes (especially trivial ones) before sending them so you don't propagate the noise going forward.