uninclude 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 96405ddf351f077dad99c174639aab798fb9223d
4
- data.tar.gz: cfd494ce34a36479896a833aea8dc05c09f1b067
3
+ metadata.gz: 07fcd722a37b1721f21727b6b13e2b4416113e54
4
+ data.tar.gz: 5b218b563279f83f79d7df3c691afd0a01f07517
5
5
  SHA512:
6
- metadata.gz: 45e33c9ed24d35548ab329289f382db31e586101839d2882e4a9516ec40ca388360697b6769001960eeddbd9d66d0252e196ee64119d6f4fb437a4047848d1a1
7
- data.tar.gz: 037da7ea0a1e7dcd2d0789befe0bf34840ddcddc975b60fb9a949dc68f46f84c6de2857d49e201682cd01c749af245e94db9b1657dd1c171882e11df5bc41bb4
6
+ metadata.gz: b0e06176c4b95b002d995bfcf09be5e253fd4847c86e1f193fc0b6244eaba5a2c8bb951872bfe776edef83c7bae360cb38f7c9e5dba68935aa18e4f41fa97fa0
7
+ data.tar.gz: 0c92c941433a5a01be82504e1bf05867f69e642e7fc7d1a0bf85532423b2e8d2de86ff06840106ad5b6f89bbd58011db2050b1d2bf54b1d9bd830f1c959f041d
data/.travis.yml CHANGED
@@ -1,5 +1,6 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - ruby-head
3
4
  - 2.0.0
4
5
  - 1.9.3
5
6
  - 1.9.2
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Uninclude
2
- VERSION = "1.0.0"
2
+ VERSION = "1.0.1"
3
3
  end
@@ -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.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-03-17 00:00:00.000000000 Z
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.0.0
97
+ rubygems_version: 2.1.9
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Implement Module#uninclude and Object#unextend