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

allow alias in specific cases #173

Closed
jurriaan opened this issue May 15, 2013 · 4 comments
Closed

allow alias in specific cases #173

jurriaan opened this issue May 15, 2013 · 4 comments
Labels
Milestone

Comments

@jurriaan
Copy link
Contributor

This is not allowed right now, but alias_method is no alternative for alias in instance_exec:

cli.instance_exec do
  alias :old_trap_interrupt :trap_interrupt
end
@bbatsov
Copy link
Collaborator

bbatsov commented May 15, 2013

Yep, I'm aware of that. alias is also required if you want to alias a global variable. We'll have to improve that cop for sure.

@whitequark
Copy link

@jurriaan You can still use cli.singleton_class.class_exec, though (and it will have the same effect, I believe).

@bbatsov
Copy link
Collaborator

bbatsov commented Jun 26, 2013

I've added a check for global variables. At some point I'll revisit this, but it's fairly low on my todo list.

@bbatsov bbatsov closed this as completed in a328d1a Nov 6, 2013
@jurriaan
Copy link
Contributor Author

jurriaan commented Nov 6, 2013

👍

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

3 participants