Permalink
Browse files

In Rails >= 2.2.0, the concat helper doesn't need the block.binding a…

…rgument. Makes bundle_fu not use the block.binding for Rails.version >= 2.2.0, so warnings won't be generated.
  • Loading branch information...
1 parent e8460cc commit 8056fd05c7ee4f637eb6137d544e91065400daab @bernardo bernardo committed Nov 18, 2008
Showing with 17 additions and 5 deletions.
  1. +17 −5 lib/bundle_fu.rb
View
@@ -121,14 +121,26 @@ def bundle(options={}, &block)
new_filelist.save_as(abs_filelist_path)
end
- if File.exists?(abs_path) && options[:bundle_fu]
- concat( filetype==:css ? stylesheet_link_tag(output_filename) : javascript_include_tag(output_filename), block.binding)
+ if File.exists?(abs_path) && options[:bundle_fu]
+ tag = filetype==:css ? stylesheet_link_tag(output_filename) : javascript_include_tag(output_filename)
+ if Rails::version < "2.2.0"
+ concat( tag , block.binding)
+ else
+ #concat doesn't need block.binding in Rails >= 2.2.0
+ concat( tag )
+ end
+
end
}
- unless options[:bundle_fu]
- concat( content, block.binding )
+ unless options[:bundle_fu]
+ if Rails::version < "2.2.0"
+ concat( content, block.binding )
+ else
+ #concat doesn't need block.binding in Rails >= 2.2.0
+ concat( content )
+ end
end
end
end
-end
+end

0 comments on commit 8056fd0

Please sign in to comment.