Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug on multiple inclusion for classes #814

Closed
BuonOmo opened this issue Jun 3, 2021 · 1 comment · Fixed by #817
Closed

Bug on multiple inclusion for classes #814

BuonOmo opened this issue Jun 3, 2021 · 1 comment · Fixed by #817

Comments

@BuonOmo
Copy link
Contributor

BuonOmo commented Jun 3, 2021

I'm trying to fix completion (in irb) for https://github.com/rgeo/rgeo. However, I stumbled upon an issue which once reduced to a minimal example seems to be a Rdoc bug:

# t.rb
module RGeo
  module Feature
    module Surface
      # YEAH YEAH YIPIYEAH YIPIYO
      def centroid
        puts "I can be executed"
      end
    end
  end
end

module RGeo
  module Feature
    module Polygon
      include Surface
    end
  end
end

module RGeo
  class Geos
    class CAPIPolygonImpl # changing that for `module Geos` works
      include Feature::Polygon
    end
  end
end
$ rdoc -q -f ri --op t t.rb
$ ri --no-standard-docs -d t RGeo::Geos::CAPIPolygonImpl#centroid
Nothing known about RGeo::Geos::CAPIPolygonImpl#centroid

The code is valid ruby (you never now ^^, ruby -r./t.rb -e 'RGeo::Geos::CAPIPolygonImpl.new.centroid'). And changing the class CAPIPolygonImpl to module CAPIPolygonImpl gives the expected output:

$ ri --no-pager --no-standard-docs -d t RGeo::Geos::CAPIPolygonImpl#centroid
RGeo::Geos::CAPIPolygonImpl#centroid

(from /Users/ulysse/Dev/rgeo/rgeo/t)
Implementation from Surface
------------------------------------------------------------------------
  centroid()

------------------------------------------------------------------------

YEAH YEAH YIPIYEAH YIPIYO

Do you have any hint on where it could come from?

Thank you 🙏

@Quiwin
Copy link

Quiwin commented Jun 3, 2021

It seems to be an issue with ancestors_of

break unless stores and not stores.empty?

which break out of its loop if a class has no store associated to it.

When checking for associated store for the ancestor Object, no context is found because of --no-standard-docs and the loop break.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants