raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: raindrops@librelist.org
Subject: Re: [PATCH] Adds pathname support
Date: Tue, 5 Jun 2012 00:47:38 +0000	[thread overview]
Message-ID: <20120605004738.GA11265@dcvr.yhbt.net> (raw)
In-Reply-To: CALO9HP3oK6m6Vdj6aG9fWkMAd4t5+6f1jLZLd1mUkG5Mpq13DQ@mail.gmail.com

Brian Corrigan <bcorrigan78@gmail.com> wrote:
> Hi Guys - I've never submitted a patch via email before.  Apologies if
> I get this completely wrong (go easy!)


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 <brian@agoragames.com>
> 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.

  reply	other threads:[~2012-06-05  0:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CALO9HP2oBDPBaeKx8N_Lp9GbfTOoGTFkKXcyfZJaJm=E_ksLOA@mail.gmail.com>
2012-06-05  0:07 ` [PATCH] Adds pathname support Brian Corrigan
2012-06-05  0:47   ` Eric Wong [this message]
2012-06-05 15:45     ` Brian Corrigan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/raindrops/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120605004738.GA11265@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=raindrops@librelist.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).