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
diff --git a/lib/ipaddr.gemspec b/lib/ipaddr.gemspec
index 16df1708b0..2de9ef4881 100644
--- a/lib/ipaddr.gemspec
+++ b/lib/ipaddr.gemspec
@@ -1,10 +1,11 @@
+# frozen_string_literal: true
# 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.version = "1.2.2"
spec.authors = ["Akinori MUSHA", "Hajimu UMEMOTO"]
spec.email = ["knu@idaemons.org", "ume@mahoroba.org"]
@@ -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://github.com/ruby/ipaddr"
+ spec.license = "BSD-2-Clause"
spec.files = [".gitignore", ".travis.yml", "Gemfile", "LICENSE.txt", "README.md", "Rakefile", "bin/console", "bin/setup", "ipaddr.gemspec", "lib/ipaddr.rb"]
spec.bindir = "exe"
diff --git a/lib/ipaddr.rb b/lib/ipaddr.rb
index 09645f500c..7fff54b9d0 100644
--- a/lib/ipaddr.rb
+++ b/lib/ipaddr.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
#
# 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))
+ def self.new_ntoh(addr)
+ return new(ntop(addr))
end
# Convert a network byte ordered string form of an IP address into
# human readable form.
- def IPAddr::ntop(addr)
+ def self.ntop(addr)
case addr.size
when 4
s = addr.unpack('C4').join('.')
diff --git a/test/test_ipaddr.rb b/test/test_ipaddr.rb
index eb2c602334..1aa24ebc54 100644
--- a/test/test_ipaddr.rb
+++ b/test/test_ipaddr.rb
@@ -1,4 +1,4 @@
-# frozen_string_literal: false
+# frozen_string_literal: true
require 'test/unit'
require 'ipaddr'