lib/pgsync/init.rb in pgsync-0.6.0 vs lib/pgsync/init.rb in pgsync-0.6.1

- old
+ new

@@ -28,13 +28,24 @@ else exclude = if rails? <<~EOS exclude: - - schema_migrations - ar_internal_metadata + - schema_migrations EOS + elsif django? + # TODO exclude other tables? + <<~EOS + exclude: + - django_migrations + EOS + elsif laravel? + <<~EOS + exclude: + - migrations + EOS else <<~EOS # exclude: # - table1 # - table2 @@ -48,11 +59,19 @@ log "#{file} created. Add your database credentials." end end + def django? + (File.read("manage.py") =~ /django/i) rescue false + end + def heroku? `git remote -v 2>&1`.include?("git.heroku.com") rescue false + end + + def laravel? + File.exist?("artisan") end def rails? File.exist?("bin/rails") end