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

undefined method `loc' for :path_to:Symbol #716

Closed
tamird opened this issue Jan 4, 2014 · 3 comments
Closed

undefined method `loc' for :path_to:Symbol #716

tamird opened this issue Jan 4, 2014 · 3 comments
Labels

Comments

@tamird
Copy link
Contributor

tamird commented Jan 4, 2014

This exception occurs when rubocop is scanning a file with -a and that file contains a method definition without parens (e.g. def foo bar, baz). That condition alone is not enough to set it off, so this is some kind of interaction. In addition, the same exact file does not generate this exception in rubocop 0.15.0.

Sorry this isn't more helpful, I tried to repro with a smaller case and failed :(

@tamird
Copy link
Contributor Author

tamird commented Jan 4, 2014

Ah wait, I do have a simple repro!

module ImageHelper
  extend ActionView::Helpers::AssetTagHelper
  extend ActionView::Helpers::PathExtensions
  def self.path_to url
    path_to_image url
  end
  def self.config
    Web::Application.config
  end
  def self.controller
  end
end

This will cause it, even with the default config.

@bbatsov
Copy link
Collaborator

bbatsov commented Jan 14, 2014

I cannot reproduce this on the current master. Please, post here the stacktrace you're getting.

@bbatsov
Copy link
Collaborator

bbatsov commented Jan 14, 2014

Forget that - I found the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants