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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4489ff0e80e1a0d40fd0035404c9472c2ea050c4ed49aa2927595fda63eff5df
4
- data.tar.gz: 1990f1547ee49c472b120eee6db5712ba2f09bb874accefe992a745db6f7fab3
3
+ metadata.gz: 466f4a94d80d4cc61a0a08e50d915e347c818be8c6b84905e2ad65b4d7fdb6f8
4
+ data.tar.gz: 8b5fd3c0700648866d29569c04fde9f79ae4fe78fbb69d44a310deb5f54931d8
5
5
  SHA512:
6
- metadata.gz: a9f1954c4aba6f0217e41e591f11e24fde1c260b0facb60e6823e60731b883e5917c96cd7a3ef93de47e5aac799647ff8f35b4088f224042d294fc15df12bc63
7
- data.tar.gz: fcef1a29a6185fbd6e6ad3f0756a30aa4ab4452ba423d9dac1e46f5d6a524538aac77c3b9d0d8f05bd8d1c360ad86d71c2756aec63f63f16c120e2a1d208651b
6
+ metadata.gz: 7731291d010e3c42b63f98cc160e7ef91dbb213838eba1a49edb471b2ffaeea77745b23b248792fec671eb7b54a9cb25a4ca46528127c47dd5e283238850e5af
7
+ data.tar.gz: 3fd4fb5be23e5fb45ae115d6fa176f0281b1a040c73b864ebc40a20c888a6b9d9a20b29c95c7ed13695ef82537072bbd102fc73d0cc6b9564e1451564d781413
@@ -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 = __extract_singleton_object__(context)
36
+ context_singleton = __extract_singleton_class__(context)
37
37
 
38
- context_singleton.private_methods(true).include?(method_name) ||
39
- context_singleton.methods(true).include?(method_name) ||
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__ = __extract_singleton_object__(__context__)
70
- __context_singleton__.superclass.instance_method(method_name).bind(__context__)
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 = __extract_singleton_object__(context)
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__ = __extract_singleton_object__(__context__)
68
- __context_singleton__.superclass.public_instance_method(method_name).bind(__context__)
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
@@ -280,7 +280,7 @@ class Symbiont::Trigger < BasicObject
280
280
  #
281
281
  # @api private
282
282
  # @sionce 0.5.0
283
- def __extract_singleton_object__(object)
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
@@ -5,5 +5,5 @@ module Symbiont
5
5
  #
6
6
  # @api public
7
7
  # @since 0.1.0
8
- VERSION = '0.5.0'
8
+ VERSION = '0.6.0'
9
9
  end
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.5.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-27 00:00:00.000000000 Z
11
+ date: 2019-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec