ruby_bots 0.0.19 → 0.0.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ruby_bots/tool.rb +4 -4
- data/lib/ruby_bots/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6fe6af69b0f6b871f59ea8c422defcc28ac465b356d9e7be0214eba964888adb
|
4
|
+
data.tar.gz: 7393cb0b00608b819f18a0e5b70dc3c5e9bbc7340f69954b39c997bb2241410f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fea70d6a36d0c001a855759d2e71cc6dfe6dd91efd76c20108b6cba9a60487fdea279339b9ceb3064a3900ec83ea1f0601d19c0690d1c21683560741d7fc5b62
|
7
|
+
data.tar.gz: 4a0f0903d669e9ba26acc7c9e27668250d4298ca9d741a0cff864ad17f6ac8a360f6f5fc2c6b694b647bfa966d0171b14f316da93805522b27589d2ad7cdcabb
|
data/lib/ruby_bots/tool.rb
CHANGED
@@ -12,12 +12,12 @@ module RubyBots
|
|
12
12
|
attr_accessor :input_validators, :output_validators
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.
|
15
|
+
def self.validate_input(method)
|
16
16
|
@input_validators ||= []
|
17
17
|
@input_validators << method
|
18
18
|
end
|
19
19
|
|
20
|
-
def self.
|
20
|
+
def self.validate_output(method)
|
21
21
|
@output_validators ||= []
|
22
22
|
@output_validators << method
|
23
23
|
end
|
@@ -28,7 +28,7 @@ module RubyBots
|
|
28
28
|
send(validator, input)
|
29
29
|
end
|
30
30
|
|
31
|
-
if
|
31
|
+
if @errors.empty?
|
32
32
|
output = run(input)
|
33
33
|
else
|
34
34
|
raise RubyBots::InvalidInputError.new(errors: @errors)
|
@@ -39,7 +39,7 @@ module RubyBots
|
|
39
39
|
send(validator, output)
|
40
40
|
end
|
41
41
|
|
42
|
-
if
|
42
|
+
if @errors.any?
|
43
43
|
raise RubyBots::InvalidOutputError.new(errors: @errors)
|
44
44
|
end
|
45
45
|
|
data/lib/ruby_bots/version.rb
CHANGED