3.1.1 * Injecting blocks method into controller to be able to define blocks from the controller that the view will use. 3.1.0 * Added content_tag utility block, wrapping around Rails' content_tag method, which may be used directly or indirectly (such as via a wrapper or hook) * Removed dead / outdated experimental code * Removed dynamic configurator (which was really just an almost copy of Rails' class_attribute) of Blocks in favor of mattr_accessor * Removed Ruby 1.9.3 support, now requires >= 2.0 * Added Extensive Test coverage * Deprecated Blocks::Builder#render_with_overrides and made it an alias for Blocks::Builder#render * Added GTM to documentation * Added a Rails Engine for autoconfiguration of eager_loading options * Moved and deprecated content_tag_wrapper utility block into Blocks::LegacyBuilders * Hooks and Wrappers now may render with their own sets of Hooks and Wrappers * Cleaned and fixed logic around generation / merging of options for hooks and and wrappers of a block * Moved Haml Extensions into a separate module that only executes if Haml is defined * Deprecated with_template method injected into ActionView::Base * Moved Blocks::HashWithCaller into a module and now conditionally inject based on global configuration * Switched Blocks::HashWithRenderStrategy to use symbols for hash keys instead of string, allowing it to be extracted as hash keyword arguments to methods * Removed blocks.define :collection functionality 3.0.0 (September 27, 2017) * 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| %>