cog-rb 0.3.6 → 0.3.7

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
  SHA1:
3
- metadata.gz: 99eebd0a9a9389c507e570a3f8b4e0cd33a3b017
4
- data.tar.gz: 2bfe8c5dae65be4a0d45545d14944ed6a591c4cd
3
+ metadata.gz: e5dddbe2bed2066466215effb2940091a6d55692
4
+ data.tar.gz: 9f2d2c85e2d06f54499bc5084359c46ee2c3f5a5
5
5
  SHA512:
6
- metadata.gz: 4c073f839b14cfdba265089d1d523f13c70c087c91f8f1356d8557e4ba3386e67941ce5a0cb72b07749a4d8bdd4f5513656c2b589a15c1c1be3fa1ae896a094c
7
- data.tar.gz: 34e7aa0dca4ebb64610ecc6ae687636eb486eb22260784826e0edb49e632a403511a9bf66d96377b281f50b66b5a8d697a6b1524e58c857ecc1aa0282474dcb5
6
+ metadata.gz: dd8e55bd8f0b1c8f88ba9ab7e0aba8a92365a7f744c4a23c0879f151c2f24dbd668ccc63247f4d558e55ca37fce5f56a586314c4fed844b171ce7628364abe93
7
+ data.tar.gz: cd31b8d6cadd2424e60fca4c66b04bd9f5172a2e41b64c781fc12ae0d4cce42afaf58c708683773b876431e3cb448a383012d3c4b9ceb3cfa75b4318171ae102
@@ -38,16 +38,16 @@ class Cog
38
38
  command = ENV['COG_COMMAND']
39
39
  target = command_instance(command)
40
40
  target.execute
41
- rescue Cog::Abort => msg
41
+ rescue Cog::Abort => exception
42
42
  # Abort will end command execution and abort the pipeline
43
43
  response = Cog::Response.new
44
- response['body'] = msg
44
+ response.content = exception.message
45
45
  response.abort
46
46
  response.send
47
- rescue Cog::Stop => msg
47
+ rescue Cog::Stop => exception
48
48
  # Stop will end command execution but the pipeline will continue
49
49
  response = Cog::Response.new
50
- response['body'] = msg
50
+ response['body'] = exception.message
51
51
  response.send
52
52
  end
53
53
 
@@ -17,16 +17,16 @@ class Cog
17
17
  end
18
18
 
19
19
  def send
20
- write "COGCMD_ACTION: abort" unless @aborted.nil?
21
- write "COG_TEMPLATE: #{@template}" unless @template.nil?
20
+ write "COGCMD_ACTION: abort" if aborted
21
+ write "COG_TEMPLATE: #{@template}" if @template
22
22
 
23
23
  return if content.nil?
24
24
 
25
- case content.class
25
+ case content
26
26
  when String
27
- write @content.join('').to_json
27
+ write content
28
28
  else
29
- write "JSON\n" + @content.to_json
29
+ write "JSON\n" + content.to_json
30
30
  end
31
31
  end
32
32
 
@@ -1,3 +1,3 @@
1
1
  class Cog
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cog-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Imbriaco