Professional Web Applications Themes

POLS ANT file pattern in Ruby - Ruby

This is a multi-part message in MIME format. ------=_NextPart_000_094E_01C39585.7A570C60 Content-Type: text/plain; cht="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I am returning to a bit of Ruby hacking after spending a couple of years = away from it. I met someone who is newer to Ruby and caught some of = their excitement for it (Hi Dan).=20 My day job has me writing Java code. As many of you will know the = default build tool for Java projects is ANT. ANT is a step forward from = the pre-ANT world, but has problems -- one of the big ones is that it is ...

  1. #1

    Default POLS ANT file pattern in Ruby

    This is a multi-part message in MIME format.

    ------=_NextPart_000_094E_01C39585.7A570C60
    Content-Type: text/plain;
    cht="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    Hi,

    I am returning to a bit of Ruby hacking after spending a couple of years =
    away from it. I met someone who is newer to Ruby and caught some of =
    their excitement for it (Hi Dan).=20

    My day job has me writing Java code. As many of you will know the =
    default build tool for Java projects is ANT. ANT is a step forward from =
    the pre-ANT world, but has problems -- one of the big ones is that it is =
    XML based, and thus verbose. XML as good as YAML for data, and not as =
    good as Ruby for programming :). =20

    Dan and I were talking about building a Ruby replacement for ANT. One =
    week-end we both decided to start writing it, and came up with =
    test-cases.. Dan came up with a name (BOB), and there is now a piece of =
    vapourware.

    My test cases are to do with ANT FileSetish behavour.

    Ant has some interesting globbing functionality that works very similar =
    to File::fnmatch, but slightly different.

    I like the ant way, but don't want to suprise Ruby people.

    Here is the test cases that talk about the behaviour I want.

    File.fnmatch would provide similar functionality (with =
    File::FNM_PATHNAME it comes really close), except I don't see that the =
    last test could past easily.

    Before I make the last test pass, I want to know if Ruby people would =
    find the behaviour described to be suprising?

    matcher =3D FilePatternMatcher.new
    assert(matcher.match("test.txt", "test.txt"))
    assert(matcher.match("test.txt", "*"))
    assert(matcher.match("second.txt", "*"))
    assert(matcher.match("test.txt", "*.txt"), "*.txt should match =
    test.txt")
    matcher =3D FilePatternMatcher.new
    assert(matcher.match("test.txt", "test.*"), "test.* should match =
    test.txt")
    assert(!matcher.match("somedirectory/test.txt", "*.txt"), "*.txt =
    should not match somedirectory/test.txt")
    assert(!matcher.match("test.txt", "*.doc"))
    assert(matcher.match("first/second/test.txt", "**/test.txt"))
    =
    assert(!matcher.match("first/second/third/fourth/fifth/test.txt", =
    "**/third/*/test.txt"))


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system ([url]http://www.grisoft.com[/url]).
    Version: 6.0.522 / Virus Database: 320 - Release Date: 30/09/2003
    ------=_NextPart_000_094E_01C39585.7A570C60
    Content-Type: text/html;
    cht="iso-8859-1"
    Content-Transfer-Encoding: quoted-printable

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML><HEAD>
    <META http-equiv=3DContent-Type content=3D"text/html; =
    cht=3Diso-8859-1">
    <META content=3D"MSHTML 6.00.2800.1264" name=3DGENERATOR>
    <STYLE></STYLE>
    </HEAD>
    <BODY bgColor=3D#ffffff>
    <DIV><FONT face=3DArial size=3D2>Hi,</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>I am returning to a bit of Ruby hacking =
    after=20
    spending a couple of years away from it.&nbsp; I met someone who is =
    newer to=20
    Ruby and caught some of their excitement for it (Hi Dan). </FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>My day job has me writing Java =
    code.&nbsp; As many=20
    of you will know the default build tool for Java projects is ANT.&nbsp; =
    ANT is a=20
    step forward from the pre-ANT world, but has problems -- one of the big =
    ones is=20
    that it is XML based, and thus verbose.&nbsp; XML as good as YAML for =
    data, and=20
    not as good as Ruby for programming :).&nbsp; </FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>Dan and I were talking about building a =
    Ruby=20
    replacement for ANT.&nbsp; One week-end we both decided to start writing =
    it, and=20
    came up with test-cases.. Dan came up with a name (BOB), and there is =
    now a=20
    piece of vapourware.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>My test cases are to do with ANT =
    FileSetish=20
    behavour.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>Ant has some interesting globbing =
    functionality=20
    that works very similar to File::fnmatch, but slightly =
    different.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>I like the ant way, but don't want to =
    suprise Ruby=20
    people.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>Here is the test cases that talk about =
    the=20
    behaviour I want.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>File.fnmatch would provide similar =
    functionality=20
    (with File::FNM_PATHNAME it comes really close), except I don't see that =
    the=20
    last test could past easily.</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2>Before I make the last test pass, I =
    want to know if=20
    Ruby people would find the behaviour described to be =
    suprising?</FONT></DIV>
    <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
    <DIV><FONT face=3DArial =
    size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ; matcher=20
    =3D FilePatternMatcher.new<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =

    assert(matcher.match("test.txt",=20
    "test.txt"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;=20
    assert(matcher.match("test.txt",=20
    "*"))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
    assert(matcher.match("second.txt", "*"))<BR></FONT><FONT face=3DArial=20
    size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
    assert(matcher.match("test.txt", "*.txt"),&nbsp; "*.txt should match=20
    test.txt")<BR></FONT><FONT face=3DArial=20
    size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ; matcher =3D=20
    FilePatternMatcher.new<BR>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
    assert(matcher.match("test.txt", "test.*"), "test.* should match=20
    test.txt")<BR></FONT><FONT face=3DArial=20
    size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
    assert(!matcher.match("somedirectory/test.txt", "*.txt"),&nbsp;"*.txt =
    should not=20
    match somedirectory/test.txt")<BR></FONT><FONT face=3DArial=20
    size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
    assert(!matcher.match("test.txt", "*.doc"))<BR></FONT><FONT face=3DArial =

    size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
    assert(matcher.match("first/second/test.txt", =
    "**/test.txt"))<BR></FONT><FONT=20
    face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
    assert(!matcher.match("first/second/third/fourth/fifth/test.txt",=20
    "**/third/*/test.txt"))</FONT></DIV>
    <DIV>&nbsp;</DIV>
    <DIV><FONT face=3DArial size=3D2><BR>---<BR>Outgoing mail is certified =
    Virus=20
    Free.<BR>Checked by AVG anti-virus system (<A=20
    href=3D"http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: =
    6.0.522 /=20
    Virus Database: 320 - Release Date: =
    30/09/2003</FONT></DIV></BODY></HTML>

    ------=_NextPart_000_094E_01C39585.7A570C60--


    Robert Dawson Guest

  2. #2

    Default Re: POLS ANT file pattern in Ruby

    * Robert Dawson <robertrojotek.com> [1008 15:08]:
    > Hi,
    >
    > I am returning to a bit of Ruby hacking after spending a couple of years away from it. I met someone who is newer to Ruby and caught some of their excitement for it (Hi Dan).
    > My day job has me writing Java code. As many of you will know the default build tool for Java projects is ANT. ANT is a step forward from the pre-ANT world, but has problems -- one of the big ones is that it is XML based, and thus verbose. XML as good as YAML for data, and not as good as Ruby for programming :).

    Good luck with this - I was talking only yesterday about
    how easy life could be with a tool with the power of ant
    tasks and the simplicity of Ruby and YAML - I'm never using
    XML again if I can help it, since I got RSI.

    Let us know if something turns up on RubyForge!

    --
    I'm going to Boston to see my doctor. He's a very sick man.
    -- Fred Allen
    Rasputin :: Jack of All Trades - Master of Nuns

    Rasputin Guest

  3. #3

    Default Have You Seen Rake?

    On Sat, 2003-10-18 at 10:06, Robert Dawson wrote:
    > Dan and I were talking about building a Ruby replacement for ANT. One week-end
    > we both decided to start writing it, and came up with test-cases.. Dan
    > came up with a name (BOB), and there is now a piece of vapourware.
    You might want to take a look at Rake
    ([url]http://onestepback.org/software/rake[/url] for now, I'm in the process of
    moving to RubyForge).

    Rake was based on Make rather than Ant, but once you throw away Make's
    weird tab syntax and Ant's XML syntax, the underlying functionality
    would probably be pretty close.

    Let me know if you are interested in colaborating.

    --
    -- Jim Weirich [email]jweirichone.net[/email] [url]http://onestepback.org[/url]
    -----------------------------------------------------------------
    "Beware of bugs in the above code; I have only proved it correct,
    not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

    Jim Weirich Guest

  4. #4

    Default Re: Have You Seen Rake?

    On Sun, 19 Oct 2003 06:54:31 +0900
    Jim Weirich <jweirichone.net> wrote:
    > On Sat, 2003-10-18 at 10:06, Robert Dawson wrote:
    > > Dan and I were talking about building a Ruby replacement for ANT. One week-end
    > > we both decided to start writing it, and came up with test-cases.. Dan
    > > came up with a name (BOB), and there is now a piece of vapourware.
    >
    > You might want to take a look at Rake
    I second this. Rake is very cool. (I thought you might want an opinion
    from someone other than the author. :-) )

    Jason Creighton
    Jason Creighton Guest

  5. #5

    Default Re: Have You Seen Rake?

    Jason Creighton <androfluxsofthome.net.remove.to.reply> wrote:
    > On Sun, 19 Oct 2003 06:54:31 +0900
    > Jim Weirich <jweirichone.net> wrote:
    >
    >> On Sat, 2003-10-18 at 10:06, Robert Dawson wrote:
    >> > Dan and I were talking about building a Ruby replacement for ANT. One week-end
    >> > we both decided to start writing it, and came up with test-cases.. Dan
    >> > came up with a name (BOB), and there is now a piece of vapourware.
    >>
    >> You might want to take a look at Rake
    >
    > I second this. Rake is very cool. (I thought you might want an opinion
    > from someone other than the author. :-) )
    Has anyone ported a complicated makefile over to rake? That would make
    the basis of a good article, I think.

    martin
    Martin DeMello Guest

Similar Threads

  1. Search and replace pattern in a file
    By Perl in forum PERL Beginners
    Replies: 2
    Last Post: January 20th, 01:04 AM
  2. Replies: 6
    Last Post: November 22nd, 12:46 PM
  3. Replies: 0
    Last Post: October 18th, 08:33 PM
  4. Replies: 2
    Last Post: September 16th, 09:32 AM
  5. Replies: 1
    Last Post: August 15th, 11:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139