eval.c: make prepend work on top level #395

Closed
wants to merge 2 commits into from

3 participants

@kyrylo

Since include works on top level, it's reasonable to enable top level
prepend as well. I also included a test case for top level include.

@kyrylo

Sorry, I just realised that the tests are bad, since the ancestry chain gets polluted by my modules. I cannot figure out the proper way to test this, though.

@nobu
Ruby Programming Language member

You can use assert_separately to run a test in a separated process.

@kyrylo

Thanks! I corrected the tests.

@nobu nobu added a commit that referenced this pull request Sep 23, 2013
@nobu nobu test_module.rb: toplevel include
* test/ruby/test_module.rb (TestModule#test_include_toplevel): test
  for top level main.include.  based on a part of the patch by
  kyrylo at [GH-395].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
d190241
@kyrylo

I just noticed this issue: http://bugs.ruby-lang.org/issues/8846

Should I adjust the patch in order to make things consistent with the changes proposed in that issue?

@nobu
Ruby Programming Language member

Yes, it'd be nice.
And could you open a ticket on https://bugs.ruby-lang.org?

kyrylo added some commits Sep 22, 2013
@kyrylo kyrylo eval.c: make prepend work on top level
Since `include` works on top level, it's reasonable to enable top level
`prepend` as well. I also included a test case for top level `include`.
1e9b448
@kyrylo kyrylo eval.c: make top level `include` and `prepend` public
This is proposed in https://bugs.ruby-lang.org/issues/8959

The background for this change can be found at
http://bugs.ruby-lang.org/issues/8846
e0800dc
@mmasaki mmasaki pushed a commit to mmasaki/ruby that referenced this pull request Oct 6, 2013
@nobu nobu test_module.rb: toplevel include
* test/ruby/test_module.rb (TestModule#test_include_toplevel): test
  for top level main.include.  based on a part of the patch by
  kyrylo at [GH-395].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
4523e7c
@zzak
Ruby Programming Language member

Closing this ticket in favor of Feature #8959

Please continue discussion in redmine.

@zzak zzak closed this Oct 15, 2013
@tenderlove tenderlove pushed a commit to tenderlove/ruby that referenced this pull request Jan 24, 2014
@nobu nobu test_module.rb: toplevel include
* test/ruby/test_module.rb (TestModule#test_include_toplevel): test
  for top level main.include.  based on a part of the patch by
  kyrylo at [GH-395].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
99d3850
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment