Skip to content

Task.clear does not remove parameters #156

@jessebs

Description

@jessebs

Task.clear does not remove the handling of parameters. This can easily be seen by the following example:

desc 'Original Test Task'
task :test, [:param] do; end

Rake::Task[:test].clear
desc 'Replaced Test Task'
task :test do; end

rake -T yields

rake test[param] # Replaced Test Task

Adding the following after the call to clear corrects it, so clear just needs to remove the params

Rake::Task[:test].instance_variable_set(:@arg_names, nil)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions