symbiont-ruby 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/lib/symbiont/private_trigger.rb +5 -7
- data/lib/symbiont/public_trigger.rb +6 -6
- data/lib/symbiont/trigger.rb +1 -1
- data/lib/symbiont/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 466f4a94d80d4cc61a0a08e50d915e347c818be8c6b84905e2ad65b4d7fdb6f8
|
4
|
+
data.tar.gz: 8b5fd3c0700648866d29569c04fde9f79ae4fe78fbb69d44a310deb5f54931d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7731291d010e3c42b63f98cc160e7ef91dbb213838eba1a49edb471b2ffaeea77745b23b248792fec671eb7b54a9cb25a4ca46528127c47dd5e283238850e5af
|
7
|
+
data.tar.gz: 3fd4fb5be23e5fb45ae115d6fa176f0281b1a040c73b864ebc40a20c888a6b9d9a20b29c95c7ed13695ef82537072bbd102fc73d0cc6b9564e1451564d781413
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Changelog
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
|
4
|
+
## [0.6.0] 2018-03-28
|
5
|
+
### Changed
|
6
|
+
- Removed verbose code from `#__actual_context__` and `#method` methods of
|
7
|
+
`Symbiont::PublicTrigger` and `Symbiont::PrivateTrigger` classes.
|
8
|
+
|
4
9
|
## [0.5.0] 2018-03-28
|
5
10
|
### Added
|
6
11
|
- Support for method dispatching for `BasicObject` instances (which does not support `#respond_to?` method);
|
@@ -33,12 +33,10 @@ module Symbiont
|
|
33
33
|
# this situation is caused when the context object does not respodond to
|
34
34
|
# #resond_to? method (BasicObject instances for example)
|
35
35
|
|
36
|
-
context_singleton =
|
36
|
+
context_singleton = __extract_singleton_class__(context)
|
37
37
|
|
38
|
-
context_singleton.
|
39
|
-
context_singleton.
|
40
|
-
context_singleton.superclass.private_instance_methods(true).include?(method_name) ||
|
41
|
-
context_singleton.superclass.instance_methods(true).include?(method_name)
|
38
|
+
context_singleton.private_instance_methods(true).include?(method_name) ||
|
39
|
+
context_singleton.instance_methods(true).include?(method_name)
|
42
40
|
end
|
43
41
|
end || super
|
44
42
|
end
|
@@ -66,8 +64,8 @@ module Symbiont
|
|
66
64
|
# to #method method (BasicObject instances for example). We can extract
|
67
65
|
# method objects via it's singleton class.
|
68
66
|
|
69
|
-
__context_singleton__ =
|
70
|
-
__context_singleton__.
|
67
|
+
__context_singleton__ = __extract_singleton_class__(__context__)
|
68
|
+
__context_singleton__.instance_method(method_name).bind(__context__)
|
71
69
|
end
|
72
70
|
end
|
73
71
|
end
|
@@ -33,10 +33,8 @@ module Symbiont
|
|
33
33
|
# this situation is caused when the context object does not respodond to
|
34
34
|
# #resond_to? method (BasicObject instances for example)
|
35
35
|
|
36
|
-
context_singleton =
|
37
|
-
|
38
|
-
context_singleton.public_methods(false).include?(method_name) ||
|
39
|
-
context_singleton.superclass.public_instance_methods(false).include?(method_name)
|
36
|
+
context_singleton = __extract_singleton_class__(context)
|
37
|
+
context_singleton.public_instance_methods(true).include?(method_name)
|
40
38
|
end
|
41
39
|
end || super
|
42
40
|
end
|
@@ -44,6 +42,8 @@ module Symbiont
|
|
44
42
|
# Returns a corresponding public method object of the actual context.
|
45
43
|
#
|
46
44
|
# @param method_name [String,Symbol] Method name
|
45
|
+
# @raise [::NameError]
|
46
|
+
# @raise [Symbiont::Trigger::ContextNoMethodError, ::NoMethodError]
|
47
47
|
# @return [Method]
|
48
48
|
#
|
49
49
|
# @see [Symbiont::Trigger#method]
|
@@ -64,8 +64,8 @@ module Symbiont
|
|
64
64
|
# to #method method (BasicObject instances for example). We can extract
|
65
65
|
# method objects via it's singleton class.
|
66
66
|
|
67
|
-
__context_singleton__ =
|
68
|
-
__context_singleton__.
|
67
|
+
__context_singleton__ = __extract_singleton_class__(__context__)
|
68
|
+
__context_singleton__.public_instance_method(method_name).bind(__context__)
|
69
69
|
end
|
70
70
|
end
|
71
71
|
end
|
data/lib/symbiont/trigger.rb
CHANGED
@@ -280,7 +280,7 @@ class Symbiont::Trigger < BasicObject
|
|
280
280
|
#
|
281
281
|
# @api private
|
282
282
|
# @sionce 0.5.0
|
283
|
-
def
|
283
|
+
def __extract_singleton_class__(object)
|
284
284
|
# NOTE: `<<` approach is used cuz BasicObject does not support #singleton_class method.
|
285
285
|
class << object; self; end
|
286
286
|
end
|
data/lib/symbiont/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: symbiont-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rustam Ibragimov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|