diff --git a/lib/jsduck/tag_loader.rb b/lib/jsduck/tag_loader.rb index f42ca71e297c26e907e1111f5a8e43f55ae02d0b..b0477eebaeef56d2ad09a9b4b04aa7affc0d4747 100644 --- a/lib/jsduck/tag_loader.rb +++ b/lib/jsduck/tag_loader.rb @@ -24,7 +24,14 @@ module JsDuck # Loads tag classes from given dir or single file. def load(path) if File.directory?(path) - Dir[path+"/**/*.rb"].each {|file| require(file) } + Dir[path+"/**/*.rb"].each do |file| + # Ruby 1.8 doesn't understand that "jsduck/tag/tag" and + # "./lib/jsduck/tag/tag.rb" refer to the same file. So + # explicitly avoid loading this file (as it's required on + # top already) to prevent warnings of constants getting + # defined multiple times. + require(file) unless file =~ /jsduck\/tag\/tag\.rb$/ + end else require(path) end