summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/ipaddr.gemspec4
-rw-r--r--lib/ipaddr.rb8
-rw-r--r--test/test_ipaddr.rb2
3 files changed, 8 insertions, 6 deletions
@@ -1,10 +1,11 @@
# coding: utf-8
lib = File.expand_path("../lib", __FILE__)
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
Gem::Specification.new do |spec|
spec.name = "ipaddr"
- spec.version = "1.2.0"
spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
@@ -14,6 +15,7 @@ IPAddr provides a set of methods to manipulate an IP address.
Both IPv4 and IPv6 are supported.
DESCRIPTION
spec.homepage = "https://.com/ruby/ipaddr"
spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ipaddr.gemspec", "lib/ipaddr.rb"]
spec.bindir = "exe"
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
#
# ipaddr.rb - A class to manipulate an IP address
#
@@ -103,13 +103,13 @@ class IPAddr
# Creates a new ipaddr containing the given network byte ordered
# string form of an IP address.
- def IPAddr::new_ntoh(addr)
- return IPAddr.new(IPAddr::ntop(addr))
end
# Convert a network byte ordered string form of an IP address into
# human readable form.
- def IPAddr::ntop(addr)
case addr.size
when 4
s = addr.unpack('C4').join('.')
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
require 'test/unit'
require 'ipaddr'