uninclude 1.1.0 → 1.2.0

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: 63ca22de6460367252869605ea1792dc2d054fbc
4
- data.tar.gz: c303566dc299e748ac350501586ebce8392e82a9
3
+ metadata.gz: 2f79263459ef7fa7277c158219544f3aea224485
4
+ data.tar.gz: 28000a08eb75952fa64bbee0a8b5cef0fbca6e42
5
5
  SHA512:
6
- metadata.gz: 654b37c0c348f9f66f8ac96856f88cc074088529f09474a3675809b02f3361211f073da1c20f7b57633584a1109a465b606e7b4535c6bb2fcfd859761809e60c
7
- data.tar.gz: e821ed19e65f549429f5f1998d961e1ba81619356784911068cabdcff6cfe3021d2de0bde23393e62d35fd5af67ffd061169453a432291527851c03ba5f04ab6
6
+ metadata.gz: fe90ab8dae54b66dce47c424f0f7a670490acf81ff18402abc3eed7be827da559851f788e513afbd8639de470c15aa0544050df5c0b3ef51b8a76dfabe3e2018
7
+ data.tar.gz: 80890fe920c38978abbc006eac479a1aa28c50643a474e2458d21f87ecc75d76fc64509cc9a1e3d988c59b79373b6161ed227605eefbea600278d2638f297679
@@ -1,7 +1,8 @@
1
1
  language: ruby
2
2
  rvm:
3
3
  - ruby-head
4
- - 2.1.3
4
+ - 2.2.0
5
+ - 2.1.4
5
6
  - 2.1.0
6
7
  - 2.0.0
7
8
  - 1.9.3
data/README.md CHANGED
@@ -1,15 +1,16 @@
1
1
  # Uninclude
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/uninclude.png)](http://rubygems.org/gems/uninclude)
4
- [![Build Status](https://travis-ci.org/rosylilly/uninclude.png?branch=master)](https://travis-ci.org/rosylilly/uninclude)
5
- [![Dependency Status](https://gemnasium.com/rosylilly/uninclude.png)](https://gemnasium.com/rosylilly/uninclude)
3
+ [![Gem Version](https://badge.fury.io/rb/uninclude.svg)](http://rubygems.org/gems/uninclude)
4
+ [![Build Status](https://travis-ci.org/rosylilly/uninclude.svg?branch=master)](https://travis-ci.org/rosylilly/uninclude)
5
+ [![Dependency Status](https://gemnasium.com/rosylilly/uninclude.svg)](https://gemnasium.com/rosylilly/uninclude)
6
6
 
7
7
  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
+ - 2.2.0
12
+ - 2.1.4
13
+ - 2.1.0
13
14
  - 2.0.0
14
15
  - 1.9.3
15
16
  - 1.9.2
@@ -47,5 +47,6 @@ static VALUE rb_m_unextend(VALUE self, VALUE mod) {
47
47
 
48
48
  void Init_uninclude(void) {
49
49
  rb_define_private_method(rb_cModule, "uninclude", RUBY_METHOD_FUNC(rb_m_uninclude), 1);
50
+ rb_define_private_method(rb_cModule, "unprepend", RUBY_METHOD_FUNC(rb_m_uninclude), 1);
50
51
  rb_define_method(rb_cObject, "unextend", RUBY_METHOD_FUNC(rb_m_unextend), 1);
51
52
  }
@@ -1,3 +1,3 @@
1
1
  module Uninclude
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -8,6 +8,13 @@ end
8
8
  describe Uninclude do
9
9
  let(:klass) {
10
10
  Class.new do
11
+ if respond_to_missing?(:singleton_class, true)
12
+ def singleton_class
13
+ class << self
14
+ self
15
+ end
16
+ end
17
+ end
11
18
  end
12
19
  }
13
20
  let(:instance) { klass.new }
@@ -16,8 +23,11 @@ describe Uninclude do
16
23
  it 'should uninclude module' do
17
24
  klass.class_eval { include ExampleMod }
18
25
  expect(instance).to respond_to(:mod)
26
+ expect(instance.mod).to equal(:mod)
27
+ expect(klass.ancestors).to include(ExampleMod)
19
28
  klass.class_eval { uninclude ExampleMod }
20
29
  expect(instance).to_not respond_to(:mod)
30
+ expect(klass.ancestors).to_not include(ExampleMod)
21
31
  end
22
32
 
23
33
  it 'should not infinite loop' do
@@ -25,12 +35,29 @@ describe Uninclude do
25
35
  end
26
36
  end
27
37
 
38
+ if Module.respond_to?(:prepend)
39
+ describe '.unprepend' do
40
+ it 'should unprepend module' do
41
+ klass.class_eval { prepend ExampleMod }
42
+ expect(instance).to respond_to(:mod)
43
+ expect(instance.mod).to equal(:mod)
44
+ expect(klass.ancestors).to include(ExampleMod)
45
+ klass.class_eval { unprepend ExampleMod }
46
+ expect(instance).to_not respond_to(:mod)
47
+ expect(klass.ancestors).to_not include(ExampleMod)
48
+ end
49
+ end
50
+ end
51
+
28
52
  describe '#unextend' do
29
53
  it 'should unextend module' do
30
54
  instance.extend(ExampleMod)
31
55
  expect(instance).to respond_to(:mod)
56
+ expect(instance.mod).to equal(:mod)
57
+ expect(instance.singleton_class.ancestors).to include(ExampleMod)
32
58
  instance.unextend(ExampleMod)
33
59
  expect(instance).to_not respond_to(:mod)
60
+ expect(instance.singleton_class.ancestors).to_not include(ExampleMod)
34
61
  end
35
62
  end
36
63
  end
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.1.0
4
+ version: 1.2.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: 2014-10-18 00:00:00.000000000 Z
11
+ date: 2015-02-02 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.4.2
97
+ rubygems_version: 2.4.5
98
98
  signing_key:
99
99
  specification_version: 4
100
100
  summary: Implement Module#uninclude and Object#unextend