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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07fcd722a37b1721f21727b6b13e2b4416113e54
4
- data.tar.gz: 5b218b563279f83f79d7df3c691afd0a01f07517
3
+ metadata.gz: 63ca22de6460367252869605ea1792dc2d054fbc
4
+ data.tar.gz: c303566dc299e748ac350501586ebce8392e82a9
5
5
  SHA512:
6
- metadata.gz: b0e06176c4b95b002d995bfcf09be5e253fd4847c86e1f193fc0b6244eaba5a2c8bb951872bfe776edef83c7bae360cb38f7c9e5dba68935aa18e4f41fa97fa0
7
- data.tar.gz: 0c92c941433a5a01be82504e1bf05867f69e642e7fc7d1a0bf85532423b2e8d2de86ff06840106ad5b6f89bbd58011db2050b1d2bf54b1d9bd830f1c959f041d
6
+ metadata.gz: 654b37c0c348f9f66f8ac96856f88cc074088529f09474a3675809b02f3361211f073da1c20f7b57633584a1109a465b606e7b4535c6bb2fcfd859761809e60c
7
+ data.tar.gz: e821ed19e65f549429f5f1998d961e1ba81619356784911068cabdcff6cfe3021d2de0bde23393e62d35fd5af67ffd061169453a432291527851c03ba5f04ab6
data/.travis.yml CHANGED
@@ -1,6 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - ruby-head
4
+ - 2.1.3
5
+ - 2.1.0
4
6
  - 2.0.0
5
7
  - 1.9.3
6
8
  - 1.9.2
data/README.md CHANGED
@@ -8,6 +8,8 @@ Implement Module#uninclude and Object#unextend
8
8
 
9
9
  ## Tested ruby versions
10
10
 
11
+ - 2.1.3 __BORKEN__
12
+ - 2.1.0 __BROKEN__
11
13
  - 2.0.0
12
14
  - 1.9.3
13
15
  - 1.9.2
data/Rakefile CHANGED
@@ -21,4 +21,4 @@ end
21
21
  RSpec::Core::RakeTask.new(:spec)
22
22
  task :spec => "lib/#{GEM_NAME}/#{GEM_NAME}.#{DLEXT}"
23
23
 
24
- task :default => :spec
24
+ task :default => [:clean, :spec]
@@ -8,4 +8,8 @@ if RUBY_VERSION >= '1.9.3'
8
8
  $CFLAGS << ' -DHAVE_RUBY_BACKWARD_CLASSEXT_H'
9
9
  end
10
10
 
11
+ if RUBY_VERSION >= '2.1.0'
12
+ $CFLAGS << ' -DRUBY_V2_1_0'
13
+ end
14
+
11
15
  create_makefile('uninclude/uninclude')
@@ -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
- rb_clear_cache_by_class(klass);
31
+ RB_CLEAR_CACHE_BY_CLASS(klass);
21
32
  break;
22
33
  }
23
34
  lastklass = klass;
@@ -1,3 +1,3 @@
1
1
  module Uninclude
2
- VERSION = "1.0.1"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -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.should respond_to(:mod)
18
+ expect(instance).to respond_to(:mod)
19
19
  klass.class_eval { uninclude ExampleMod }
20
- instance.should_not respond_to(:mod)
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.should respond_to(:mod)
31
+ expect(instance).to respond_to(:mod)
32
32
  instance.unextend(ExampleMod)
33
- instance.should_not respond_to(:mod)
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.1
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: 2013-10-21 00:00:00.000000000 Z
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.1.9
97
+ rubygems_version: 2.4.2
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Implement Module#uninclude and Object#unextend