ipparse 0.0.4 → 0.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/ipparse.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{ipparse}
5
- s.version = "0.0.4"
5
+ s.version = "0.0.5"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Zhang Jinzhu"]
data/lib/ipparse.rb CHANGED
@@ -32,8 +32,6 @@ class IPParse
32
32
  end
33
33
 
34
34
  def self.format(ip)
35
- ip.to_s.split('.').inject([]) do |s,x|
36
- s << x.rjust(3,'0')
37
- end.join('.')
35
+ ip.to_s.scan(/\d+/).map{|x| x.rjust(3, '0')}.join('.')
38
36
  end
39
37
  end
data/lib/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module IPParse
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ipparse
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zhang Jinzhu