public
Fork of mocra/fmdb-migration-manager
Description: Schema Migration support for the SQLite library FMDB
Homepage: http://mocra.com
Clone URL: git://github.com/drnic/fmdb-migration-manager.git
100644 19 lines (16 sloc) 0.361 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
class String
  def underscore
    gsub(/::/, '/').
    gsub(/([A-Z]+)([A-Z][a-z])/,'\1_\2').
    gsub(/([a-z\d])([A-Z])/,'\1_\2').
    downcase
  end
end
 
Autotest.add_hook :initialize do |at|
  at.add_mapping(/Classes\/(.*)\.[mh]/) do |_, m|
    ["test/test_#{m[1].underscore}.rb"]
  end
end
 
Autotest.add_hook :run_command do |at|
  system "rake compile"
end