ruby_bots 0.0.14 → 0.0.15

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e32a5d383a859aa90ab9908c848ec2752ca7bb461437c3043998705639015b4
4
- data.tar.gz: 5e0d061582106a990017ae4f39aa636babe9bc27a43b192b0cc01ca7d1294f6d
3
+ metadata.gz: 92b2794d56c61fe3cd5572120168ded68cd36656bc21c819637f91093669cd3b
4
+ data.tar.gz: a743fe0ba4e291e1c18de787f5139346f6d7db06aa65c5f05518f527a3181edf
5
5
  SHA512:
6
- metadata.gz: ca81bccad08abbc9d99cddf8e265c4a614796c9cd698acda3acb6499abacd313285df62d2dfe7e2a5401cd5512ad4e9e46e847b5ad56bc78ff463cf37c938843
7
- data.tar.gz: 62c5ab9bdd5a7cc179cc543eea4454885cd6f8812d835d0ccdc157ee76e70e0556d46bb22d9dbf80d42ccc729790da593c8130eee5b700f02785b51b6f1102f2
6
+ metadata.gz: c9c8d8aa5d7a1e7bc93874ebb30e7b98fae2f7cc514366fd3a6bdc61ca7dc852483b30d12f4cac1621d9c4f23319770cbf398af08944e3d21b1bb7cc97db37b4
7
+ data.tar.gz: d3fda3396dca0c0f4ba26bb19e8c470cea16495f10869f53f394741a86e8632064b0c1a85196d3337b80820fe32a7c9d5ec6d46caf6a0154fc50162a1e017c7f
@@ -24,13 +24,21 @@ module RubyBots
24
24
 
25
25
  def response(input)
26
26
  @@input_validators.each do |validator|
27
- validator.call(input)
27
+ send(validator, input)
28
28
  end
29
29
 
30
- output = run(input)
30
+ if @errors.empty?
31
+ output = run(input)
32
+ else
33
+ raise RubyBots::Errors::InvalidInputError.new(errors: @errors)
34
+ end
31
35
 
32
36
  @@output_validators.each do |validator|
33
- validator.call(output)
37
+ send(validator, output)
38
+ end
39
+
40
+ if @errors.any?
41
+ raise RubyBots::Errors::InvalidOutputError.new(errors: @errors)
34
42
  end
35
43
  end
36
44
 
@@ -1,3 +1,3 @@
1
1
  module RubyBots
2
- VERSION = "0.0.14".freeze
2
+ VERSION = "0.0.15".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_bots
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Paulson