lib/yard/handlers/ruby/legacy/mixin_handler.rb in yard-0.5.8 vs lib/yard/handlers/ruby/legacy/mixin_handler.rb in yard-0.6.0
- old
+ new
@@ -1,5 +1,6 @@
+# (see Ruby::MixinHandler)
class YARD::Handlers::Ruby::Legacy::MixinHandler < YARD::Handlers::Ruby::Legacy::Base
handles /\Ainclude(\s|\()/
process do
statement.tokens[1..-1].to_s.split(/\s*,\s*/).each do |mixin|
@@ -21,8 +22,8 @@
obj.type = :module
when ConstantObject # If a constant is included, use its value as the real object
obj = Proxy.new(namespace, obj.value)
end
- namespace.mixins(scope) << obj
+ namespace.mixins(scope).unshift(obj) unless namespace.mixins(scope).include?(obj)
end
end