capistrano/capistrano — pull request #983 by dmarkow (2014-03-26 02:12:52+00:00)
Title: Use a string for the ensure_stage task

Rake 10.2.0 changed the way it parses tasks. Previously, its `parse_task_string` method worked fine with `Rake::Task` objects, but the updated logic places the task name on the right side of a `=~` comparison, raising `TypeError: no implicit conversion of Rake::Task into String` when it tries to parse the `ensure_stage` task. While not documented explicitly, the fact that the method is named `def parse_task_string(string)` implies that it should always be given a `String` object.

Making sure `ensure_task` is added to `@top_level_tasks` as a string instead of a Rake::Task object fixes this.