Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log


## v2.0.0

- [PR #1349](https://github.com/stympy/faker/pull/1349) Add Namespace for Lorem - Faker::Lorem::Ipsum; Faker::Lorem::Flickr; Faker::Lorem::Pixel [@vbrazo](https://github.com/vbrazo)
- [PR #510](https://github.com/stympy/faker/pull/510) Make Faker::Number return integers and floats instead of strings [@tejasbubane](https://github.com/tejasbubane)

------------------------------------------------------------------------------

## HEAD Unreleased

### Bug/Fixes
Expand Down Expand Up @@ -912,4 +920,4 @@
* Initial release


\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
\* *This Change Log was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
47 changes: 47 additions & 0 deletions doc/v2.0/lorem/flickr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Faker::Lorem::Flickr

Available since version 1.9.0.

```ruby
Faker::Lorem::Flickr.image #=> "http://loremflickr.com/300/300"

Faker::Lorem::Flickr.image("50x60") #=> "http://loremflickr.com/50/60"

Faker::Lorem::Flickr.image("50x60", ['sports']) #=> "http://loremflickr.com/50/60/sports"

Faker::Lorem::Flickr.image("50x60", ['sports', 'fitness']) #=> "http://loremflickr.com/50/60/sports,fitness"

Faker::Lorem::Flickr.image("50x60", ['sports', 'fitness'], true) #=> "http://loremflickr.com/50/60/sports,fitness/all"

Faker::Lorem::Flickr.grayscale_image #=> "http://loremflickr.com/g/300/300/all"

Faker::Lorem::Flickr.grayscale_image("50x60") #=> "http://loremflickr.com/g/50/60/all"

Faker::Lorem::Flickr.grayscale_image("50x60", ['sports']) #=> "http://loremflickr.com/g/50/60/sports"

Faker::Lorem::Flickr.grayscale_image("50x60", ['sports', 'fitness']) #=> "http://loremflickr.com/g/50/60/sports,fitness"

Faker::Lorem::Flickr.grayscale_image("50x60", ['sports', 'fitness'], true) #=> "http://loremflickr.com/g/50/60/sports,fitness/all"

Faker::Lorem::Flickr.pixelated_image #=> "http://loremflickr.com/p/300/300/all"

Faker::Lorem::Flickr.pixelated_image("50x60") #=> "http://loremflickr.com/p/50/60/all"

Faker::Lorem::Flickr.pixelated_image("50x60", ['sports']) #=> "http://loremflickr.com/p/50/60/sports"

Faker::Lorem::Flickr.pixelated_image("50x60", ['sports', 'fitness']) #=> "http://loremflickr.com/p/50/60/sports,fitness"

Faker::Lorem::Flickr.pixelated_image("50x60", ['sports', 'fitness'], true) #=> "http://loremflickr.com/p/50/60/sports,fitness/all"

Faker::Lorem::Flickr.colorized_image #=> "http://loremflickr.com/red/300/300/all"

Faker::Lorem::Flickr.colorized_image("50x60") #=> "http://loremflickr.com/red/50/60/all"

Faker::Lorem::Flickr.colorized_image("50x60", 'red') #=> "http://loremflickr.com/red/50/60/all"

Faker::Lorem::Flickr.colorized_image("50x60", 'red', ['sports']) #=> "http://loremflickr.com/red/50/60/sports"

Faker::Lorem::Flickr.colorized_image("50x60", 'red', ['sports', 'fitness']) #=> "http://loremflickr.com/red/50/60/sports,fitness"

Faker::Lorem::Flickr.colorized_image("50x60", 'red', ['sports', 'fitness'], true) #=> "http://loremflickr.com/red/50/60/sports,fitness/all"
```
41 changes: 41 additions & 0 deletions doc/v2.0/lorem/hipster.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Faker::Lorem::Hipster

Adapted from [Lorem::Hipster Ipsum](http://hipsum.co/)

```ruby
Faker::Lorem::Hipster.word #=> "irony"

# Optional arguments: num=3, supplemental=false, spaces_allowed = false
Faker::Lorem::Hipster.words #=> ["pug", "pitchfork", "chia"]
Faker::Lorem::Hipster.words(4) #=> ["ugh", "cardigan", "poutine", "stumptown"]
Faker::Lorem::Hipster.words(4, true) #=> ["iste", "seitan", "normcore", "provident"]
Faker::Lorem::Hipster.words(4, true, true) #=> ["qui", "magni", "craft beer", "est"]

# Optional arguments: word_count=4, supplemental=false, random_words_to_add=6
Faker::Lorem::Hipster.sentence #=> "Park iphone leggings put a bird on it."
Faker::Lorem::Hipster.sentence(3) #=> "Pour-over swag godard."
Faker::Lorem::Hipster.sentence(3, true) #=> "Beard laboriosam sequi celiac."
Faker::Lorem::Hipster.sentence(3, false, 4) #=> "Bitters retro mustache aesthetic biodiesel 8-bit."
Faker::Lorem::Hipster.sentence(3, true, 4) #=> "Occaecati deleniti messenger bag meh crucifix autem."

# Optional arguments: sentence_count=3, supplemental=false
Faker::Lorem::Hipster.sentences #=> ["Godard pitchfork vinegar chillwave everyday 90's whatever.", "Pour-over artisan distillery street waistcoat.", "Salvia yr leggings franzen blue bottle."]
Faker::Lorem::Hipster.sentences(1) #=> ["Before they sold out pinterest venmo umami try-hard ugh hoodie artisan."]
Faker::Lorem::Hipster.sentences(1, true) #=> ["Et sustainable optio aesthetic et."]

# Optional arguments: sentence_count=3, supplemental=false, random_sentences_to_add=3
Faker::Lorem::Hipster.paragraph #=> "Migas fingerstache pbr&b tofu. Polaroid distillery typewriter echo tofu actually. Slow-carb fanny pack pickled direct trade scenester mlkshk plaid. Banjo venmo chambray cold-pressed typewriter. Fap skateboard intelligentsia."
Faker::Lorem::Hipster.paragraph(2) #=> "Yolo tilde farm-to-table hashtag. Lomo kitsch disrupt forage +1."
Faker::Lorem::Hipster.paragraph(2, true) #=> "Typewriter iste ut viral kombucha voluptatem. Sint voluptates saepe. Direct trade irony chia excepturi yuccie. Biodiesel esse listicle et quam suscipit."
Faker::Lorem::Hipster.paragraph(2, false, 4) #=> "Selvage vhs chartreuse narwhal vinegar. Authentic vinyl truffaut carry vhs pop-up. Hammock everyday iphone locavore thundercats bitters vegan goth. Fashion axe banh mi shoreditch whatever artisan."
Faker::Hipster.paragraph(2, true, 4) #=> "Deep v gluten-free unde waistcoat aperiam migas voluptas dolorum. Aut drinking illo sustainable sapiente. Direct trade fanny pack kale chips ennui semiotics."

# Optional arguments: paragraph_count=3, supplemental=false
Faker::Lorem::Hipster.paragraphs #=> ["Tilde microdosing blog cliche meggings. Intelligentsia five dollar toast forage yuccie. Master kitsch knausgaard. Try-hard everyday trust fund mumblecore.", "Normcore viral pickled. Listicle humblebrag swag tote bag. Taxidermy street hammock neutra butcher cred kale chips. Blog portland humblebrag trust fund irony.", "Single-origin coffee fixie cleanse tofu xoxo. Post-ironic tote bag ramps gluten-free locavore mumblecore hammock. Umami loko twee. Ugh kitsch before they sold out."]
Faker::Lorem::Hipster.paragraphs(1) #=> ["Skateboard cronut synth +1 fashion axe. Pop-up polaroid skateboard asymmetrical. Ennui fingerstache shoreditch before they sold out. Tattooed pitchfork ramps. Photo booth yr messenger bag raw denim bespoke locavore lomo synth."]
Faker::Lorem::Hipster.paragraphs(1, true) #=> ["Quae direct trade pbr&b quo taxidermy autem loko. Umami quas ratione migas cardigan sriracha minima. Tenetur perspiciatis pickled sed eum doloribus truffaut. Excepturi dreamcatcher meditation."]

# Optional arguments: chars=3, supplemental=false
Faker::Lorem::Hipster.paragraph_by_chars #=> "Truffaut stumptown trust fund 8-bit messenger bag portland. Meh kombucha selvage swag biodiesel. Lomo kinfolk jean shorts asymmetrical diy. Wayfarers portland twee stumptown. Wes anderson biodiesel retro 90's pabst. Diy echo 90's mixtape semiotics. Cornho."
Faker::Lorem::Hipster.paragraph_by_chars(256, false) #=> "Hella kogi blog narwhal sartorial selfies mustache schlitz. Bespoke normcore kitsch cred hella fixie. Park aesthetic fixie migas twee. Cliche mustache brunch tumblr fixie godard. Drinking pop-up synth hoodie dreamcatcher typewriter. Kitsch biodiesel green."
```
54 changes: 54 additions & 0 deletions doc/v2.0/lorem/ipsum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Faker::Lorem::Ipsum

```ruby
Faker::Lorem::Ipsum.word #=> "repellendus"

# Optional arguments: num=3, supplemental=false (words from a supplementary list of Lorem-like words)
Faker::Lorem::Ipsum.words #=> ["dolores", "adipisci", "nesciunt"]
Faker::Lorem::Ipsum.words(4) #=> ["culpa", "recusandae", "aut", "omnis"]
Faker::Lorem::Ipsum.words(4, true) #=> ["colloco", "qui", "vergo", "deporto"]

Faker::Lorem::Ipsum.multibyte #=> 😀

# Optional arguments: char_count=255
Faker::Lorem::Ipsum.characters #=> "uw1ep04lhs0c4d931n1jmrspprf5wrj85fefue0y7y6m56b6omquh7br7dhqijwlawejpl765nb1716idmp3xnfo85v349pzy2o9rir23y2qhflwr71c1585fnynguiphkjm8p0vktwitcsm16lny7jzp9t4drwav3qmhz4yjq4k04x14gl6p148hulyqioo72tf8nwrxxcclfypz2lc58lsibgfe5w5p0xv95peafjjmm2frkhdc6duoky0aha"
Faker::Lorem::Ipsum.characters(10) #=> "ang9cbhoa8"

# Optional arguments: word_count=4, supplemental=false, random_words_to_add=6
# The 'random_words_to_add' argument increases the sentence's word count by a random value within (0..random_words_to_add).
# To specify an exact word count for a sentence, set word_count to the number you want and random_words_to_add equal to 0.
# By default, sentences will have a random number of words within the range (4..10).
Faker::Lorem::Ipsum.sentence #=> "Dolore illum animi et neque accusantium."
Faker::Lorem::Ipsum.sentence(3) #=> "Commodi qui minus deserunt sed vero quia."
Faker::Lorem::Ipsum.sentence(3, true) #=> "Inflammatio denego necessitatibus caelestis autus illum."
Faker::Lorem::Ipsum.sentence(3, false, 4) #=> "Aut voluptatem illum fugit ut sit."
Faker::Lorem::Ipsum.sentence(3, true, 4) #=> "Accusantium tantillus dolorem timor."

# Optional arguments: sentence_count=3, supplemental=false
Faker::Lorem::Ipsum.sentences #=> ["Vero earum commodi soluta.", "Quaerat fuga cumque et vero eveniet omnis ut.", "Cumque sit dolor ut est consequuntur."]
Faker::Lorem::Ipsum.sentences(1) #=> ["Ut perspiciatis explicabo possimus doloribus enim quia."]
Faker::Lorem::Ipsum.sentences(1, true) #=> ["Quis capillus curo ager veritatis voro et ipsum."]

# Optional arguments: sentence_count=3, supplemental=false, random_sentences_to_add=3
# The 'random_sentences_to_add' argument increases the paragraph's sentence count by a random value within (0..random_sentences_to_add).
# To specify an exact sentence count for a paragraph, set sentence_count to the number you want and random_sentences_to_add equal to 0.
# By default, sentences will have a random number of words within the range (3..6).
Faker::Lorem::Ipsum.paragraph #=> "Neque dicta enim quasi. Qui corrupti est quisquam. Facere animi quod aut. Qui nulla consequuntur consectetur sapiente."
Faker::Lorem::Ipsum.paragraph(2) #=> "Illo qui voluptas. Id sit quaerat enim aut cupiditate voluptates dolorum. Porro necessitatibus numquam dolor quia earum."
Faker::Lorem::Ipsum.paragraph(2, true) #=> "Cedo vero adipisci. Theatrum crustulum coaegresco tonsor crastinus stabilis. Aliqua crur consequatur amor una tolero sum."
Faker::Lorem::Ipsum.paragraph(2, false, 4) #=> "Neque aut et nemo aut incidunt voluptates. Dolore cum est sint est. Vitae assumenda porro odio dolores fugiat. Est voluptatum quia rerum."
Faker::Lorem::Ipsum.paragraph(2, true, 4) #=> "Vomito unde uxor annus. Et patior utilis sursum."

# Optional arguments: paragraph_count=3, supplemental=false
Faker::Lorem::Ipsum.paragraphs #=> ["Dolores quis quia ad quo voluptates. Maxime delectus totam numquam. Necessitatibus vel atque qui dolore.", "Id neque nemo. Dolores iusto facere est ad. Accusamus ipsa dolor ut.", "Et officiis ut hic. Sunt asperiores minus distinctio debitis ipsa dolor. Minima eos deleniti."]
Faker::Lorem::Ipsum.paragraphs(1) #=> ["Labore voluptas sequi. Ratione nulla eaque quia molestiae fugit. At quam laboriosam aut ut dignissimos."]
Faker::Lorem::Ipsum.paragraphs(1, true) #=> ["Depulso animi cunctatio amicitia adficio. Vester viduo qui despirmatio voluptas. Validus laudantium adopto ut agnitio venustas. Aer arcus odio esse."]

# Optional arguments: question_count = 3, supplemental = false
Faker::Lorem::Ipsum.question #=> "Aliquid culpa aut ipsam unde ullam labore?"
Faker::Lorem::Ipsum.questions(3) #=> ["Necessitatibus deserunt animi?", "At hic dolores autem consequatur ut?", "Aliquam velit ex adipisci voluptatem placeat?"]

# Optional arguments: chars=3, supplemental=false
Faker::Lorem::Ipsum.paragraph_by_chars #=> "Truffaut stumptown trust fund 8-bit messenger bag portland. Meh kombucha selvage swag biodiesel. Lomo kinfolk jean shorts asymmetrical diy. Wayfarers portland twee stumptown. Wes anderson biodiesel retro 90's pabst. Diy echo 90's mixtape semiotics. Cornho."
Faker::Lorem::Ipsum.paragraph_by_chars(256, false) #=> "Hella kogi blog narwhal sartorial selfies mustache schlitz. Bespoke normcore kitsch cred hella fixie. Park aesthetic fixie migas twee. Cliche mustache brunch tumblr fixie godard. Drinking pop-up synth hoodie dreamcatcher typewriter. Kitsch biodiesel green."
```
21 changes: 21 additions & 0 deletions doc/v2.0/lorem/pixel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Faker::Lorem::Pixel

Available since version 1.7.0.

```ruby
Faker::Lorem::Pixel.image #=> "https://lorempixel.com/300/300"

Faker::Lorem::Pixel.image("50x60") #=> "https://lorempixel.com/50/60"

Faker::Lorem::Pixel.image("50x60", true) #=> "https://lorempixel.com/g/50/60"

Faker::Lorem::Pixel.image("50x60", false, 'sports') #=> "https://lorempixel.com/50/60/sports"

Faker::Lorem::Pixel.image("50x60", false, 'sports', 3) #=> "https://lorempixel.com/50/60/sports/3"

Faker::Lorem::Pixel.image("50x60", false, 'sports', 3, 'Dummy-text') #=> "https://lorempixel.com/50/60/sports/3/Dummy-text"

Faker::Lorem::Pixel.image("50x60", false, 'sports', nil, 'Dummy-text') #=> "https://lorempixel.com/50/60/sports/Dummy-text"

Faker::Lorem::Pixel.image(secure: false) #=> "http://lorempixel.com/300/300"
```
58 changes: 0 additions & 58 deletions lib/faker/default/hipster.rb

This file was deleted.

80 changes: 0 additions & 80 deletions lib/faker/default/lorem.rb

This file was deleted.

38 changes: 0 additions & 38 deletions lib/faker/default/lorem_pixel.rb

This file was deleted.

Loading