lib/rails/tasks/engine.rake in railties-7.0.8.6 vs lib/rails/tasks/engine.rake in railties-7.1.0.beta1
- old
+ new
@@ -16,11 +16,11 @@
end
end
task environment: "app:environment"
if !defined?(ENGINE_ROOT) || !ENGINE_ROOT
- ENGINE_ROOT = find_engine_path(APP_RAKEFILE)
+ ENGINE_ROOT = find_engine_path(Pathname.new(APP_RAKEFILE))
end
end
def app_task(name)
task name => [:load_app, "app:db:#{name}"]
@@ -41,21 +41,21 @@
desc "Create the database from config/database.yml for the current Rails.env (use db:create:all to create all databases in the config)"
app_task "create"
app_task "create:all"
- desc "Drops the database for the current Rails.env (use db:drop:all to drop all databases)"
+ desc "Drop the database for the current Rails.env (use db:drop:all to drop all databases)"
app_task "drop"
app_task "drop:all"
desc "Load fixtures into the current environment's database."
app_task "fixtures:load"
- desc "Rolls the schema back to the previous version (specify steps w/ STEP=n)."
+ desc "Roll the schema back to the previous version (specify steps w/ STEP=n)."
app_task "rollback"
- desc "Creates a database schema file (either db/schema.rb or db/structure.sql, depending on `config.active_record.schema_format`)"
+ desc "Create a database schema file (either db/schema.rb or db/structure.sql, depending on `config.active_record.schema_format`)"
app_task "schema:dump"
desc "Load a schema.rb file into the database"
app_task "schema:load"
@@ -63,23 +63,23 @@
app_task "seed"
desc "Create the database, load the schema, and initialize with the seed data (use db:reset to also drop the database first)"
app_task "setup"
- desc "Retrieves the current schema version number"
+ desc "Retrieve the current schema version number"
app_task "version"
# desc 'Load the test schema'
app_task "test:prepare"
end
def find_engine_path(path)
- return File.expand_path(Dir.pwd) if path == "/"
+ return File.expand_path(Dir.pwd) if path.root?
if Rails::Engine.find(path)
- path
+ path.to_s
else
- find_engine_path(File.expand_path("..", path))
+ find_engine_path(path.join(".."))
end
end
Rake.application.invoke_task(:load_app)