Browse files

fixed method delegation to prawn DSL to include meta specials

  • Loading branch information...
1 parent 7d19087 commit 18053defe476df2fdbbcdaca6d14b66bbae7ca14 @patrickhno committed Apr 25, 2012
Showing with 16 additions and 4 deletions.
  1. +16 −4 lib/crayfish/action_view.rb
View
20 lib/crayfish/action_view.rb
@@ -76,12 +76,24 @@ def flush paint=true
buf
end
- def method_missing(meth, *args, &block)
- if @pdf.respond_to?(meth)
+ def method_missing(id,*args,&block)
+ case(id.to_s)
+ when /^fill_and_stroke_(.*)/
flush
- @pdf.send(meth,*args)
+ @pdf.send($1,*args,&block); @pdf.fill_and_stroke
+ when /^stroke_(.*)/
+ flush
+ @pdf.send($1,*args,&block); @pdf.stroke
+ when /^fill_(.*)/
+ flush
+ @pdf.send($1,*args,&block); @pdf.fill
else
- super
+ if @pdf.respond_to?(id)
+ flush
+ @pdf.send(id,*args,&block)
+ else
+ super
+ end
end
end

0 comments on commit 18053de

Please sign in to comment.