bin/sb in starting_blocks-0.0.1 vs bin/sb in starting_blocks-0.0.2
- old
+ new
@@ -1,19 +1,29 @@
#!/usr/bin/env ruby
require 'fssm'
+def display value
+end
+
+if ARGV.include? '--verbose'
+ def display value
+ puts value
+ end
+end
+
def run_all_specs
specs = Dir['**/*_spec*'].select { |f| File.file?(f) }.map do |x|
File.expand_path(x)
end
run_these_specs specs
end
def run_these_specs specs
requires = specs.map { |x| "require '#{x}'" }.join("\n")
+ display specs.inspect
puts `ruby -e "#{requires}"`
end
def add_it(file, files)
@@ -21,13 +31,15 @@
files << file
end
def run_it(file, files)
filename = file.downcase.split('/')[-1].gsub('_spec', '')
+ display file.inspect
+ display filename.inspect
matches = files.select { |x| x.gsub('_spec', '').include?(filename) && x != file }
matches << file
specs = matches.select! { |x| x.include?('_spec') }.map { |x| File.expand_path x }
- puts specs.inspect
+ display specs.inspect
run_these_specs specs
end
def delete_it(file, files)
files.delete(file)