Giter Club home page Giter Club logo

Comments (4)

axelfontaine avatar axelfontaine commented on May 28, 2024 1

It looks like they have it upstream: https://www.rubydoc.info/gems/faker/Faker/Internet#ip_v4_address-class_method

from kotlin-faker.

serpro69 avatar serpro69 commented on May 28, 2024

Huh, weird it's not there already.

Feel free to add this if you like :)
But unless it's available in the yml of the upstream ruby-faker, I think it's better to generate the values inside a function directly instead of adding custom stuff to a yml file. The latter makes it harder to pull and merge changes to these dictionary files.

from kotlin-faker.

serpro69 avatar serpro69 commented on May 28, 2024

Yep, but also implemented the way I suggested above , and not via .yml file: https://github.com/faker-ruby/faker/blob/d355cc3ed6767c118729039839e2d7666c49ee56/lib/faker/default/internet.rb#L279-L280

I haven't really looked at all the "additional" functionality of the ruby faker that it gives outside of the yml files, so yeah, I'm not surprised something like this is there already :)

In this case it makes sense also to implement this directly in a function, because it's way easier to exclude invalid values in the ip range.

from kotlin-faker.

serpro69 avatar serpro69 commented on May 28, 2024

We could even take this a bit further.
E.g. generating a random address for a given network/mask could potentially be useful? Generating a random address in the same subnet as supplied address as well maybe?

from kotlin-faker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.