uninclude 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/.travis.yml +1 -0
- data/ext/uninclude/uninclude.c +3 -0
- data/lib/uninclude/version.rb +1 -1
- data/spec/uninclude_spec.rb +5 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07fcd722a37b1721f21727b6b13e2b4416113e54
|
4
|
+
data.tar.gz: 5b218b563279f83f79d7df3c691afd0a01f07517
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0e06176c4b95b002d995bfcf09be5e253fd4847c86e1f193fc0b6244eaba5a2c8bb951872bfe776edef83c7bae360cb38f7c9e5dba68935aa18e4f41fa97fa0
|
7
|
+
data.tar.gz: 0c92c941433a5a01be82504e1bf05867f69e642e7fc7d1a0bf85532423b2e8d2de86ff06840106ad5b6f89bbd58011db2050b1d2bf54b1d9bd830f1c959f041d
|
data/.travis.yml
CHANGED
data/ext/uninclude/uninclude.c
CHANGED
@@ -12,12 +12,15 @@ static void uninclude(VALUE klass, VALUE mod) {
|
|
12
12
|
Check_Type(mod, T_MODULE);
|
13
13
|
|
14
14
|
VALUE superklass = RCLASS_SUPER(klass);
|
15
|
+
VALUE lastklass = 0;
|
15
16
|
for(; superklass; klass = superklass, klass = RCLASS_SUPER(klass)) {
|
17
|
+
if(lastklass == klass) break;
|
16
18
|
if(klass == mod || RCLASS_M_TBL(superklass) == RCLASS_M_TBL(mod)) {
|
17
19
|
RCLASS_SUPER(klass) = RCLASS_SUPER(superklass);
|
18
20
|
rb_clear_cache_by_class(klass);
|
19
21
|
break;
|
20
22
|
}
|
23
|
+
lastklass = klass;
|
21
24
|
};
|
22
25
|
};
|
23
26
|
|
data/lib/uninclude/version.rb
CHANGED
data/spec/uninclude_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
+
require 'timeout'
|
2
3
|
|
3
4
|
module ExampleMod
|
4
5
|
def mod; :mod; end
|
@@ -18,6 +19,10 @@ describe Uninclude do
|
|
18
19
|
klass.class_eval { uninclude ExampleMod }
|
19
20
|
instance.should_not respond_to(:mod)
|
20
21
|
end
|
22
|
+
|
23
|
+
it 'should not infinite loop' do
|
24
|
+
klass.class_eval { uninclude(Module.new) }
|
25
|
+
end
|
21
26
|
end
|
22
27
|
|
23
28
|
describe '#unextend' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: uninclude
|
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
|
- Sho Kusano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-10-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
version: '0'
|
95
95
|
requirements: []
|
96
96
|
rubyforge_project:
|
97
|
-
rubygems_version: 2.
|
97
|
+
rubygems_version: 2.1.9
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: Implement Module#uninclude and Object#unextend
|