Rakefile in comable_backend-0.4.1 vs Rakefile in comable_backend-0.4.2

- old
+ new

@@ -14,10 +14,15 @@ end APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__) load 'rails/tasks/engine.rake' +def command(string) + puts string + system string +end + if File.exist?('comable.gemspec') $LOAD_PATH.unshift File.expand_path('..', __FILE__) require 'tasks/release' namespace :app do @@ -43,13 +48,11 @@ task 'app:db:migrate' => 'migrate:all' namespace :migrate do task :all do FRAMEWORKS.each do |framework| - command = "cd #{framework} && test -d db && bundle exec rake db:migrate RAILS_ENV=#{Rails.env}" - puts command - system command + command "cd #{framework} && test -d db/migrate && bundle exec rake db:migrate RAILS_ENV=#{Rails.env}" end end end namespace :migrate do @@ -57,15 +60,12 @@ task 'app:db:migrate:reset' => 'app:db:migrate' task 'app:db:migrate' => 'reset:all' namespace :reset do task :all do - FRAMEWORKS.each do |framework| - command = "cd #{framework} && test -d db && bundle exec rake db:migrate:reset RAILS_ENV=#{Rails.env}" - puts command - system command - end + command "bundle exec rake db:drop db:create RAILS_ENV=#{Rails.env}" + Rake::Task['db:migrate'].invoke end end end end @@ -88,9 +88,10 @@ end namespace :brakeman do task :all do FRAMEWORKS.each do |framework| + next unless File.directory?("#{framework}/app") sh "brakeman --exit-on-warn --ignore-config .brakeman.ignore #{framework}" end end end