mtrack 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -2
- data/lib/mtrack/core.rb +36 -4
- data/lib/mtrack/module_mixin.rb +4 -1
- data/lib/mtrack/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c56fff84edc290d50cf54089be128d852f7cfc76
|
4
|
+
data.tar.gz: d788599143e95cbdc6a9502efb90151959a89c79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58dbd4ecfb53098153e0bad97852c2dc39189378524a745b608e2cf4cc7fa6ac774cae170477f3a03d9be4a07455038b378c31783466ecf097a3e630c26aa728
|
7
|
+
data.tar.gz: 66099b22080f61ccc56007faad78e65cd78c84e320a42803bbbd356965ae74e692fb5626d27096b84a2aa81774b4b7aabec20692590a2355c33b9b3adafed537
|
data/Gemfile
CHANGED
@@ -2,7 +2,7 @@ source "https://rubygems.org"
|
|
2
2
|
gemspec
|
3
3
|
|
4
4
|
group :development do
|
5
|
-
gem "byebug", "~> 3.
|
5
|
+
gem "byebug", "~> 3.4.0"
|
6
6
|
gem "guard-rspec", "~> 4.3.1"
|
7
7
|
gem "libnotify", "~> 0.8.3"
|
8
8
|
gem "pry", "~> 0.10.1"
|
@@ -11,6 +11,6 @@ end
|
|
11
11
|
group :development, :test do
|
12
12
|
gem "codeclimate-test-reporter", "~> 0.4.0"
|
13
13
|
gem "rake", "~> 10.3.2"
|
14
|
-
gem "rspec", "~> 3.
|
14
|
+
gem "rspec", "~> 3.1.0"
|
15
15
|
gem "simplecov", "~> 0.9.0"
|
16
16
|
end
|
data/lib/mtrack/core.rb
CHANGED
@@ -12,9 +12,15 @@ module MTrack
|
|
12
12
|
private
|
13
13
|
|
14
14
|
##
|
15
|
+
# call-seq:
|
16
|
+
# extended(submodule) => submodule
|
17
|
+
#
|
15
18
|
# Initializes a State variable on the Class or Module that extended Core.
|
19
|
+
#
|
20
|
+
# Returns passed +submodule+.
|
16
21
|
def extended(submodule)
|
17
22
|
submodule.instance_eval { @__mtrack__ ||= State.new }
|
23
|
+
submodule
|
18
24
|
end
|
19
25
|
end
|
20
26
|
|
@@ -39,38 +45,64 @@ module MTrack
|
|
39
45
|
private
|
40
46
|
|
41
47
|
##
|
42
|
-
#
|
43
|
-
#
|
48
|
+
# call-seq:
|
49
|
+
# included(submodule) => submodule
|
50
|
+
#
|
51
|
+
# Sets this state as a super-state of the +submodule+ (Class or Module) that
|
52
|
+
# has included the current Module.
|
53
|
+
#
|
54
|
+
# Returns passed +submodule+.
|
44
55
|
def included(submodule)
|
45
56
|
state = @__mtrack__
|
46
57
|
submodule.instance_eval do
|
47
58
|
extend Core
|
48
59
|
@__mtrack__.add_super_state state
|
49
60
|
end
|
61
|
+
submodule
|
50
62
|
end
|
51
63
|
|
52
64
|
##
|
53
|
-
#
|
54
|
-
#
|
65
|
+
# call-seq:
|
66
|
+
# inherited(submodule) => submodule
|
67
|
+
#
|
68
|
+
# Sets this state as a super-state of the +submodule+ (Class) that has
|
69
|
+
# inherited from the current Class.
|
70
|
+
#
|
71
|
+
# Returns passed +submodule+.
|
55
72
|
alias_method :inherited, :included
|
56
73
|
|
57
74
|
##
|
75
|
+
# call-seq:
|
76
|
+
# method_added(name) => name
|
77
|
+
#
|
58
78
|
# Allows method +name+ to be displayed on #tracked_methods once again after
|
59
79
|
# being disabled by a call to #method_undefined.
|
80
|
+
#
|
81
|
+
# Returns passed +name+.
|
60
82
|
def method_added(name)
|
61
83
|
@__mtrack__.delete_undefined name
|
62
84
|
end
|
63
85
|
|
64
86
|
##
|
87
|
+
# call-seq:
|
88
|
+
# method_removed(name) => name
|
89
|
+
#
|
65
90
|
# Stops tracking method +name+ in the current Class or Module.
|
91
|
+
#
|
92
|
+
# Returns passed +name+.
|
66
93
|
def method_removed(name)
|
67
94
|
@__mtrack__.delete_tracked name
|
68
95
|
end
|
69
96
|
|
70
97
|
##
|
98
|
+
# call-seq:
|
99
|
+
# method_undefined(name) => name
|
100
|
+
#
|
71
101
|
# Stops tracking method +name+ in the current Class or Module and prevents
|
72
102
|
# homonymous methods tracked in super-states from being displayed as
|
73
103
|
# #tracked_methods.
|
104
|
+
#
|
105
|
+
# Returns passed +name+.
|
74
106
|
def method_undefined(name)
|
75
107
|
@__mtrack__.delete_tracked name
|
76
108
|
@__mtrack__.add_undefined name
|
data/lib/mtrack/module_mixin.rb
CHANGED
@@ -25,11 +25,14 @@ module MTrack
|
|
25
25
|
|
26
26
|
##
|
27
27
|
# call-seq:
|
28
|
-
# save_tracked_methods(mod, group_name, tracked)
|
28
|
+
# save_tracked_methods(mod, group_name, tracked) => nil
|
29
29
|
#
|
30
30
|
# Saves +tracked+ methods for +mod+ under a +group_name+.
|
31
|
+
#
|
32
|
+
# Returns a +nil+ value.
|
31
33
|
def save_tracked_methods(mod, group_name, tracked)
|
32
34
|
mod.instance_variable_get(:@__mtrack__)[group_name].merge_tracked tracked unless tracked.empty?
|
35
|
+
nil
|
33
36
|
end
|
34
37
|
|
35
38
|
##
|
data/lib/mtrack/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mtrack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel de Oliveira
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-19 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: MTrack extends the functionality of modules and classes and enables them
|
14
14
|
to define public methods within groups. These methods can then be queried back even
|