y_support 2.1.0 → 2.1.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.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc599e5fe91dcb19ccd68fd32429f95b63ded715
|
4
|
+
data.tar.gz: 2bc37581f0ccd3a5bbe9496ec289b0b883958dfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8c7f97c8a6d64c095ff12c9372b300c9a4a9bb5086537c3caee403e03b68a45dd1a0ddc8319b9bf1b94a9f31667f63d11a8d8cb846cd97b91707d79f54535976
|
7
|
+
data.tar.gz: c70caa248db66904b1d1393c41fd48bee5abf70a9cc9a326ab766e62196975ee2b6b93de8267e30c5da950e877ad8c0a24461cc0a5dc1dab0c4224f8e3f16fa7
|
@@ -152,10 +152,6 @@ module NameMagic
|
|
152
152
|
# Checks all the constants in some module's namespace, recursively.
|
153
153
|
#
|
154
154
|
def serve_all_modules
|
155
|
-
if DEBUG then
|
156
|
-
puts "#{self}#serve_all_modules invoked!"
|
157
|
-
if name.nil? then puts "(ancestors: #{ancestors.take( 4 ).join ', '}" end
|
158
|
-
end
|
159
155
|
todo = ( nameless_instances + __avid_instances__ ).map( &:object_id ).uniq
|
160
156
|
ObjectSpace.each_object Module do |ɱ|
|
161
157
|
ɱ.constants( false ).each do |const_ß|
|
@@ -163,13 +159,13 @@ module NameMagic
|
|
163
159
|
◉ = ɱ.const_get( const_ß ) # insurance against const. loading fails
|
164
160
|
rescue LoadError, StandardError; next end
|
165
161
|
next unless todo.include? ◉.object_id
|
166
|
-
puts "NameMagic: Anonymous object under #{const_ß}!" if DEBUG
|
167
|
-
if ◉.avid? then puts "NameMagic: It is avid." if DEBUG
|
162
|
+
# puts "NameMagic: Anonymous object under #{const_ß}!" if DEBUG
|
163
|
+
if ◉.avid? then # puts "NameMagic: It is avid." if DEBUG
|
168
164
|
◉.make_not_avid! # 1. Remove it from the list of avid instances.
|
169
165
|
◉.name! const_ß # 2. Name it rudely.
|
170
|
-
else puts "NameMagic: It is not avid." if DEBUG
|
166
|
+
else # puts "NameMagic: It is not avid." if DEBUG
|
171
167
|
ɴ = validate_name( name_set_hook.( const_ß, ◉, nil ) ).to_sym
|
172
|
-
puts "NameMagic: Name adjusted to #{ɴ}." if DEBUG
|
168
|
+
# puts "NameMagic: Name adjusted to #{ɴ}." if DEBUG
|
173
169
|
conflicter = begin; const_get( ɴ ); rescue NameError; end
|
174
170
|
if conflicter then
|
175
171
|
msg = "Another #{self}-registered instance named '#{ɴ}' exists!"
|
@@ -6,7 +6,7 @@ class Matrix
|
|
6
6
|
# Pretty inspect
|
7
7
|
def pretty_inspect
|
8
8
|
return inspect if row_size == 0 or column_size == 0
|
9
|
-
aa = send(:rows).each.with_object [] do |row, memo|
|
9
|
+
aa = send( :rows ).each.with_object [] do |row, memo|
|
10
10
|
memo << row.map{ |o|
|
11
11
|
os = o.to_s
|
12
12
|
case o
|
@@ -14,9 +14,9 @@ class Matrix
|
|
14
14
|
else o.to_s end
|
15
15
|
}
|
16
16
|
end
|
17
|
-
width = aa.map{ |row| row.map( &:size ).max }.max + 1
|
17
|
+
width = aa.map { |row| row.map( &:size ).max }.max + 1
|
18
18
|
aa.each_with_object "" do |row, memo|
|
19
|
-
row.each{ |e| memo << e << ' ' * ( width - e.size ) }
|
19
|
+
row.each { |e| memo << e << ' ' * ( width - e.size ) }
|
20
20
|
memo << "\n"
|
21
21
|
end
|
22
22
|
end
|
data/lib/y_support/version.rb
CHANGED