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

Junk url #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Junk url #2

wants to merge 2 commits into from

Conversation

ryanzbone
Copy link

Simple junk urls.

Lots of ways to extend this through options:

  • add query strings
  • protocol changes
  • change TLD
  • prepend subdomains

@@ -117,6 +118,8 @@ def junk(*args)
generator = -> { rand(max-min) + min }
when :bool
generator = -> { [true, false].sample }
when :url
generator = -> { "http://#{::SecureRandom.uuid}.com" }
Copy link

Choose a reason for hiding this comment

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

Maybe recurse into junk here instead? I'm thinking about putting together a PR that doesn't use SecureRandom.

@mikegee
Copy link

mikegee commented Jun 9, 2015

Have you tried implementing this as a Formatter Class yet? Maybe it doesn't need to be a core feature.

@jesscanady
Copy link

@mgee 👍 definitely feels like a formatter.

@maharris1011
Copy link

(from the FormatterClass link above)

TODO: Hrm, if I'm going to do to that much trouble, why not have an entire junk generation class? E.g. include the generator with the formatter, so that we can just say let(:zip) { junk ZipCode }

I think that option cleans up the code quite a bit, making the tests more obvious in their intent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants