# File lib/rhc/helpers.rb, line 237 def section(params={}, &block) top = params[:top] top = 0 if top.nil? bottom = params[:bottom] bottom = 0 if bottom.nil? # add more newlines if top is greater than the last section's bottom margin top_margin = @@section_bottom_last # negitive previous bottoms indicate that an untracked newline was # printed and so we do our best to negate it since we can't remove it if top_margin < 0 top += top_margin top_margin = 0 end until top_margin >= top say "\n" top_margin += 1 end block.call bottom_margin = 0 until bottom_margin >= bottom say "\n" bottom_margin += 1 end @@section_bottom_last = bottom end