summaryrefslogtreecommitdiff
path: root/lib/rbot/core/utils
diff options
context:
space:
mode:
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-01-12 22:15:12 +0100
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>2011-01-12 22:15:12 +0100
commit12a508e1a75bc1de501f36ca9e4767f2349fe12e (patch)
tree8ec4db236d70c064742b87c79feb86e783312e1c /lib/rbot/core/utils
parentcafa66beb3392f30ba8f11e6763f690518512471 (diff)
Ruby 1.9 cleanup: variables warnings
Fix most ruby 1.9 warnings about shadowed variables (still one remaining in keywords.rb). The only significant changes are in the quiz game plugin. Also fix an issue in dictclient where the block parameter of a method was not correctly isolated from the previous parameter.
Diffstat (limited to 'lib/rbot/core/utils')
-rw-r--r--lib/rbot/core/utils/filters.rb6
-rw-r--r--lib/rbot/core/utils/httputil.rb2
-rwxr-xr-xlib/rbot/core/utils/wordlist.rb4
3 files changed, 5 insertions, 7 deletions
diff --git a/lib/rbot/core/utils/filters.rb b/lib/rbot/core/utils/filters.rb
index 463e6f38..d188aa3f 100644
--- a/lib/rbot/core/utils/filters.rb
+++ b/lib/rbot/core/utils/filters.rb
@@ -177,10 +177,10 @@ module ::Irc
def load_filters(options={})
case options[:path]
when nil
- file = "#{self.dirname}.rb"
+ us = "#{self.dirname}.rb"
paths = [
- File.join(Config::datadir, 'filters', file),
- @bot.path('filters', file)
+ File.join(Config::datadir, 'filters', us),
+ @bot.path('filters', us)
]
when Array
paths = options[:path]
diff --git a/lib/rbot/core/utils/httputil.rb b/lib/rbot/core/utils/httputil.rb
index 25df3c5b..03671cfe 100644
--- a/lib/rbot/core/utils/httputil.rb
+++ b/lib/rbot/core/utils/httputil.rb
@@ -531,8 +531,6 @@ class HttpUtil
:method => :GET
}.merge(options)
- resp = nil
-
req_class = case opts[:method].to_s.downcase.intern
when :head, :"net::http::head"
opts[:max_redir] = -1
diff --git a/lib/rbot/core/utils/wordlist.rb b/lib/rbot/core/utils/wordlist.rb
index 4e624f9b..81d7d775 100755
--- a/lib/rbot/core/utils/wordlist.rb
+++ b/lib/rbot/core/utils/wordlist.rb
@@ -14,10 +14,10 @@ class Wordlist
@@wordlist_base ||= Utils.bot.path 'wordlists'
end
- def self.get(path, options={})
+ def self.get(where, options={})
opts = { :spaces => false }.merge(options)
- wordlist_path = File.join(wordlist_base, path)
+ wordlist_path = File.join(wordlist_base, where)
raise "wordlist not found: #{wordlist_path}" unless File.exist?(wordlist_path)
# Location is a directory -> combine all lists beneath it