Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoremFlickr support #818

Merged
merged 24 commits into from
May 17, 2018
Merged

LoremFlickr support #818

merged 24 commits into from
May 17, 2018

Conversation

mrstebo
Copy link
Contributor

@mrstebo mrstebo commented Feb 4, 2017

I was using Faker::LoremPixel, but you get a wider range of images using LoremFlickr.

You not only get grayscale images. You also get pixelated and colorized images.

build_url(size, 'p', search_terms, match_all)
end

def colorized_image(size = '300x300', color = 'red', search_terms = [], match_all = false)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think search_terms needs a valid default value

Copy link
Contributor Author

@mrstebo mrstebo Mar 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'll put something like search_terms = ['all'] 👍

@mrstebo
Copy link
Contributor Author

mrstebo commented Mar 20, 2017

I've refactored the image method and removed the is_gray parameter, and just added a separate grayscale_image method to make things a bit cleaner.

Copy link
Member

@vbrazo vbrazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you rebase this branch with master, fix the rubocop violations, add the title of this PR and your GitHub ID to our CHANGELOG.md and let me know when it's ready for review again? @mrstebo

@mrstebo
Copy link
Contributor Author

mrstebo commented May 17, 2018

Will do @vbrazo 👍

@coveralls
Copy link

coveralls commented May 17, 2018

Pull Request Test Coverage Report for Build 2147

  • 25 of 25 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 99.645%

Totals Coverage Status
Change from base Build 2142: 0.06%
Covered Lines: 2247
Relevant Lines: 2255

💛 - Coveralls

@vbrazo
Copy link
Member

vbrazo commented May 17, 2018

You should run bundle exec rubocop -a to fix the rubocop violations.

@mrstebo
Copy link
Contributor Author

mrstebo commented May 17, 2018

@vbrazo should be all sorted now 🙌

@vbrazo vbrazo merged commit 1043ee9 into faker-ruby:master May 17, 2018
@mrstebo mrstebo deleted the feature/lorem_flickr branch May 28, 2018 19:04
@vbrazo vbrazo self-requested a review July 19, 2018 01:27
davidmorton0 pushed a commit to davidmorton0/faker that referenced this pull request Jul 12, 2021
* Added doc] to get started.

* Added the LoremFlickr faker class.

* Added lorem_flickr to the list of requires.

* Added tests for the LoremFlickr class.

* Changed search_term to search_terms which takes an array of strings.
Updated tests.
Updated docs.

* Added the match_all parameter so it returns the url of an image matching all search_terms.

* Added LoremFlickr to README.

* Extracted building out URL to separate method.

* Added LoremFlickr.pixelated_image.

* Added LoremFlickr.colorized_image.

* Added tests for supported colorizations.

* Added tests to check that an error is thrown when given an unsupported size.

* Added valid default values for methods requiring search_terms.

* Updated the docs.

* Added documentation for more parameter combinations.

* Added separate method for creating grayscale images.

* Updated the docs with the new grayscale_image method.

* Removed the is_gray parameter from the image method.

* Updated the docs.

* Fixed Rubocop offenses.

* Added title of PR and Github ID to CHANGELOG.md.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants