[ANN] directory_watcher 0.1.1

Discussion in 'Ruby' started by Tim Pease, Nov 13, 2006.

  1. Tim Pease

    Tim Pease Guest

    A class for watching files within a directory and generating events
    when those files change.

    The directory watcher operates by scanning a directory at some interval and
    generating a list of files based on a user supplied glob pattern. As the file
    list changes from one interval to the next, events are generated and
    dispatched to registered observers. Three types of events are supported --
    added, modified, and removed.


    Changes:

    Version 0.1.1 / 2006-11-10
    * removed explicit dependency on hoe

    Version 0.1.0 / 2006-11-10
    * initial release


    TwP
    Tim Pease, Nov 13, 2006
    #1
    1. Advertising

  2. Tim Pease

    Kenosis Guest

    Re: directory_watcher 0.1.1

    Tim Pease wrote:
    > A class for watching files within a directory and generating events
    > when those files change.
    >
    > The directory watcher operates by scanning a directory at some interval and
    > generating a list of files based on a user supplied glob pattern. As the file
    > list changes from one interval to the next, events are generated and
    > dispatched to registered observers. Three types of events are supported --
    > added, modified, and removed.
    >
    >
    > Changes:
    >
    > Version 0.1.1 / 2006-11-10
    > * removed explicit dependency on hoe
    >
    > Version 0.1.0 / 2006-11-10
    > * initial release
    >
    >
    > TwP


    And this would be available from where Tim?

    Ken
    Kenosis, Nov 13, 2006
    #2
    1. Advertising

  3. Tim Pease

    Tim Pease Guest

    Re: directory_watcher 0.1.1

    On 11/13/06, Kenosis <> wrote:
    >
    > And this would be available from where Tim?
    >


    RubyForge

    You can find it under the codeforpeople project. Or you can just
    download it via gem ...

    gem install -r directory_watcher


    I really need to drink more coffee before I send out these announcements :/

    TwP
    Tim Pease, Nov 13, 2006
    #3
  4. Tim Pease

    Eric Hodel Guest

    Re: directory_watcher 0.1.1

    On Nov 13, 2006, at 11:42 AM, Tim Pease wrote:
    > On 11/13/06, Kenosis <> wrote:
    >> And this would be available from where Tim?

    >
    > RubyForge
    >
    > You can find it under the codeforpeople project. Or you can just
    > download it via gem ...
    >
    > gem install -r directory_watcher
    >
    >
    > I really need to drink more coffee before I send out these
    > announcements :/


    Or just use Hoe and run rake release. Drops an email.txt ready for
    pasting into your email client of choice.

    --
    Eric Hodel - - http://blog.segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
    Eric Hodel, Nov 13, 2006
    #4
  5. Re: directory_watcher 0.1.1

    Eric Hodel wrote:
    > On Nov 13, 2006, at 11:42 AM, Tim Pease wrote:

    ...
    >> I really need to drink more coffee before I send out these
    >> announcements :/

    >
    > Or just use Hoe and run rake release. Drops an email.txt ready for
    > pasting into your email client of choice.


    Are you saying rake release has the same effect as drinking coffee?

    The feature I'm waiting for is "rake coffee": brews a cup of coffee
    while hoe runs your entire project for you :)

    --
    vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407
    Joel VanderWerf, Nov 13, 2006
    #5
  6. Tim Pease

    Eric Hodel Guest

    Coffee === hoe # => true (Was: Re: directory_watcher 0.1.1)

    On Nov 13, 2006, at 12:39 PM, Joel VanderWerf wrote:
    > Eric Hodel wrote:
    >> On Nov 13, 2006, at 11:42 AM, Tim Pease wrote:

    > ...
    >>> I really need to drink more coffee before I send out these
    >>> announcements :/

    >> Or just use Hoe and run rake release. Drops an email.txt ready
    >> for pasting into your email client of choice.

    >
    > Are you saying rake release has the same effect as drinking coffee?


    Hoe is like coffee in that it prevents you from making the mistakes
    that may result from insufficient caffeine levels.

    More of a coffee substitute when releasing packages.

    > The feature I'm waiting for is "rake coffee": brews a cup of coffee
    > while hoe runs your entire project for you :)


    Where is ruby-htcpcp?

    (http://www.ietf.org/rfc/rfc2324.txt)

    --
    Eric Hodel - - http://blog.segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
    Eric Hodel, Nov 13, 2006
    #6
  7. Tim Pease

    Tim Pease Guest

    On 11/13/06, Tanner Burson <> wrote:
    >
    > What were the reasons for creating this, as opposed to an extension of Ara's
    > dirwatch? http://codeforpeople.com/lib/ruby/dirwatch/
    >


    dirwatch is very awesome code. It is a great ruby application that
    "manages an sqlite database that mirrors the state of a directory and
    then triggers user definable event handlers for certain filesystem
    activities such file creation, modification, deletion, etc." It is
    meant to be used as its own application.

    directory_watcher, on the other hand, is a single ruby class that
    sends event objects to other ruby classes when the contents of a
    directory change. It is meant to be used within ruby scripts that need
    to know about file events.

    In summary
    dirwatch --> awesome ruby application
    directory_watcher --> awesome ruby class

    Blessings,
    TwP
    Tim Pease, Nov 13, 2006
    #7
  8. Tim Pease

    Tim Pease Guest

    Re: directory_watcher 0.1.1

    On 11/13/06, Eric Hodel <> wrote:
    >
    > Or just use Hoe and run rake release. Drops an email.txt ready for
    > pasting into your email client of choice.
    >


    You're assuming that the developer who wrote the hoe-ified rakefile
    remembered to include information about where to find the new release.
    That was my error.

    I have now modified my rakefile to include the following lines ...


    task :checklist do
    print "Did you double check the description? [y|N] "
    response = gets
    unless %r/y(es)?/i =~ response.strip
    raise RuntimeError, "check the description"
    end
    print "Did you double check the version number? [y|N] "
    unless %r/y(es)?/i =~ response.strip
    raise RuntimeError, "check the version number"
    end
    print "Do people know where to download this file? [y|N] "
    unless %r/y(es)?/i =~ response.strip
    raise RuntimeError, "help out the end user"
    end
    print "Have you had enough coffe? [y|N] "
    unless %r/y(es)?/i =~ response.strip
    raise RuntimeError, "go to Peet's"
    end
    end

    task :release => [:checklist]
    Tim Pease, Nov 13, 2006
    #8
  9. Tim Pease

    Tim Pease Guest

    Re: Coffee === hoe # => true (Was: Re: directory_watcher 0.1.1)

    On 11/13/06, Eric Hodel <> wrote:
    > On Nov 13, 2006, at 12:39 PM, Joel VanderWerf wrote:
    > > Eric Hodel wrote:
    > >> On Nov 13, 2006, at 11:42 AM, Tim Pease wrote:

    > > ...
    > >>> I really need to drink more coffee before I send out these
    > >>> announcements :/
    > >> Or just use Hoe and run rake release. Drops an email.txt ready
    > >> for pasting into your email client of choice.

    > >
    > > Are you saying rake release has the same effect as drinking coffee?

    >
    > Hoe is like coffee in that it prevents you from making the mistakes
    > that may result from insufficient caffeine levels.
    >
    > More of a coffee substitute when releasing packages.
    >
    > > The feature I'm waiting for is "rake coffee": brews a cup of coffee
    > > while hoe runs your entire project for you :)

    >
    > Where is ruby-htcpcp?
    >
    > (http://www.ietf.org/rfc/rfc2324.txt)
    >


    One implementation that has since been removed.

    http://en.wikipedia.org/wiki/Trojan_Room_coffee_pot

    TwP
    Tim Pease, Nov 13, 2006
    #9
  10. Tim Pease

    Guest

    Re: directory_watcher 0.1.1

    On Tue, 14 Nov 2006, Eric Hodel wrote:


    > Or just use Hoe and run rake release. Drops an email.txt ready for pasting
    > into your email client of choice.


    okay - __that__ is cool!

    can you specify stdout?

    rake release |mail -s traits

    that would make those of us that are truely lazy release like wildfire.

    -a
    --
    my religion is very simple. my religion is kindness. -- the dalai lama
    , Nov 14, 2006
    #10
  11. Tim Pease

    Tim Pease Guest

    Re: directory_watcher 0.1.1

    On 11/13/06, Eric Hodel <> wrote:
    >
    > Or just use Hoe and run rake release. Drops an email.txt ready for
    > pasting into your email client of choice.
    >


    $ rake --dry-run release
    (in /home/tpease/work/ruby/turn)
    ** Invoke release (first_time)
    ** Invoke clean (first_time)
    ** Invoke clobber_docs (first_time)
    ** Execute (dry run) clobber_docs
    ** Invoke clobber_package (first_time)
    ** Execute (dry run) clobber_package
    ** Execute (dry run) clean
    ** Invoke package (first_time)
    ** Invoke pkg/turn-0.0.0.tgz (first_time)
    ** Invoke pkg/turn-0.0.0 (first_time)
    ** Invoke README.txt (first_time, not_needed)
    ** Invoke lib/turn.rb (first_time, not_needed)
    ** Execute (dry run) pkg/turn-0.0.0
    ** Invoke README.txt (not_needed)
    ** Invoke lib/turn.rb (not_needed)
    ** Execute (dry run) pkg/turn-0.0.0.tgz
    ** Invoke gem (first_time)
    ** Invoke pkg/turn-0.0.0.gem (first_time)
    ** Invoke pkg (first_time)
    ** Execute (dry run) pkg
    ** Invoke README.txt (not_needed)
    ** Invoke lib/turn.rb (not_needed)
    ** Execute (dry run) pkg/turn-0.0.0.gem
    ** Execute (dry run) gem
    ** Execute (dry run) package
    ** Execute (dry run) release


    No dropping of email.txt :(

    Need to use "rake email" :)
    Tim Pease, Nov 14, 2006
    #11
  12. Tim Pease

    Eric Hodel Guest

    Re: directory_watcher 0.1.1

    On Nov 13, 2006, at 4:59 PM, Tim Pease wrote:
    > On 11/13/06, Eric Hodel <> wrote:
    >> Or just use Hoe and run rake release. Drops an email.txt ready for
    >> pasting into your email client of choice.

    >
    > $ rake --dry-run release
    >
    > No dropping of email.txt :(


    Sorry, rake announce (which also drops a news item on the project
    page at RubyForge).

    --
    Eric Hodel - - http://blog.segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
    Eric Hodel, Nov 14, 2006
    #12
  13. Tim Pease

    Eric Hodel Guest

    Re: directory_watcher 0.1.1

    On Nov 13, 2006, at 4:53 PM, wrote:
    > On Tue, 14 Nov 2006, Eric Hodel wrote:
    >
    >> Or just use Hoe and run rake release. Drops an email.txt ready
    >> for pasting into your email client of choice.

    >
    > okay - __that__ is cool!
    >
    > can you specify stdout?
    >
    > rake release |mail -s traits


    No. Also, the first line of email.txt is the subject.

    > that would make those of us that are truely lazy release like
    > wildfire.


    A send_email task wouldn't work cross-platform. Not everybody's
    machines are correctly set up to send email.

    --
    Eric Hodel - - http://blog.segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
    Eric Hodel, Nov 14, 2006
    #13
  14. Tim Pease

    Guest

    Re: directory_watcher 0.1.1

    On Wed, 15 Nov 2006, Eric Hodel wrote:

    > On Nov 13, 2006, at 4:53 PM, wrote:
    >> On Tue, 14 Nov 2006, Eric Hodel wrote:
    >>
    >>> Or just use Hoe and run rake release. Drops an email.txt ready for
    >>> pasting into your email client of choice.

    >>
    >> okay - __that__ is cool!
    >>
    >> can you specify stdout?
    >>
    >> rake release |mail -s traits

    >
    > No. Also, the first line of email.txt is the subject.
    >
    >> that would make those of us that are truely lazy release like wildfire.

    >
    > A send_email task wouldn't work cross-platform. Not everybody's machines are
    > correctly set up to send email.


    sure, but

    cmd = "rake release|mail -s #{ the_subject } "

    system cmd or warn "you system is wonky"

    might be ok ;-)

    -a
    --
    my religion is very simple. my religion is kindness. -- the dalai lama
    , Nov 14, 2006
    #14
  15. Tim Pease

    Eric Hodel Guest

    hoe send_email task (Was: Re: directory_watcher 0.1.1)

    On Nov 14, 2006, at 2:02 PM, wrote:
    > On Wed, 15 Nov 2006, Eric Hodel wrote:
    >> On Nov 13, 2006, at 4:53 PM, wrote:
    >>> On Tue, 14 Nov 2006, Eric Hodel wrote:
    >>>> Or just use Hoe and run rake release. Drops an email.txt ready
    >>>> for pasting into your email client of choice.
    >>> okay - __that__ is cool!
    >>> can you specify stdout?
    >>> rake release |mail -s traits

    >>
    >> No. Also, the first line of email.txt is the subject.
    >>
    >>> that would make those of us that are truely lazy release like
    >>> wildfire.

    >>
    >> A send_email task wouldn't work cross-platform. Not everybody's
    >> machines are correctly set up to send email.

    >
    > sure, but
    >
    > cmd = "rake release|mail -s #{ the_subject } ruby-talk@ruby-
    > lang.org"
    >
    > system cmd or warn "you system is wonky"


    Well, it might just send mail into the bit-bucket:

    $ mail
    Subject: test
    test
    EOT
    $ echo $?
    0
    $ mail
    Mail version 8.1 6/6/93. Type ? for help.
    "/var/mail/drbrain": 1 message 1 new
    >N 1 MAILER-DAEMON@pride- Wed Nov 15 00:43 69/2492 "Undelivered

    Mail Retu"
    &

    > might be ok ;-)


    If you can fix that, we await your patch at:

    http://rubyforge.org/tracker/?func=add&group_id=1513&atid=5923

    ;)

    --
    Eric Hodel - - http://blog.segment7.net
    This implementation is HODEL-HASH-9600 compliant

    http://trackmap.robotcoop.com
    Eric Hodel, Nov 15, 2006
    #15
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mike Sampson [MSFT]

    [ANN]: NNTP Server slow downs.

    Mike Sampson [MSFT], Oct 7, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    400
    Mike Sampson [MSFT]
    Oct 7, 2003
  2. Mike Sampson [MSFT]

    [ANN]: NNTP Server slow downs.

    Mike Sampson [MSFT], Dec 6, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    484
    Mike Sampson [MSFT]
    Dec 6, 2003
  3. Michael Livsey
    Replies:
    3
    Views:
    399
    Michael Livsey
    May 27, 2004
  4. Tim Pease
    Replies:
    2
    Views:
    90
    Tony Arcieri
    Apr 12, 2009
  5. Tim Pease

    [ANN] directory_watcher 1.3.0

    Tim Pease, Oct 21, 2009, in forum: Ruby
    Replies:
    0
    Views:
    72
    Tim Pease
    Oct 21, 2009
Loading...

Share This Page