Project

General

Profile

Actions

Feature #13610

open

IPAddr doesn't provide helpful methods to get the subnet or IP address

Added by x89 (David John) over 7 years ago. Updated about 7 years ago.

Status:
Assigned
Target version:
-
[ruby-core:81449]

Description

I've implemented it myself using some "wild" code around the .inspect or default return from an IPAddr object from ipadr.rb

It would be nice to, once having loaded an IP range, to then be able to get its subnet, its IP and its CIDR.

I've created a PR: https://github.com/ruby/ruby/pull/1636 (although it's failing, not entirely sure why as Travis works fine on localhost!).

David

Updated by herwin (Herwin W) about 7 years ago

I think #11210 is the better solution here, since that has additional possibilities to get the formatting of the subnet mask (so you could easily output /24 instead of 255.255.255.0)

Updated by shyouhei (Shyouhei Urabe) about 7 years ago

  • Status changed from Open to Assigned
  • Assignee set to knu (Akinori MUSHA)
Actions

Also available in: Atom PDF

Like0
Like0Like0