Skip to content

Commit

Permalink
[merb-cache] Hide an alias call from YARD
Browse files Browse the repository at this point in the history
  • Loading branch information
ngollan committed Nov 9, 2010
1 parent 9bc1f25 commit e80cbbe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion merb-cache/lib/merb-cache/merb_ext/controller.rb
Expand Up @@ -34,7 +34,10 @@ def eager_cache(trigger_action, target = trigger_action, conditions = {}, &blk)
end

after("_eager_cache_#{trigger_action}_to_#{target_controller.name.snake_case}__#{target_action}_after", conditions.only(:if, :unless).merge(:with => [target_controller, target_action, conditions, blk], :only => trigger_action))
alias_method "_eager_cache_#{trigger_action}_to_#{target_controller.name.snake_case}__#{target_action}_after", :_eager_cache_after

#FIXME: workaround for long filename in YARD when using 1.9-style parser
#alias_method "_eager_cache_#{trigger_action}_to_#{target_controller.name.snake_case}__#{target_action}_after", :_eager_cache_after
send(:alias_method, "_eager_cache_#{trigger_action}_to_#{target_controller.name.snake_case}__#{target_action}_after", :_eager_cache_after)
end

def eager_dispatch(action, params = {}, env = {}, blk = nil)
Expand Down Expand Up @@ -189,4 +192,5 @@ def _parameters_and_conditions(conditions)

return parameters, conditions.except(:params, :store, :stores)
end

end
2 changes: 1 addition & 1 deletion yard/merbext.rb
Expand Up @@ -2,4 +2,4 @@

# Use the legacy parser, as the new one has issues with namespaces
# and generates some very long filenames for dynamic aliases.
YARD::Parser::SourceParser.parser_type = :ruby18
#YARD::Parser::SourceParser.parser_type = :ruby18

0 comments on commit e80cbbe

Please sign in to comment.