{"id":29135664,"url":"https://github.com/interop-tokyo-shownet/maca","last_synced_at":"2025-08-06T13:19:49.341Z","repository":{"id":300799749,"uuid":"1007163141","full_name":"interop-tokyo-shownet/maca","owner":"interop-tokyo-shownet","description":"A class to manipulate a MAC Address in ruby","archived":false,"fork":false,"pushed_at":"2025-07-12T05:33:23.000Z","size":42,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-28T02:48:19.863Z","etag":null,"topics":["macaddress","ruby"],"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,"zenodo":null}},"created_at":"2025-06-23T14:58:06.000Z","updated_at":"2025-07-12T05:32:39.000Z","dependencies_parsed_at":"2025-06-23T17:47:21.185Z","dependency_job_id":"d60f2d8a-a056-4cb2-92be-dfab17ecbe11","html_url":"https://github.com/interop-tokyo-shownet/maca","commit_stats":null,"previous_names":["interop-tokyo-shownet/maca"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/interop-tokyo-shownet/maca","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fmaca","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fmaca/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fmaca/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fmaca/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interop-tokyo-shownet","download_url":"https://codeload.github.com/interop-tokyo-shownet/maca/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interop-tokyo-shownet%2Fmaca/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269089115,"owners_count":24358006,"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","status":"online","status_checked_at":"2025-08-06T02:00:09.910Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["macaddress","ruby"],"created_at":"2025-06-30T10:07:40.651Z","updated_at":"2025-08-06T13:19:49.330Z","avatar_url":"https://github.com/interop-tokyo-shownet.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Maca\n\nmaca provides a set of methods to manipulate a MAC Address.\n\n## Installation\n\nInstall the gem and add to the application's Gemfile by executing:\n\n```bash\nbundle add maca\n```\n\nIf bundler is not being used to manage dependencies, install the gem by executing:\n\n```bash\ngem install maca\n```\n\n## Usage\n### Basic\n\nCreate a new `Macaddress` object from a MAC Address in various formats.\n\n```ruby\nrequire 'maca'\n\nMacaddress.new(\"01:23:45:67:89:ab\")\n=\u003e #\u003cMacaddress:0x000000012073db08 @macaddress=\"0123456789ab\"\u003e\n\nMacaddress.new(\"01:23:45:67:89:ab\").to_s\n=\u003e \"01:23:45:67:89:AB\"\n\nMacaddress.new(\"01:23:45:67:89:ab\").to_i\n=\u003e 1250999896491\n```\n\n### Format String\n\n**Format Normalization**\n\nNormalize various MAC Address notations (hyphenated, dot-separated, raw hex, etc.) into the standard colon-separated format.\n\n```ruby\nMacaddress.new(\"00-00-00-00-00-00\").to_s\n=\u003e \"00:00:00:00:00:00\"\n\nMacaddress.new(\"000000000000\").to_s\n=\u003e \"00:00:00:00:00:00\"\n\nMacaddress.new(\"0000.0000.0000\").to_s\n=\u003e \"00:00:00:00:00:00\"\n\nMacaddress.new(\"000000-000000\").to_s\n=\u003e \"00:00:00:00:00:00\"\n```\n\n**Format Conversion**\n\nConvert the MAC Address to a custom string format using a specified delimiter and step size.\n\n```ruby\nMacaddress.new(\"00-00-00-00-00-00\").to_fs(delimiter: '.', step: 4)\n=\u003e \"0000.0000.0000\"\n```\n\n### Comparison\n\nCompare `Macaddress` objects for equality based on their normalized form.\n\n```ruby\nMacaddress.new(\"00:00:00:00:00:00\") == Macaddress.new(\"00:00:00:00:00:00\")\n=\u003e true\n\nMacaddress.new(\"00:00:00:00:00:00\") == Macaddress.new(\"00:00:00:00:00:01\")\n=\u003e false\n```\n\n### Address type check\n\nDetermine the type of a MAC address, such as whether it is unicast or multicast, and whether it is locally or universally administered.\n\n```ruby\nMacaddress.new(\"00:00:00:00:00:00\").unicast?\n=\u003e true\n\nMacaddress.new(\"00:00:00:00:00:00\").broadcast?\n=\u003e false\n\nMacaddress.new(\"33:33:00:00:00:01\").multicast?\n=\u003e true\n\nMacaddress.new(\"02:00:00:00:00:00\").locally_administered?\n=\u003e true\n\nMacaddress.new(\"01:00:00:00:00:00\").universally_administered?\n=\u003e true\n\nMacaddress.new(\"02:00:00:00:00:00\").random?\n=\u003e true\n```\n\n### OUI\n\nExtract the Organizationally Unique Identifier (OUI) from a MAC address.\n\nThe `#oui` method returns the first 24 bits (or the first 3 octets) of a MAC Address, which typically identifies the device manufacturer or vendor.\n\n```ruby\nMacaddress.new(\"01:23:45:67:89:ab\").oui # default format: :base16\n=\u003e \"012345\"\n\nMacaddress.new(\"01:23:45:67:89:ab\").oui(format: :hex)\n=\u003e \"01-23-45\"\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/maca.\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%2Fmaca","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterop-tokyo-shownet%2Fmaca","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterop-tokyo-shownet%2Fmaca/lists"}