added 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile +5 -0
- data/lib/added/implementation.rb +2 -2
- data/lib/added/version.rb +1 -1
- data/spec/added_spec.rb +3 -3
- metadata +1 -2
- data/lib/added/.implementation.rb.swp +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 94f1810eec76e187c2b1e5ad9bffb94ec118611c
|
4
|
+
data.tar.gz: 2fabca3aae2827bab5b9fd81c276effe42503795
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70b4871e3e6482b712c632affb45df5aa43e3f8b12c4273f412dfe144f16bdbfcf2a373a6f89c3380126e6ca5f1bf2c33de129250cb7949428a2bf39324b63fe
|
7
|
+
data.tar.gz: 2a4175a8b52bd35698e5803132ce07389009624b4d96a7779c2ed883ebe960d3f01495e1ee53b7dc1a9f78064729c9c4a1c7b9f5c94868fc0aedaeead064dd9a
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/lib/added/implementation.rb
CHANGED
@@ -8,12 +8,12 @@ module Added
|
|
8
8
|
super
|
9
9
|
if respond_to? :added
|
10
10
|
mod = self
|
11
|
-
klass.prepend
|
11
|
+
klass.send(:prepend, Module.new{
|
12
12
|
define_method(:initialize){ |*args, &block|
|
13
13
|
super(*args, &block)
|
14
14
|
mod.added(self)
|
15
15
|
}
|
16
|
-
|
16
|
+
})
|
17
17
|
ObjectSpace.each_object(klass){ |instance|
|
18
18
|
added(instance)
|
19
19
|
}
|
data/lib/added/version.rb
CHANGED
data/spec/added_spec.rb
CHANGED
@@ -67,7 +67,7 @@ describe Added do
|
|
67
67
|
klass.send :define_method, :initialize do |*args|
|
68
68
|
@my2 = args[0]
|
69
69
|
end
|
70
|
-
klass.include
|
70
|
+
klass.send :include, mod
|
71
71
|
object = klass.new("state2")
|
72
72
|
|
73
73
|
assert_equal "state", object.instance_variable_get(:@my)
|
@@ -75,7 +75,7 @@ describe Added do
|
|
75
75
|
end
|
76
76
|
|
77
77
|
it 'respects initializers after inclusion' do
|
78
|
-
klass.include
|
78
|
+
klass.send :include, mod
|
79
79
|
klass.send :define_method, :initialize do |*args|
|
80
80
|
@my2 = args[0]
|
81
81
|
end
|
@@ -87,7 +87,7 @@ describe Added do
|
|
87
87
|
|
88
88
|
it 'works with sub-classed classes' do
|
89
89
|
sub_klass = Class.new(klass)
|
90
|
-
klass.include
|
90
|
+
klass.send :include, mod
|
91
91
|
object = sub_klass.new
|
92
92
|
|
93
93
|
assert_equal "state", object.instance_variable_get(:@my)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: added
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan Lelis
|
@@ -26,7 +26,6 @@ files:
|
|
26
26
|
- README.md
|
27
27
|
- added.gemspec
|
28
28
|
- lib/added.rb
|
29
|
-
- lib/added/.implementation.rb.swp
|
30
29
|
- lib/added/core_ext.rb
|
31
30
|
- lib/added/implementation.rb
|
32
31
|
- lib/added/version.rb
|
Binary file
|