lib/deployml/frameworks/rails3.rb in deployml-0.4.0 vs lib/deployml/frameworks/rails3.rb in deployml-0.4.1
- old
+ new
@@ -7,35 +7,27 @@
#
module Rails3
include Rails
#
- # Installs any dependencies using `bundle install --deployment`.
- #
- # @param [LocalShell, RemoteShell] shell
- # The shell to execute commands in.
- #
- def install(shell)
- shell.run 'bundle', 'install', '--deployment'
- end
-
- #
# Migrates the database using the `db:autoupgrade` if
# [DataMapper](http://datamapper.org) is being used, or the typical
# `db:migrate` task.
#
# @param [LocalShell, RemoteShell] shell
# The shell to execute commands in.
#
def migrate(shell)
- task = case @orm
- when :datamapper
- 'db:autoupgrade'
- else
- 'db:migrate'
- end
+ case @orm
+ when :datamapper
+ shell.status "Running DataMapper auto-upgrades ..."
+ shell.run 'rake', 'db:autoupgrade', "RAILS_ENV=#{@environment}"
+ else
+ shell.status "Running ActiveRecord migrations ..."
+ shell.run 'rake', 'db:migrate', "RAILS_ENV=#{@environment}"
+ end
- shell.run 'rake', task, "RAILS_ENV=#{@environment}"
+ shell.status "Database migrated."
end
end
end
end