retroactive_module_inclusion 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.rdoc CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.2.4 / 2011-01-24
2
+
3
+ * 1 minor enhancements
4
+
5
+ * some refactoring and small changes in doc comments
6
+
1
7
  === 1.2.3 / 2011-01-24
2
8
 
3
9
  * 1 minor enhancements
data/Rakefile CHANGED
@@ -8,7 +8,7 @@ require 'hoe'
8
8
  Hoe.spec 'retroactive_module_inclusion' do
9
9
  developer('Adriano Mitre', 'adriano.mitre@gmail.com')
10
10
 
11
- self.version = '1.2.3'
11
+ self.version = '1.2.4'
12
12
 
13
13
  self.readme_file = 'README.rdoc'
14
14
  self.history_file = 'History.rdoc'
@@ -31,27 +31,21 @@ module CoreExt
31
31
 
32
32
  private
33
33
 
34
- # @return [Array] All modules and classes which have self in its ancestors tree, including self itself.
34
+ # @return [Array] All modules and classes which have self in its
35
+ # ancestors tree, including self itself.
36
+ #
37
+ # JRuby (at least up to version 1.5.6) has ObjectSpace disabled by
38
+ # default, thus it might have to be temporarily enabled and then
39
+ # restored. Reference: {ObjectSpace: to have or not to have}[http://ola-bini.blogspot.com/2007/07/objectspace-to-have-or-not-to-have.html].
35
40
  #
36
41
  def pseudo_descendants
37
- # JRuby (at least up to version 1.5.6) has ObjectSpace disabled by default,
38
- # thus it must be enabled manually ([reference][2]).
39
- #
40
- # [1]: http://eigenclass.org/hiki/The+double+inclusion+problem "Dynamic Module Include Problem"
41
- # [2]: http://ola-bini.blogspot.com/2007/07/objectspace-to-have-or-not-to-have.html "ObjectSpace: to have or not to have"
42
- #
43
42
  prev_jruby_objectspace_state = nil # only for scope reasons
44
43
  if defined?(RUBY_DESCRIPTION) && RUBY_DESCRIPTION =~ /jruby/i
45
44
  require 'jruby'
46
45
  prev_jruby_objectspace_state = JRuby.objectspace
47
46
  JRuby.objectspace = true
48
47
  end
49
- result = []
50
- ObjectSpace.each_object(::Module) do |m|
51
- if m <= self # equiv. to "if m.include?(self) || m == self"
52
- result << m
53
- end
54
- end
48
+ result = ObjectSpace.each_object(::Module).select {|m| m <= self } # equiv. to "m.include?(self) || m == self"
55
49
  if defined?(RUBY_DESCRIPTION) && RUBY_DESCRIPTION =~ /jruby/i
56
50
  JRuby.objectspace = prev_jruby_objectspace_state
57
51
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 1
7
7
  - 2
8
- - 3
9
- version: 1.2.3
8
+ - 4
9
+ version: 1.2.4
10
10
  platform: ruby
11
11
  authors:
12
12
  - Adriano Mitre
metadata.gz.sig CHANGED
Binary file