Giter Club home page Giter Club logo

cidr-elixir's People

Contributors

bcardarella avatar c-rack avatar duijf avatar freedomben avatar ifoo avatar masashiyokota avatar tehhobbit avatar tmepple avatar tmock12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cidr-elixir's Issues

New release

Thank you for merging #51 !
It would be nice if you could bump the version number, so we could get a new release on hex, without having to explicitly reference master. Last release was from 2017 as far as I can tell.

Release 1.0

Now that we have a stable version and changed the license, I would like to release the current status as version 1.0 to indicate the stable status of this library (the hex.pm version badge would also become green then).

Of course, we should remove the deprecated start / end fields in the struct first (see #26), and then update the version. According to SemVer, that would be perfectly ok.

If no one objects, I would prepare and release 1.0 next weekend.

Problem: `end` is a keyword

end is a (reserved?) keyword in Elixir, which we should avoid as a struct field name, see:
https://github.com/elixir-lang/elixir/blob/7b5f4a5842d05bf279b249078fd9051e3dcafa50/lib/elixir/src/elixir_tokenizer.erl#L1037

While this does not cause problems in actual code yet (except broken syntax highlighting), I would strongly advise to change the CIDR struct members start / end to first / last.

This will break backward compatibility, but I think it is better to change it now than later.

@duijf what do you think?

Change license to MPLv2

I would like to change the license of cidr-elixir from MIT to MPL.

According to the C4.1 process, the MPL is recommended to use:

The project SHALL use a share-alike license, such as the GPLv3 or a variant thereof (LGPL, AGPL), or the MPLv2.

@duijf would you agree to change to MPL?

match/2 needs better error handling

Currently, match just returns true or false. However, it would be good to let callers know if there is an error in the ip-address they passed in. Currently CIDR.match(cidr, :test) returns false, but CIDR.match(cidr, "this should be an ip address") throws a matcherror.

You can also pass in any 4 or 6 tuple and there will not be any validation.

The way I see it, we can pick from two approaches:

Tagged tuples:

  • When it's a match: {:ok, true}
  • When it's not a match: {:ok, false}
  • When the IP to match against is invalid: {:error, reason}.

Exceptions:

  • When it's a match: true
  • When it's not a match: false
  • When the IP to match against is invalid: raise ArgumentError.

We can also support both, separate by function name: match for the first interface and match! for the second.

@c-rack what do you think?

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.