ruby-avm-library/reek.watchr

13 lines
321 B
Plaintext
Raw Normal View History

2011-03-23 18:10:02 +00:00
watch('lib/(.*)\.rb') { |file| reek(file[0]) }
watch('spec/(.*)_spec\.rb') { |file| reek("lib/#{file[1]}.rb") }
def reek(file = nil)
file ||= Dir['lib/**/*.rb'].join(' ')
spec_file = file.gsub('lib/', 'spec/').gsub('.rb', '_spec.rb')
system %{bundle exec rspec -c #{spec_file}}
system %{reek #{file}}
end
reek