Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only clear task if it's already defined #376

Merged
merged 1 commit into from
Jan 23, 2015
Merged

Conversation

domcleal
Copy link
Contributor

@domcleal domcleal commented Jan 2, 2015

Else rake throws a RuntimeError, "Don't know how to build task 'lint'"


Since 0f2e2db / #331 / #332, requiring the file that loads the initial lint rake task throws the following error:

$ irb -Ilib -rpuppet-lint/tasks/puppet-lint
/home/dcleal/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/task_manager.rb:49:in `[]': Don't know how to build task 'lint' (RuntimeError)
        from /home/dcleal/.rvm/gems/ruby-2.0.0-p247@global/gems/rake-10.1.0/lib/rake/task.rb:348:in `[]'
        from /home/dcleal/code/puppet/puppet-lint/lib/puppet-lint/tasks/puppet-lint.rb:54:in `define'
        from /home/dcleal/code/puppet/puppet-lint/lib/puppet-lint/tasks/puppet-lint.rb:45:in `initialize'
        from /home/dcleal/code/puppet/puppet-lint/lib/puppet-lint/tasks/puppet-lint.rb:87:in `new'
        from /home/dcleal/code/puppet/puppet-lint/lib/puppet-lint/tasks/puppet-lint.rb:87:in `<top (required)>'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:51:in `require'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/init.rb:286:in `block in load_modules'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/init.rb:284:in `each'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/init.rb:284:in `load_modules'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb/init.rb:20:in `setup'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/irb.rb:380:in `start'
        from /home/dcleal/.rvm/rubies/ruby-2.0.0-p247/bin/irb:16:in `<main>'

It appears it's not checking if the task is defined or not before attempting to clear it.

Else rake throws a RuntimeError, "Don't know how to build task 'lint'"
rodjek pushed a commit that referenced this pull request Jan 23, 2015
Only clear task if it's already defined
@rodjek rodjek merged commit 2f30575 into rodjek:master Jan 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants