scripts/monitor in rvm-0.0.88 vs scripts/monitor in rvm-0.0.89
- old
+ new
@@ -38,18 +38,20 @@
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
fi
done
@@ -63,9 +65,24 @@
__rvm_do
elif [[ "test" = "$framework" ]] ; then
rvm_action="ruby"
rvm_ruby_args=" -r$(echo "${changed_test_files[*]}" | sed 's/ / -r/g') test/test_helper.rb"
+ __rvm_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