Commit 33df3ed3 authored by Robert Speicher's avatar Robert Speicher

Add `respond_to_missing?` for Commit and Repository

As of Ruby 1.9, this is the correct way to handle `respond_to?` for
methods implemented by `method_missing`.

See https://robots.thoughtbot.com/always-define-respond-to-missing-when-overriding
parent 57830201
......@@ -172,10 +172,8 @@ class Commit
@raw.send(m, *args, &block)
end
def respond_to?(method)
return true if @raw.respond_to?(method)
super
def respond_to_missing?(method, include_private = false)
@raw.respond_to?(method, include_private) || super
end
# Truncate sha to 8 characters
......
......@@ -163,10 +163,8 @@ class Repository
end
end
def respond_to?(method)
return true if raw_repository.respond_to?(method)
super
def respond_to_missing?(method, include_private = false)
raw_repository.respond_to?(method, include_private) || super
end
def blob_at(sha, path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment