diff --git a/Gemfile.lock b/Gemfile.lock index 618f71e..e0395dd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,17 +1,17 @@ PATH remote: . specs: - uuid (2.3.7) + uuid (2.3.9) macaddr (~> 1.0) GEM remote: https://rubygems.org/ specs: - macaddr (1.6.7) - systemu (~> 2.6.2) + macaddr (1.7.2) + systemu (~> 2.6.5) mocha (0.9.12) rake (0.8.7) - systemu (2.6.4) + systemu (2.6.5) yard (0.6.7) PLATFORMS @@ -22,3 +22,6 @@ DEPENDENCIES rake uuid! yard + +BUNDLED WITH + 2.2.32 diff --git a/lib/uuid.rb b/lib/uuid.rb index 066a58d..3e08d18 100644 --- a/lib/uuid.rb +++ b/lib/uuid.rb @@ -197,9 +197,8 @@ def self.state_file=(path) # Returns true if +uuid+ is in compact, default or urn formats. Does not # validate the layout (RFC 4122 section 4) of the UUID. def self.validate(uuid) - return true if uuid =~ /\A[\da-f]{32}\z/i - return true if - uuid =~ /\A(urn:uuid:)?[\da-f]{8}-([\da-f]{4}-){3}[\da-f]{12}\z/i + return true if /\A[\da-f]{32}\z/i.match(uuid) + return true if /\A(urn:uuid:)?[\da-f]{8}-([\da-f]{4}-){3}[\da-f]{12}\z/i.match(uuid) end ## @@ -437,7 +436,7 @@ def bind(address) end sock = UNIXServer.new(address) File.chmod 0666, address - elsif address =~ /^(\d+\.\d+\.\d+\.\d+):(\d+)$/ + elsif /^(\d+\.\d+\.\d+\.\d+):(\d+)$/.match(address) sock = TCPServer.new($1, $2.to_i) else raise ArgumentError, "Don't know how to bind #{address}" @@ -476,7 +475,7 @@ def connect(address) return address unless String === address if address[0] == ?/ sock = UNIXSocket.new(address) - elsif address =~ /^(\d+\.\d+\.\d+\.\d+):(\d+)$/ + elsif /^(\d+\.\d+\.\d+\.\d+):(\d+)$/.match(address) sock = TCPSocket.new($1, $2.to_i) else raise ArgumentError, "Don't know how to connect to #{address}"