From c975fe2622f56af553e9cf56a7ab9e8017c8d517 Mon Sep 17 00:00:00 2001 From: Rob Day Date: Sat, 31 Jan 2015 22:39:29 +0000 Subject: [PATCH 1/5] Fix 'warning: character class has duplicated range' --- lib/dnsruby/name.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dnsruby/name.rb b/lib/dnsruby/name.rb index e774e1f..93f889a 100644 --- a/lib/dnsruby/name.rb +++ b/lib/dnsruby/name.rb @@ -329,7 +329,7 @@ def self.encode(presentation) #:nodoc: all if (presentation.index(/\G(\d\d\d)/o, pos)) wire=wire+[$1.to_i].pack("C") i=i+3 - elsif(presentation.index(/\Gx([0..9a..fA..F][0..9a..fA..F])/o, pos)) + elsif(presentation.index(/\Gx([0..9a..fA..F]{2})/o, pos)) wire=wire+[$1].pack("H*") i=i+3 elsif(presentation.index(/\G\./o, pos)) @@ -418,4 +418,4 @@ def hash end end -end \ No newline at end of file +end From 111f083cd3166f121e9798a7bc18da57b08fa153 Mon Sep 17 00:00:00 2001 From: Rob Day Date: Sat, 31 Jan 2015 22:40:21 +0000 Subject: [PATCH 2/5] Fix 'warning: method redefined; discarding old regexp=' --- lib/dnsruby/resource/NAPTR.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dnsruby/resource/NAPTR.rb b/lib/dnsruby/resource/NAPTR.rb index b0a42bb..bedfb73 100644 --- a/lib/dnsruby/resource/NAPTR.rb +++ b/lib/dnsruby/resource/NAPTR.rb @@ -30,7 +30,7 @@ class NAPTR < RR # The NAPTR RR service field attr_accessor :service # The NAPTR RR regexp field - attr_accessor :regexp + attr_reader :regexp # The NAPTR RR replacement field attr_accessor :replacement @@ -95,4 +95,4 @@ def self.decode_rdata(msg) #:nodoc: all end end end -end \ No newline at end of file +end From 2b2169b3fea11c7ce930c34420c767bc1095f135 Mon Sep 17 00:00:00 2001 From: Rob Day Date: Sat, 31 Jan 2015 22:41:52 +0000 Subject: [PATCH 3/5] Fix 'warning: assigned but unused variable - e' --- lib/dnsruby/resource/TXT.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dnsruby/resource/TXT.rb b/lib/dnsruby/resource/TXT.rb index be38a79..9607072 100644 --- a/lib/dnsruby/resource/TXT.rb +++ b/lib/dnsruby/resource/TXT.rb @@ -15,7 +15,7 @@ # ++ begin require 'jcode' -rescue LoadError => e +rescue LoadError => _e end module Dnsruby class RR @@ -189,4 +189,4 @@ def self.decode_rdata(msg) #:nodoc: all end end end -end \ No newline at end of file +end From a7d3a829aec1dd210eb244e0ba497c0923793f99 Mon Sep 17 00:00:00 2001 From: Rob Day Date: Sat, 31 Jan 2015 22:42:51 +0000 Subject: [PATCH 4/5] Fix 'warning: mismatched indentations at 'end' with 'def' at 243' --- lib/dnsruby/resource/NSEC3.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/dnsruby/resource/NSEC3.rb b/lib/dnsruby/resource/NSEC3.rb index 35b564f..9dd1bc4 100644 --- a/lib/dnsruby/resource/NSEC3.rb +++ b/lib/dnsruby/resource/NSEC3.rb @@ -242,7 +242,7 @@ def NSEC3.encode_salt(s) def decode_next_hashed(input) @next_hashed = NSEC3.decode_next_hashed(input) - end + end def NSEC3.decode_next_hashed(input) return Base32.decode32hex(input) @@ -329,4 +329,4 @@ def self.decode_rdata(msg) #:nodoc: all end end end -end \ No newline at end of file +end From 7b6eb152203f392d04cf39d70af79fda72f43ce1 Mon Sep 17 00:00:00 2001 From: Rob Day Date: Wed, 11 Feb 2015 23:41:42 +0000 Subject: [PATCH 5/5] Actually fix 'warning: character class has duplicated range' --- lib/dnsruby/name.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dnsruby/name.rb b/lib/dnsruby/name.rb index 93f889a..b1530ab 100644 --- a/lib/dnsruby/name.rb +++ b/lib/dnsruby/name.rb @@ -329,7 +329,7 @@ def self.encode(presentation) #:nodoc: all if (presentation.index(/\G(\d\d\d)/o, pos)) wire=wire+[$1.to_i].pack("C") i=i+3 - elsif(presentation.index(/\Gx([0..9a..fA..F]{2})/o, pos)) + elsif(presentation.index(/\Gx(\h\h)/o, pos)) wire=wire+[$1].pack("H*") i=i+3 elsif(presentation.index(/\G\./o, pos))