3.0.0 () * Complete rewrite of the blocks gem * Extensive test coverage added * Jenkins CI integration * Extensive documentation added: http://hunterae.github.io/blocks/ * Blocks branding and documentation styling applied: Thanks [Alexis Gormley](https://github.com/n2diving) 2.8.0 (January 21, 2016) * When rendering a collection of blocks through blocks.render BLOCK_NAME, collection: COLLECTION, current_index will now be passed as a param for the options hash passed to the block. Example: <% blocks.define :my_block do |object, options| %> Item <%= options[:current_index] + 1 %>: <%= object %> <% end %> <%= blocks.render :my_block, collection: ["a", "b", "c"] %> 2.7.0 (December 9, 2015) * Added configuration option skip_applies_to_surrounding_blocks. When set to true, if blocks.skip :SOME_BLOCK is called, any before, after, and around hooks applied to that block will also be skipped when the block attempts to render. This may be configured in an initializer as follows: Blocks.setup { |config| config.skip_applies_to_surrounding_blocks = true } * Cleanup to Blocks::Base to reduce code duplication 2.6.4 (July 21, 2014) * Removed dependence on jeweler for managing gem * Small cleanups of the code 2.6.1 (November 4, 2013) * Made content_tag_with_block a public method in Blocks::Base so that it can be used in table-for gem. 2.6.0 (November 4, 2013) * Internally changed how configuration works (externally, it should feel the same, with the exception of the fact that templates_folder was changed to partials_folder... this will likely change again in the coming days) * Started cleaning up and rewriting some of the tests 2.5.1 (October 17, 2013) * Changed Blocks.wrap_with_surrounds_before_and_after_blocks to Blocks.wrap_before_and_after_blocks 2.5.0 (October 14, 2013) * Added skip method as a shorthand for defining or replacing a block's definition so that nothing is output when the block is rendered * Added ability to wrap each block in a collection with an element or render a block with an element, using syntax like: <%= blocks.render :brand, :collection => @brands, :wrap_each => {:tag => "div", :style => "border: 1px solid black", :class => Proc.new {cycle("even", "odd")}}, :wrap_with => {:tag => "div", :style => "color: red"} %> <%= blocks.render :brand, :wrap_with => {:tag => "div", :class => Proc.new {cycle("even", "odd")}} %> * Changed blocks.surrounding_tag_surrounds_before_and_after_blocks to Blocks.wrap_with_surrounds_before_and_after_blocks 2.4.0 (September 4, 2013) * Moved queue and render_templates methods into the new with_template gem. 2.3.1 (September 3, 2013) * Removed call to autoload class that was moved into a separate gem, broke .rvmrc into .ruby-gemset and .ruby-version 2.3.0 (August 27, 2013) * Moved all of the call call_if_proc and call_each_hash_value_if_proc and ProcWithArgs class into a separate gem (https://github.com/hunterae/call_with_params), now a dependency. 2.2.0 (August 16, 2013) * Moved evaluated_procs and evaulated_proc into their own class and renamed to call_each_hash_value and call and created view helpers called call_each_hash_value_if_proc and call_if_proc 2.1.0 (July 3, 2013) * Biggest change is that this gem was moved back to the blocks repo and renamed from building-blocks to blocks, it's original name. * changed rendering so that partials are no longer rendered by default * surrounding_tag_surrounds_before_and_after_blocks is now false, by default, meaning that if a block has a surrounding_tag, it will only render the block's contents inside that tag, and any before and after blocks will render outside that tag. * allows render options to be skipped or provider new helper methods, building blocks from the controller, got rid of aliases for "blocks", specify render order? * allows blocks to be defined from a controller action using the same syntax 2.0.0 (October 18, 2012) * Added ability to render a collection of objects and specify the surrounding elements and the html to apply to those surrounding elements For example: blocks.render :test, :collection => @cuisine_types, :as => :cuisine_type, :surrounding_tag => "div", :surrounding_tag_html => {:class => Proc.new {cycle("even", "odd")}} * Added ability to specify "around" blocks, i.e. blocks of view code that render around another block of code, such as: <% blocks.around :test_block do |content_block| %>