Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Sinatra's public hides Ruby's public method in Module #301

Closed
krisselden opened this Issue · 1 comment

2 participants

@krisselden

The code below causes public method in Module to be redefined:

set :public, Proc.new { root && File.join(root, 'public') }

I discovered this after using alias_method_chain to decorate the error method:

alias_method_chain :error, :formatting

which fails here:

def alias_method_chain(target, feature)
  ...
  case
  when public_method_defined?(without_method)
  public target
  when
  ...
end

Instead of usingalias_method_chain I just used alias_method but I think it is smelly to redefine public. It also messes up syntax highlighting which considers public a keyword.

@rkh rkh was assigned
@rkh
Owner

I will look into a fix.

@rkh rkh closed this in d1ab58d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.