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

Set the store attribute for newly created modules #614

Merged
merged 1 commit into from May 3, 2018
Merged

Set the store attribute for newly created modules #614

merged 1 commit into from May 3, 2018

Conversation

robin850
Copy link
Contributor

Hi,

A regression has been introduced between RDoc 6.0.1 and 6.0.2 with ef958c2 where a new RDoc::NormalModule instance is created without a store associated to it.

This produces an error on generation through SDoc (see zzak/sdoc#124).

I don't know how to reproduce this through the test suite but here are some steps to reproduce it locally:

$ mkdir -p tmp/lib
$ cd tmp
$ echo "Foo::Bar" >> lib/bar.rb
$ echo "module Foo; end" >> lib/foo.rb

Then put the following content in a Rakefile:

require 'rdoc/task'
require 'sdoc'

RDoc::Task.new do |task|
  task.generator = 'sdoc'
end

Make sure to have sdoc installed or in your Gemfile and then run rake rdoc. This error isn't reproducible without using SDoc ; the culprit line is here which reaches this one and produces the error:

undefined method `rdoc' for nil:NilClass

This issue is pretty weird because parse order actually matters since the nested constant must be referenced before the top level constant definition (i.e. bar.rb must be parsed before foo.rb). Dunno whether the fix is correct or not but it works. 🤷‍♂️

Have a nice day !

A regression has been introduced between RDoc 6.0.1 and 6.0.2 with
ef958c2 where a new `RDoc::NormalModule` instance is created without
a store associated to it.

This produces an error on generation through SDoc (see zzak/sdoc#124).
Copy link
Member

@aycabta aycabta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I understand what this wants to do. This bug is my mistake. I guess that this Pull Request is correct. I'll add tests later.

@aycabta aycabta merged commit 1892dc1 into ruby:master May 3, 2018
@aycabta
Copy link
Member

aycabta commented May 3, 2018

I gave up to add tests...I just merged. But I confirmed that this fix is correct.

@robin850 robin850 deleted the fix-nil-store branch May 3, 2018 22:27
@robin850
Copy link
Contributor Author

robin850 commented May 3, 2018

Thanks a ton @aycabta !

@aycabta
Copy link
Member

aycabta commented May 4, 2018

@robin850 I released RDoc 6.0.4. Please check it!

@robin850
Copy link
Contributor Author

robin850 commented May 4, 2018

@aycabta : problem solved ; thanks for the quick release ! 🎉

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

Successfully merging this pull request may close these issues.

None yet

2 participants