call_super 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +8 -0
- data/lib/call_super.rb +1 -0
- data/lib_ext/module.rb +22 -2
- data/lib_ext/object.rb +27 -0
- metadata +3 -2
data/CHANGELOG.md
CHANGED
data/lib/call_super.rb
CHANGED
data/lib_ext/module.rb
CHANGED
@@ -4,6 +4,26 @@ class ::Module
|
|
4
4
|
|
5
5
|
include ::CallSuper
|
6
6
|
|
7
|
+
######################
|
8
|
+
# original_include #
|
9
|
+
######################
|
10
|
+
|
11
|
+
alias_method :original_include, :include
|
12
|
+
|
13
|
+
#############
|
14
|
+
# include #
|
15
|
+
#############
|
16
|
+
|
17
|
+
###
|
18
|
+
# Override Object#include so that modules extending Module instance can define #include.
|
19
|
+
#
|
20
|
+
def include( *modules )
|
21
|
+
|
22
|
+
super if defined?( super )
|
23
|
+
original_include( *modules )
|
24
|
+
|
25
|
+
end
|
26
|
+
|
7
27
|
##############################
|
8
28
|
# original_append_features #
|
9
29
|
##############################
|
@@ -15,7 +35,7 @@ class ::Module
|
|
15
35
|
#####################
|
16
36
|
|
17
37
|
###
|
18
|
-
# Override Module.included so that modules extending Module can define #
|
38
|
+
# Override Module.included so that modules extending Module can define #append_features.
|
19
39
|
#
|
20
40
|
def append_features( hooked_instance )
|
21
41
|
|
@@ -48,7 +68,7 @@ class ::Module
|
|
48
68
|
###################
|
49
69
|
|
50
70
|
###
|
51
|
-
# Override Module.extended so that modules extending Module can define #
|
71
|
+
# Override Module.extended so that modules extending Module can define #extend_object.
|
52
72
|
#
|
53
73
|
def extend_object( hooked_instance )
|
54
74
|
|
data/lib_ext/object.rb
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# -*- encoding : utf-8 -*-
|
2
|
+
|
3
|
+
class ::Object
|
4
|
+
|
5
|
+
include ::CallSuper
|
6
|
+
|
7
|
+
#####################
|
8
|
+
# original_extend #
|
9
|
+
#####################
|
10
|
+
|
11
|
+
alias_method :original_extend, :extend
|
12
|
+
|
13
|
+
############
|
14
|
+
# extend #
|
15
|
+
############
|
16
|
+
|
17
|
+
###
|
18
|
+
# Override Object.extend so that modules extending Object instance can define #extend.
|
19
|
+
#
|
20
|
+
def extend( *modules )
|
21
|
+
|
22
|
+
super if defined?( super )
|
23
|
+
original_extend( *modules )
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: call_super
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-30 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: Cause Object#inherited, Module#extended, Module#extend_object, Module#included,
|
15
15
|
Module#append_features to call super if defined.
|
@@ -21,6 +21,7 @@ files:
|
|
21
21
|
- lib/call_super.rb
|
22
22
|
- lib_ext/class.rb
|
23
23
|
- lib_ext/module.rb
|
24
|
+
- lib_ext/object.rb
|
24
25
|
- README.md
|
25
26
|
- CHANGELOG.md
|
26
27
|
homepage: http://rubygems.org/gems/call_super
|