Permalink
Browse files

[merb-cache] Hide an alias call from YARD

  • Loading branch information...
1 parent 9bc1f25 commit e80cbbe62cd33e04090593bb1bdf9c095f7b73da @ngollan ngollan committed Nov 9, 2010
Showing with 6 additions and 2 deletions.
  1. +5 −1 merb-cache/lib/merb-cache/merb_ext/controller.rb
  2. +1 −1 yard/merbext.rb
View
6 merb-cache/lib/merb-cache/merb_ext/controller.rb
@@ -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)
@@ -189,4 +192,5 @@ def _parameters_and_conditions(conditions)
return parameters, conditions.except(:params, :store, :stores)
end
+
end
View
2 yard/merbext.rb
@@ -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.