table_display 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/init.rb CHANGED
@@ -1,14 +1,5 @@
1
1
  require 'table_display'
2
2
 
3
- # all Enumerable classes should get TableDisplay functionality...
4
- Enumerable.send(:include, TableDisplay)
5
-
6
- # including those that have already included Enumerable by the time this plugin is loaded.
7
- # Ruby doesn't recursively update through the module tree, so although any new classes/modules
8
- # that include Enumerable will get TableDisplay, we have to do it ourself for older ones.
9
- ObjectSpace.each_object(Module) {|o| o.send(:include, TableDisplay) if o.ancestors.include?(Enumerable)}
10
- ObjectSpace.each_object(Class) {|o| o.send(:include, TableDisplay) if o.ancestors.include?(Enumerable)}
11
-
12
3
  # Rails 2.3 named_scopes certainly quack like enumerables, but surprisingly they don't themself include Enumerable.
13
4
  if ActiveRecord.const_defined?(:NamedScope) && ActiveRecord::NamedScope.const_defined?(:Scope)
14
5
  ActiveRecord::NamedScope::Scope.send(:include, TableDisplay)
@@ -103,3 +103,12 @@ module Kernel
103
103
  puts target.to_table(*options)
104
104
  end
105
105
  end
106
+
107
+ # all Enumerable classes should get TableDisplay functionality...
108
+ Enumerable.send(:include, TableDisplay)
109
+
110
+ # including those that have already included Enumerable by the time this plugin is loaded.
111
+ # Ruby doesn't recursively update through the module tree, so although any new classes/modules
112
+ # that include Enumerable will get TableDisplay, we have to do it ourself for older ones.
113
+ ObjectSpace.each_object(Module) {|o| o.send(:include, TableDisplay) if o.ancestors.include?(Enumerable)}
114
+ ObjectSpace.each_object(Class) {|o| o.send(:include, TableDisplay) if o.ancestors.include?(Enumerable)}
@@ -1,3 +1,3 @@
1
1
  module TableDisplay
2
- VERSION = '0.5.0'
2
+ VERSION = '0.5.1'
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: table_display
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Will Bryant