uninclude 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/README.md +2 -0
- data/Rakefile +1 -1
- data/ext/uninclude/extconf.rb +4 -0
- data/ext/uninclude/uninclude.c +12 -1
- data/lib/uninclude/version.rb +1 -1
- data/spec/uninclude_spec.rb +4 -4
- metadata +14 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 63ca22de6460367252869605ea1792dc2d054fbc
|
4
|
+
data.tar.gz: c303566dc299e748ac350501586ebce8392e82a9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 654b37c0c348f9f66f8ac96856f88cc074088529f09474a3675809b02f3361211f073da1c20f7b57633584a1109a465b606e7b4535c6bb2fcfd859761809e60c
|
7
|
+
data.tar.gz: e821ed19e65f549429f5f1998d961e1ba81619356784911068cabdcff6cfe3021d2de0bde23393e62d35fd5af67ffd061169453a432291527851c03ba5f04ab6
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
data/Rakefile
CHANGED
data/ext/uninclude/extconf.rb
CHANGED
data/ext/uninclude/uninclude.c
CHANGED
@@ -8,6 +8,17 @@
|
|
8
8
|
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl)
|
9
9
|
#endif
|
10
10
|
|
11
|
+
#ifndef RB_CLEAR_CACHE_BY_CLASS
|
12
|
+
#define RB_CLEAR_CACHE_BY_CLASS(c) rb_clear_cache_by_class(c)
|
13
|
+
#endif
|
14
|
+
|
15
|
+
#ifdef RUBY_V2_1_0
|
16
|
+
#undef RCLASS_M_TBL
|
17
|
+
#define RCLASS_M_TBL(c) (RCLASS(c)->m_tbl_wrapper)
|
18
|
+
#undef RB_CLEAR_CACHE_BY_CLASS
|
19
|
+
#define RB_CLEAR_CACHE_BY_CLASS(c) rb_clear_method_cache_by_class(c)
|
20
|
+
#endif
|
21
|
+
|
11
22
|
static void uninclude(VALUE klass, VALUE mod) {
|
12
23
|
Check_Type(mod, T_MODULE);
|
13
24
|
|
@@ -17,7 +28,7 @@ static void uninclude(VALUE klass, VALUE mod) {
|
|
17
28
|
if(lastklass == klass) break;
|
18
29
|
if(klass == mod || RCLASS_M_TBL(superklass) == RCLASS_M_TBL(mod)) {
|
19
30
|
RCLASS_SUPER(klass) = RCLASS_SUPER(superklass);
|
20
|
-
|
31
|
+
RB_CLEAR_CACHE_BY_CLASS(klass);
|
21
32
|
break;
|
22
33
|
}
|
23
34
|
lastklass = klass;
|
data/lib/uninclude/version.rb
CHANGED
data/spec/uninclude_spec.rb
CHANGED
@@ -15,9 +15,9 @@ describe Uninclude do
|
|
15
15
|
describe '.uninclude' do
|
16
16
|
it 'should uninclude module' do
|
17
17
|
klass.class_eval { include ExampleMod }
|
18
|
-
instance.
|
18
|
+
expect(instance).to respond_to(:mod)
|
19
19
|
klass.class_eval { uninclude ExampleMod }
|
20
|
-
instance.
|
20
|
+
expect(instance).to_not respond_to(:mod)
|
21
21
|
end
|
22
22
|
|
23
23
|
it 'should not infinite loop' do
|
@@ -28,9 +28,9 @@ describe Uninclude do
|
|
28
28
|
describe '#unextend' do
|
29
29
|
it 'should unextend module' do
|
30
30
|
instance.extend(ExampleMod)
|
31
|
-
instance.
|
31
|
+
expect(instance).to respond_to(:mod)
|
32
32
|
instance.unextend(ExampleMod)
|
33
|
-
instance.
|
33
|
+
expect(instance).to_not respond_to(:mod)
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uninclude
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sho Kusano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-10-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: Implement Module#uninclude and Object#unextend
|
@@ -60,9 +60,9 @@ extensions:
|
|
60
60
|
- ext/uninclude/extconf.rb
|
61
61
|
extra_rdoc_files: []
|
62
62
|
files:
|
63
|
-
- .gitignore
|
64
|
-
- .rspec
|
65
|
-
- .travis.yml
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rspec"
|
65
|
+
- ".travis.yml"
|
66
66
|
- Gemfile
|
67
67
|
- LICENSE.txt
|
68
68
|
- README.md
|
@@ -84,17 +84,17 @@ require_paths:
|
|
84
84
|
- lib
|
85
85
|
required_ruby_version: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '0'
|
90
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
91
|
requirements:
|
92
|
-
- -
|
92
|
+
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.4.2
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Implement Module#uninclude and Object#unextend
|