Skip to content

Commit

Permalink
Add gem watchr script
Browse files Browse the repository at this point in the history
  • Loading branch information
mynyml committed Oct 5, 2009
1 parent c8c66f8 commit b2f7d35
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions Manifest
Expand Up @@ -5,6 +5,7 @@ README
Rakefile
TODO
VERSION
gem.watchr
lib/phocus.rb
lib/phocus/autodetect.rb
phocus.gemspec
Expand Down
39 changes: 39 additions & 0 deletions gem.watchr
@@ -0,0 +1,39 @@
# Run me with:
#
# $ watchr gem.watchr
#
# Manifest file can be automatically generated with:
#
# $ cat .git/hooks/post-commit
# #!bin/sh
# git ls-files > Manifest
#

# --------------------------------------------------
# Helpers
# --------------------------------------------------
def build
system "rake -s gemspec; rake -s gem"; puts
end

# --------------------------------------------------
# Watchr Rules
# --------------------------------------------------
watch( '^Rakefile$' ) { build }
watch( '^Manifest$' ) { build }
watch( '^VERSION$' ) { build }

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

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


# vim:ft=ruby
1 change: 1 addition & 0 deletions phocus.gemspec
Expand Up @@ -78,6 +78,7 @@ files:
- Rakefile
- TODO
- VERSION
- gem.watchr
- lib/phocus.rb
- lib/phocus/autodetect.rb
- phocus.gemspec
Expand Down

0 comments on commit b2f7d35

Please sign in to comment.