Skip to content

Commit

Permalink
Add local gem.watchr script
Browse files Browse the repository at this point in the history
  • Loading branch information
mynyml committed Sep 17, 2009
1 parent 0a5ae85 commit 1524c35
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
7 changes: 5 additions & 2 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,11 @@ Signal#trap calls, etc. Updates to script files are picked up on the fly (no
need to restart watchr) so experimenting is painless.

The wiki[http://wiki.github.com/mynyml/watchr] has more details and examples.
You can also take a look at watchr's own specs.watchr script in the root dir,
as well as docs.watchr
You might also want to take a look at watchr's own scripts,
specs.watchr[http://github.com/mynyml/watchr/blob/master/specs.watchr],
docs.watchr[http://github.com/mynyml/watchr/blob/master/docs.watchr] and
gem.watchr[http://github.com/mynyml/watchr/blob/master/gem.watchr], to get you
started.


=== Install
Expand Down
31 changes: 31 additions & 0 deletions gem.watchr
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Run me with:
#
# $ watchr gem.watchr

# --------------------------------------------------
# Convenience Methods
# --------------------------------------------------
def build(gemspec)
system "gem build %s" % gemspec
puts
end

# --------------------------------------------------
# Watchr Rules
# --------------------------------------------------
watch( '^watchr.gemspec$' ) { |m| build m[0] }

# --------------------------------------------------
# Signal Handling
# --------------------------------------------------
# Ctrl-\
Signal.trap('QUIT') do
puts " --- Building Gem ---\n\n"
build 'watchr.gemspec'
end

# Ctrl-C
Signal.trap('INT') { abort("\n") }


# vim:ft=ruby

0 comments on commit 1524c35

Please sign in to comment.