y_support 2.1.3 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fce88d9e05c9da0d48378fbbe17e33386481e2fc
|
4
|
+
data.tar.gz: 3e9a539de96b4976bdf9202bcea1b61a80a40228
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5595d69147448f116f548ccfd5ef8f13c4e93acba7e3e68b54ba2e00f72e84685e20da7b6912993a80ac9ec080381add607bf57b2860f1d60018deff56ad9279
|
7
|
+
data.tar.gz: 7c77d1d29bfc7fbb94252642fecd3c447346fcf11253a2b7dddf1bc2d517e03800622acccb07a4e7403db8e8cb8a8f5af2bcb05a7164d660dde99d1b87d7be42
|
@@ -4,8 +4,8 @@ module NameMagic::ClassMethods
|
|
4
4
|
# Presents the instances registered by the namespace. Takes one optional
|
5
5
|
# argument. If set to _false_, the method returns all the instances
|
6
6
|
# registered by the namespace. If set to _true_ (default), only returns
|
7
|
-
# those instances registered by the namespace, which are of exactly the
|
8
|
-
# class as the receiver. Example:
|
7
|
+
# those instances registered by the namespace, which are of exactly the
|
8
|
+
# same class as the receiver. Example:
|
9
9
|
#
|
10
10
|
# <code>
|
11
11
|
# class Animal; include NameMagic end
|
@@ -67,9 +67,7 @@ module NameMagic::ClassMethods
|
|
67
67
|
# number of the remaining nameless instances is returned.
|
68
68
|
#
|
69
69
|
def const_magic
|
70
|
-
puts "#{self}#const_magic invoked!" if ::NameMagic::DEBUG
|
71
70
|
return super if namespace == self
|
72
|
-
puts "self is not namespace, #const_magic delegated to #{namespace}" if ::NameMagic::DEBUG
|
73
71
|
namespace.const_magic
|
74
72
|
end
|
75
73
|
|
@@ -20,7 +20,7 @@ module NameMagic
|
|
20
20
|
# assigned to them as their name. (The method does not trigger
|
21
21
|
# +#const_magic+.)
|
22
22
|
#
|
23
|
-
def __instances__
|
23
|
+
def __instances__
|
24
24
|
@instances ||= {}
|
25
25
|
end
|
26
26
|
|
@@ -28,7 +28,7 @@ module NameMagic
|
|
28
28
|
# instance is able to steal (overwrite) a name from another registered
|
29
29
|
# instance. (The method does not trigger +#const_magic+.)
|
30
30
|
#
|
31
|
-
def __avid_instances__
|
31
|
+
def __avid_instances__
|
32
32
|
@avid_instances ||= []
|
33
33
|
end
|
34
34
|
|
data/lib/y_support/name_magic.rb
CHANGED
@@ -78,7 +78,7 @@ module NameMagic
|
|
78
78
|
# not defined otherwise when this method is first called.
|
79
79
|
#
|
80
80
|
define_method :namespace do
|
81
|
-
extend ::NameMagic::NamespaceMethods
|
81
|
+
target.extend ::NameMagic::NamespaceMethods
|
82
82
|
define_singleton_method :namespace do target end # redefines itself
|
83
83
|
namespace
|
84
84
|
end
|
data/lib/y_support/version.rb
CHANGED