unmixer 0.2.0 → 0.3.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 +4 -4
- data/README.md +5 -0
- data/ext/unmixer/unmixer.c +1 -1
- data/lib/unmixer/core_refine.rb +22 -13
- data/lib/unmixer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 31f9b48b391a4775a211798f0b6fc8bf80780c5c
|
4
|
+
data.tar.gz: daf1b1a3ec1de1b8f3c43277ceaea0414a9a82a2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9f6d675fbd5441c81d0ea8d6bb69f624090f83e9b89ae96a96723346e0fdf45171a116ec0c4e2c295c4c4b63d8f9a03d75efe6cf50ecec3cd25dd5c2f708518
|
7
|
+
data.tar.gz: ebe7174f917f60af175d00d0982c86f472a7b47b8aac83c0f522eef4db4b864dfd8179bdc5a85d9c499c3df8148f01b8437b1eade2350d68a5d64007c5f0b7e3
|
data/README.md
CHANGED
@@ -90,6 +90,11 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/osyo-m
|
|
90
90
|
|
91
91
|
## Release Note
|
92
92
|
|
93
|
+
#### 0.3.0
|
94
|
+
|
95
|
+
* Fix accessibility `#unmixin`/`#uninclude`/`#unprepend` to public.
|
96
|
+
* Remove `#unextend` with block.
|
97
|
+
|
93
98
|
#### 0.2.0
|
94
99
|
|
95
100
|
* Fix `#extend`/`#unextend` result
|
data/ext/unmixer/unmixer.c
CHANGED
@@ -50,5 +50,5 @@ static VALUE rb_m_unmixin(VALUE self, VALUE mod) {
|
|
50
50
|
|
51
51
|
|
52
52
|
void Init_unmixer(void) {
|
53
|
-
|
53
|
+
rb_define_method(rb_cModule, "unmixer_unmixin", RUBY_METHOD_FUNC(rb_m_unmixin), 1);
|
54
54
|
}
|
data/lib/unmixer/core_refine.rb
CHANGED
@@ -2,18 +2,26 @@ require "unmixer/unmixer"
|
|
2
2
|
|
3
3
|
module Unmixer
|
4
4
|
refine Module do
|
5
|
-
|
6
|
-
alias_method :unmixin, :unmixer_unmixin
|
5
|
+
alias_method :unmixin, :unmixer_unmixin
|
7
6
|
|
8
7
|
def unmixer_uninclude mod, &block
|
9
|
-
return unless ancestors.tap { |it| break it[it.find_index(self)+1..it.find_index(superclass)-1] }.include? mod
|
8
|
+
return self unless ancestors.tap { |it| break it[it.find_index(self)+1..it.find_index(superclass)-1] }.include? mod
|
10
9
|
unmixer_unmixin mod
|
11
10
|
end
|
12
11
|
alias_method :uninclude, :unmixer_uninclude
|
13
12
|
|
14
13
|
def unmixer_unprepend mod
|
15
|
-
return unless ancestors.tap { |it| break it[0, it.find_index(self)] }.include? mod
|
14
|
+
return self unless ancestors.tap { |it| break it[0, it.find_index(self)] }.include? mod
|
16
15
|
unmixer_unmixin mod
|
16
|
+
|
17
|
+
if block_given?
|
18
|
+
begin
|
19
|
+
yield(self)
|
20
|
+
ensure
|
21
|
+
unmixer_original_extend mod
|
22
|
+
end
|
23
|
+
end
|
24
|
+
self
|
17
25
|
end
|
18
26
|
alias_method :unprepend, :unmixer_unprepend
|
19
27
|
end
|
@@ -21,7 +29,7 @@ module Unmixer
|
|
21
29
|
refine Object do
|
22
30
|
alias_method :unmixer_original_extend, :extend
|
23
31
|
def unmixer_extend mod
|
24
|
-
|
32
|
+
unmixer_original_extend mod
|
25
33
|
|
26
34
|
if block_given?
|
27
35
|
begin
|
@@ -30,7 +38,7 @@ module Unmixer
|
|
30
38
|
unmixer_unextend mod
|
31
39
|
end
|
32
40
|
end
|
33
|
-
|
41
|
+
self
|
34
42
|
end
|
35
43
|
alias_method :extend, :unmixer_extend
|
36
44
|
|
@@ -39,13 +47,14 @@ module Unmixer
|
|
39
47
|
|
40
48
|
singleton_class.__send__ :unmixer_unmixin, mod
|
41
49
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
50
|
+
# NOTE: 複数のモジュールが mixin されている場合、同じ位置に mixin 出来ない
|
51
|
+
# if block_given?
|
52
|
+
# begin
|
53
|
+
# yield(self)
|
54
|
+
# ensure
|
55
|
+
# unmixer_original_extend mod
|
56
|
+
# end
|
57
|
+
# end
|
49
58
|
self
|
50
59
|
end
|
51
60
|
alias_method :unextend, :unmixer_unextend
|
data/lib/unmixer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unmixer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- manga_osyo
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|