bin/sb in starting_blocks-0.0.3 vs bin/sb in starting_blocks-0.0.4

- old
+ new

@@ -10,11 +10,11 @@ puts value end end def run_all_specs - specs = Dir['**/*_spec*'].select { |f| File.file?(f) }.map do |x| + specs = Dir['**/*_spec.rb*'].select { |f| File.file?(f) }.map do |x| File.expand_path(x) end run_these_specs specs end @@ -34,11 +34,11 @@ def run_it(file, files) filename = file.downcase.split('/')[-1].gsub('_spec', '') display "File to run is: #{file}" display "Filename: #{filename}" - matches = files.select { |x| x.gsub('_spec', '').include?(filename) && x != file } + matches = files.select { |x| x.gsub('_spec.rb', '.rb').include?(filename) && x != file } matches << file specs = matches.select! { |x| x.include?('_spec') }.map { |x| File.expand_path x } display "Matches: #{specs.inspect}" run_these_specs specs end @@ -49,10 +49,10 @@ files.delete(file) end if ARGV.include? '--watch' files = Dir['**/*'] - location = File.expand_path(File.dirname(Dir['**/*_spec*'].first)) + location = File.expand_path(File.dirname(Dir['**/*_spec.rb*'].first)) FSSM.monitor(location, '**/*') do update {|base, relative| run_it relative, files } delete {|base, relative| delete_it relative, files } create {|base, relative| add_it relative, files } end