portatext 1.5.15 → 1.5.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/portatext/client/base_client.rb +14 -5
- data/portatext.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9a613ab3f296136776a5b7bdca29f16175d1dd2
|
4
|
+
data.tar.gz: 995f9d560be9fc24f7bc49fa23880ca3553e17af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 062c2e0926f55403fe70721e5da14ccc90137fd747ebdeeca88411cccfd39211daf53f3e6c840a9959efcfd4e2a32a06e822199345fa578a847cbe159163792e
|
7
|
+
data.tar.gz: 61a95f76b368bb6b665d315e8f1fb290493052937598459a92dc604699f68e9097f9c81857f4f2814a609130c7cc8d643d1ff8c67f66746a0f53b433feff9a7d
|
@@ -16,17 +16,26 @@ module PortaText
|
|
16
16
|
attr_writer :executor
|
17
17
|
attr_writer :logger
|
18
18
|
|
19
|
+
def respond_to_missing?(method, *_arguments, &_block)
|
20
|
+
defined?(command_class_name method) || super
|
21
|
+
end
|
22
|
+
|
19
23
|
def method_missing(method, *_arguments, &_block)
|
20
|
-
|
21
|
-
|
22
|
-
.const_get('Command')
|
23
|
-
.const_get('Api')
|
24
|
-
.const_get(method.join(''))
|
24
|
+
class_name = command_class_name(method)
|
25
|
+
super unless defined?(class_name)
|
25
26
|
command = class_name.new
|
26
27
|
command.client = self
|
27
28
|
command
|
28
29
|
end
|
29
30
|
|
31
|
+
def command_class_name(method)
|
32
|
+
method = method.to_s.split('_').map(&:capitalize)
|
33
|
+
Object.const_get('PortaText')
|
34
|
+
.const_get('Command')
|
35
|
+
.const_get('Api')
|
36
|
+
.const_get(method.join(''))
|
37
|
+
end
|
38
|
+
|
30
39
|
# rubocop:disable Metrics/MethodLength
|
31
40
|
# rubocop:disable Metrics/AbcSize
|
32
41
|
# rubocop:disable Metrics/ParameterLists
|
data/portatext.gemspec
CHANGED