Permalink
Browse files

Doc alias_matcher as a method alias w/o loading an extension.

This should make it doc properly on rubydoc.info.

Fixes #467.
  • Loading branch information...
1 parent b447ee4 commit ad7dbd493fe81cd7ac2d659dcd22ede571d2c118 @myronmarston myronmarston committed Feb 21, 2014
Showing with 4 additions and 6 deletions.
  1. +0 −1 .yardopts
  2. +4 −0 lib/rspec/matchers.rb
  3. +0 −5 yard/alias_matcher.rb
View
1 .yardopts
@@ -1,4 +1,3 @@
---load ./yard/alias_matcher.rb
--exclude features
--no-private
--markup markdown
View
4 lib/rspec/matchers.rb
@@ -227,6 +227,10 @@ module Matchers
#
# be_sorted_by(:age).description # => "be sorted by age"
# a_list_sorted_by(:age).description # => "a list sorted by age"
+ #
+ # @!macro [attach] alias_matcher
+ # @!parse
+ # alias $1 $2
def self.alias_matcher(new_name, old_name, &description_override)
description_override ||= lambda do |old_desc|
old_desc.gsub(Pretty.split_words(old_name), Pretty.split_words(new_name))
View
5 yard/alias_matcher.rb
@@ -1,5 +0,0 @@
-require 'yard'
-
-YARD::Handlers::Ruby::AliasHandler.class_eval do
- handles method_call(:alias_matcher)
-end

0 comments on commit ad7dbd4

Please sign in to comment.