{"id":28602733,"url":"https://github.com/interop-tokyo-shownet/ipaddr-ext","last_synced_at":"2025-06-11T16:08:05.844Z","repository":{"id":64831637,"uuid":"573796998","full_name":"interop-tokyo-shownet/ipaddr-ext","owner":"interop-tokyo-shownet","description":"Extensions for Ruby IPAddr Class","archived":false,"fork":false,"pushed_at":"2024-12-28T05:21:41.000Z","size":44,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-10T23:03:39.319Z","etag":null,"topics":["ipaddr","ruby","shownet"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interop-tokyo-shownet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-12-03T13:15:22.000Z","updated_at":"2024-12-28T05:21:45.000Z","dependencies_parsed_at":"2024-10-23T05:49:59.751Z","dependency_job_id":null,"html_url":"https://github.com/interop-tokyo-shownet/ipaddr-ext","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"e57b8c6028ca20b35db891d22e2382c0bfc1bd41"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fipaddr-ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fipaddr-ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fipaddr-ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fipaddr-ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interop-tokyo-shownet","download_url":"https://codeload.github.com/interop-tokyo-shownet/ipaddr-ext/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fipaddr-ext/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259262320,"owners_count":22830559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ipaddr","ruby","shownet"],"created_at":"2025-06-11T16:08:05.049Z","updated_at":"2025-06-11T16:08:05.832Z","avatar_url":"https://github.com/interop-tokyo-shownet.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IPAddrExt\n\nIPAddrExt provides extensions of IPAddr class.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n    $ bundle add ipaddr-ext\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n    $ gem install ipaddr-ext\n\n## Usage\n\n```ruby\nrequire 'ipaddr-ext'\n\n# to_s_with_prefix\nipaddr1 = IPAddr.new(\"3ffe:505:2::1\")\np ipaddr1.to_s_with_prefix\n#=\u003e \"3ffe:505:2::1/128\"\n\nipaddr2 = IPAddr.new(\"3ffe:505:2::/64\")\np ipaddr2.to_s_with_prefix\n#=\u003e \"3ffe:505:2::/64\"\n\n# +/-\nipaddr3 = IPAddr.new(\"3ffe:505:2::1\")\np (ipaddr3 + 5)\n#=\u003e #\u003cIPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0006/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff\u003e\np (ipaddr3 + 5).to_s_with_prefix\n#=\u003e \"3ffe:505:2::6/128\"\n\nipaddr4 = IPAddr.new(\"3ffe:505:2::9\")\np (ipaddr4 - 5)\n#=\u003e #\u003cIPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0004/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff\u003e\np (ipaddr4 - 5).to_s_with_prefix\n#=\u003e \"3ffe:505:2::4/128\"\n\n# broadcast / wildcard_mask\nipaddr5 = IPAddr.new(\"192.0.2.0/24\")\nipaddr5.broadcast\n=\u003e #\u003cIPAddr: IPv4:192.0.2.255/255.255.255.0\u003e\nipaddr5.wildcard_mask\n=\u003e \"0.0.0.255\"\n\n# to_host\nipaddr5 = IPAddr.new(\"3ffe:505:2::/64\")\nipaddr5.to_host\n=\u003e #\u003cIPAddr: IPv6:3ffe:0505:0002:0000:0000:0000:0000:0000/ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff\u003e\nipaddr5.to_host.to_s_with_prefix\n=\u003e \"3ffe:505:2::/128\"\nipaddr5.to_host.succ.to_s_with_prefix\n=\u003e \"3ffe:505:2::1/128\"\n\n# to_json: export with prefix string\nIPAddr.new(\"3ffe:505:2::/64\").to_json\n=\u003e \"\\\"3ffe:505:2::/64\\\"\"\n\n# ==: Fix to compare with address prefix\nIPAddr.new(\"192.168.1.0/24\") == IPAddr.new(\"192.168.1.0/24\")\n=\u003e true\nIPAddr.new(\"192.168.1.0/24\") == IPAddr.new(\"192.168.1.0/25\")\n=\u003e false # different behavior with pure IPAddr class\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/interop-tokyo-shownet/ipaddr-ext. This project is intended to be a safe, welcoming space for collaboration.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterop-tokyo-shownet%2Fipaddr-ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterop-tokyo-shownet%2Fipaddr-ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterop-tokyo-shownet%2Fipaddr-ext/lists"}