Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

[merb-cache] Hide an alias call from YARD

  • Loading branch information...
commit e80cbbe62cd33e04090593bb1bdf9c095f7b73da 1 parent 9bc1f25
Nicos Gollan authored November 09, 2010
6  merb-cache/lib/merb-cache/merb_ext/controller.rb
@@ -34,7 +34,10 @@ def eager_cache(trigger_action, target = trigger_action, conditions = {}, &blk)
34 34
       end
35 35
 
36 36
       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))
37  
-      alias_method "_eager_cache_#{trigger_action}_to_#{target_controller.name.snake_case}__#{target_action}_after", :_eager_cache_after
  37
+
  38
+      #FIXME: workaround for long filename in YARD when using 1.9-style parser
  39
+      #alias_method "_eager_cache_#{trigger_action}_to_#{target_controller.name.snake_case}__#{target_action}_after", :_eager_cache_after
  40
+      send(:alias_method, "_eager_cache_#{trigger_action}_to_#{target_controller.name.snake_case}__#{target_action}_after", :_eager_cache_after)
38 41
     end
39 42
 
40 43
     def eager_dispatch(action, params = {}, env = {}, blk = nil)
@@ -189,4 +192,5 @@ def _parameters_and_conditions(conditions)
189 192
 
190 193
     return parameters, conditions.except(:params, :store, :stores)
191 194
   end
  195
+
192 196
 end
2  yard/merbext.rb
@@ -2,4 +2,4 @@
2 2
 
3 3
 # Use the legacy parser, as the new one has issues with namespaces
4 4
 # and generates some very long filenames for dynamic aliases.
5  
-YARD::Parser::SourceParser.parser_type = :ruby18
  5
+#YARD::Parser::SourceParser.parser_type = :ruby18

0 notes on commit e80cbbe

Please sign in to comment.
Something went wrong with that request. Please try again.