sevenwire/forgery — pull request #71 by mouchtaris (2014-12-04 12:03:28+00:00)
Title: Proposition for LoremIpsum::each_paragraph

each_paragraph is essentially factoring-out some of paragraphs' functionality, so that there is better separation of responsibilities, etc. As a free side-effect, we get more flexibility if desired.

each_paragraph takes over the paragraph generation logic, while paragraphs takes over decoration and utility roles. It is essentially a convenience wrapper-method for each_paragraph.

each_paragraph honours the :sentences and :random-related options. paragraphs passes its options to each_paragraph, so they can be "forwarded".

This passes all the pragraphs related behaviour tests, including the two new I added concerning behaviour when a block is passed (pull #70).

This pull request builds on top of #70, which suggested changing the behaviour of paragraphs so that they yield their decorated paragraphs if a block is given. For a cleaner view of the refactoring differences alone, one could see the diff between my master and lorem branches, [here](https://github.com/mouchtaris/forgery/compare/mouchtaris:master...lorem).

I raise this pull request as a separate matter so that it can be discussed separately. In case #70 is rejected, this refactoring is still valid and can be fixed to apply cleanly.