Sha256: cfb1453b0ffe2367e45f1500023a91c95763c449bca99e876ad17e692d906ab9
Contents?: true
Size: 710 Bytes
Versions: 3
Compression:
Stored size: 710 Bytes
Contents
# encoding: utf-8 module Rubocop module Cop module Style # The purpose of the this cop is advise the use of # alias_method over the alias keyword whenever possible. class Alias < Cop MSG = 'Use alias_method instead of alias.' # TODO make this check context aware - alias_method is not # available outside of classes/modules. def on_alias(node) # alias_method can't be used with global variables new, old = *node return if new.type == :gvar && old.type == :gvar add_offence(:convention, node.loc.keyword, MSG) super end end end end end
Version data entries
3 entries across 3 versions & 2 rubygems
Version | Path |
---|---|
rubocop-0.9.1 | lib/rubocop/cop/style/alias.rb |
sabat-rubocop-0.9.0 | lib/rubocop/cop/style/alias.rb |
rubocop-0.9.0 | lib/rubocop/cop/style/alias.rb |