]> git.netwichtig.de Git - user/henk/code/ruby/rbot.git/commitdiff
[257] was moot, this is the propert way to prevent Structs from being created twice
authorGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 24 Jul 2006 12:35:56 +0000 (12:35 +0000)
committerGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
Mon, 24 Jul 2006 12:35:56 +0000 (12:35 +0000)
data/rbot/plugins/quotes.rb
data/rbot/plugins/roulette.rb
data/rbot/plugins/seen.rb
data/rbot/plugins/url.rb

index 4695fa100472e30bf83e0bbd9879350bb133ab9f..30e341bf81772a2fe459d6415830c4656cadd64e 100644 (file)
@@ -1,6 +1,6 @@
 # GB: Ok, we *really* need to switch to db for this plugin too
 
-Quote = Struct.new("Quote", :num, :date, :source, :quote) unless defined?(Quote)
+Quote = Struct.new("Quote", :num, :date, :source, :quote) unless defined?(Struct::Quote)
 
 class QuotePlugin < Plugin
   def initialize
index 852484813e5f807180019f2a4e33f0a46d988482..f979274046974c57cdca7c93af18e58b5c8dc74c 100644 (file)
@@ -1,4 +1,4 @@
-RouletteHistory = Struct.new("RouletteHistory", :games, :shots, :deaths, :misses, :wins) unless defined?(RouletteHistory)
+RouletteHistory = Struct.new("RouletteHistory", :games, :shots, :deaths, :misses, :wins) unless defined?(Struct::RouletteHistory)
 
 class RoulettePlugin < Plugin
   def initialize
index 094a9b3db66149d29f436eae33279f474566aafc..3c9218382d3413e4cc4dc54f695f23a24137c387 100644 (file)
@@ -1,4 +1,4 @@
-Saw = Struct.new("Saw", :nick, :time, :type, :where, :message) unless defined?(Saw)
+Saw = Struct.new("Saw", :nick, :time, :type, :where, :message) unless defined?(Seen::Saw)
 
 class SeenPlugin < Plugin
   def help(plugin, topic="")
index 65d75eabd098fffa4bbd51c922b5c665e0efa8d0..45949f501f8a90633949de6058e73452b548cc46 100644 (file)
@@ -2,7 +2,7 @@ require 'net/http'
 require 'uri'
 require 'cgi'
 
-Url = Struct.new("Url", :channel, :nick, :time, :url) unless defined?(Url)
+Url = Struct.new("Url", :channel, :nick, :time, :url) unless defined?(Struct::Url)
 TITLE_RE = /<\s*?title\s*?>(.+?)<\s*?\/title\s*?>/im
 
 UNESCAPE_TABLE = {