Skip to content

Commit

Permalink
'dk add ruby fpm'
Browse files Browse the repository at this point in the history
  • Loading branch information
jordansissel committed Feb 29, 2012
1 parent d05c332 commit 3035186
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .batcave/manifest
@@ -0,0 +1,5 @@
---
things:
ruby:
args:
- fpm
46 changes: 46 additions & 0 deletions Makefile
@@ -0,0 +1,46 @@
GEMSPEC=$(shell ls *.gemspec)
VERSION=$(shell awk -F\" '/spec.version/ { print $$2 }' $(GEMSPEC))
NAME=$(shell awk -F\" '/spec.name/ { print $$2 }' $(GEMSPEC))
GEM=$(NAME)-$(VERSION).gem

.PHONY: test
test:
sh notify-failure.sh ruby test/all.rb

.PHONY: testloop
testloop:
while true; do \
$(MAKE) test; \
$(MAKE) wait-for-changes; \
done

.PHONY: serve-coverage
serve-coverage:
cd coverage; python -mSimpleHTTPServer

.PHONY: wait-for-changes
wait-for-changes:
-inotifywait --exclude '\.swp' -e modify $$(find $(DIRS) -name '*.rb'; find $(DIRS) -type d)

.PHONY: package
package: | $(GEM)

.PHONY: gem
gem: $(GEM)

$(GEM):
gem build $(GEMSPEC)

.PHONY: test-package
test-package: $(GEM)
# Sometimes 'gem build' makes a faulty gem.
gem unpack $(GEM)
rm -rf ftw-$(VERSION)/

.PHONY: publish
publish: test-package
gem push $(GEM)

.PHONY: install
install: $(GEM)
gem install $(GEM)
15 changes: 15 additions & 0 deletions notify-failure.sh
@@ -0,0 +1,15 @@
#!/bin/sh

"$@"
status=$?

if [ ! -z "$TMUX" ] ; then
if [ "$status" -ne 0 ] ; then
tmux display-message "Tests Fail"
else
tmux display-message "Tests OK"
fi
fi

exit $status

3 changes: 2 additions & 1 deletion test/docs.rb
@@ -1,7 +1,6 @@
require "rubygems"
require "yard"
require File.join(File.expand_path(File.dirname(__FILE__)), "testing")
require "minitest/autorun"

describe "documentation tests" do
before do
Expand All @@ -12,6 +11,8 @@
end

test "All classes, methods, modules, and constants must be documented" do
# YARD's parser works best in ruby 1.9.x, so skip 1.8.x
skip if RUBY_VERSION < "1.9.2"
# Note, the 'find the undocumented things' code here is
# copied mostly from: YARD 0.7.5's lib/yard/cli/stats.rb
#
Expand Down

0 comments on commit 3035186

Please sign in to comment.