ruby-changes:54211
From: knu <ko1@a...>
Date: Tue, 18 Dec 2018 14:09:12 +0900 (JST)
Subject: [ruby-changes:54211] knu:r66432 (trunk): Import ipaddr 1.2.2
knu 2018-12-18 14:09:08 +0900 (Tue, 18 Dec 2018) New Revision: 66432 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66432 Log: Import ipaddr 1.2.2 - Enable frozen_string_literal and do a bit of code cleanup Modified files: trunk/lib/ipaddr.gemspec trunk/lib/ipaddr.rb trunk/test/test_ipaddr.rb Index: test/test_ipaddr.rb =================================================================== --- test/test_ipaddr.rb (revision 66431) +++ test/test_ipaddr.rb (revision 66432) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/test/test_ipaddr.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true require 'test/unit' require 'ipaddr' Index: lib/ipaddr.rb =================================================================== --- lib/ipaddr.rb (revision 66431) +++ lib/ipaddr.rb (revision 66432) @@ -1,4 +1,4 @@ https://github.com/ruby/ruby/blob/trunk/lib/ipaddr.rb#L1 -# frozen_string_literal: false +# frozen_string_literal: true # # ipaddr.rb - A class to manipulate an IP address # @@ -103,13 +103,13 @@ class IPAddr https://github.com/ruby/ruby/blob/trunk/lib/ipaddr.rb#L103 # 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('.') Index: lib/ipaddr.gemspec =================================================================== --- lib/ipaddr.gemspec (revision 66431) +++ lib/ipaddr.gemspec (revision 66432) @@ -1,10 +1,11 @@ https://github.com/ruby/ruby/blob/trunk/lib/ipaddr.gemspec#L1 +# 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@i...", "ume@m..."] @@ -14,6 +15,7 @@ IPAddr provides a set of methods to mani https://github.com/ruby/ruby/blob/trunk/lib/ipaddr.gemspec#L15 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" -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/