Anyone ever dreamed of a lorem ipsum generator or somesuch that could be passed a character maximum count? Something like Hipster.paragraph_by_characters(256).
Use cases:
I think this is a good idea. Happy to do this one if people are keen.
Hi guys, sorry to jump in @keithbro , but I thought I'd have a shot at working this (newbie to opensource, and could do with the experience on a straight forward fix!)
Is the desire to have exactly N characters returned, or at least N characters returned?
The goal, in my mind, is to test around validations, so we might want an exact character count returned to make sure we can hit the max character validation / go over that limit on each test.
(I鈥檝e been using the Number library and just returning giant integers as a workaround that is functionally perfect but aesthetically meh)
I'm thinking it might make more sense to implement this as an optional argument to the paragraph methods rather than creating a new paragraph_by_chars method. It would also be nice to switch to named arguments for that approach. I've been wanting to do that for all of Faker.
I was originally going to go down the line of adding it to the existing paragraphs method (makes much more sense in my opinion than making a whole new method), but had the same thought of where to set the param. It gets a bit long winded once you've had to account for number of sentences, whether to include supplemental words etc, so essentially I'd agree that named params are the way to go.
We've reviewed the PR and merged it.
Most helpful comment
I'm thinking it might make more sense to implement this as an optional argument to the paragraph methods rather than creating a new paragraph_by_chars method. It would also be nice to switch to named arguments for that approach. I've been wanting to do that for all of Faker.