Skip to content

Commit

Permalink
Feature: Monitor files in lib/ and app/ directories. This might need …
Browse files Browse the repository at this point in the history
…some more polish.
  • Loading branch information
wayneeseguin committed Dec 8, 2009
1 parent c620aef commit fc7371d
Showing 1 changed file with 20 additions and 3 deletions.
23 changes: 20 additions & 3 deletions scripts/monitor
Expand Up @@ -40,14 +40,16 @@ update_timestamp "test"
update_timestamp "spec"

while : ; do
changed_test_files=() ; changed_spec_files=()
changed_test_files=() ; changed_spec_files=() ; changed_code_files=()

for file in lib/**/*.rb lib/*.rb app/**/*.rb app/*.rb ; do
if [[ -f "$file" ]] ; then push_if_timestamp_changed $file "code" ; fi
done

for framework in test spec ; do

if [[ -d "$framework/" ]] ; then

#files=($(\ls ${framework}/**/*_${framework}.rb) $(ls ${framework}/*_${framework}.rb))
#for file in "${files[@]}" ; do
for file in ${framework}/**/*_${framework}.rb ${framework}/*_${framework}.rb ; do
if [[ -f "$file" ]] ; then
push_if_timestamp_changed $file $framework
Expand All @@ -69,6 +71,21 @@ while : ; do
fi
update=1
fi

if [[ "$(array_length "changed_code_files")" -gt 0 ]] ; then
rvm_ruby_version=$original_ruby_version
rvm_ruby_string=$original_ruby_string
if [[ "spec" = "$framework" ]] ; then
rvm_action="spec"
rvm_ruby_args="spec/"
__rvm_do
elif [[ "test" = "$framework" ]] ; then
rvm_action="rake"
rvm_ruby_args="test"
__rvm_do
fi
update=1
fi
fi

if [[ "$update" -eq 1 ]] ; then
Expand Down

0 comments on commit fc7371d

Please sign in to comment.