cog-rb 0.3.6 → 0.3.7
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 +4 -4
- data/lib/cog/bundle.rb +4 -4
- data/lib/cog/response.rb +5 -5
- data/lib/cog/version.rb +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: e5dddbe2bed2066466215effb2940091a6d55692
|
4
|
+
data.tar.gz: 9f2d2c85e2d06f54499bc5084359c46ee2c3f5a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd8e55bd8f0b1c8f88ba9ab7e0aba8a92365a7f744c4a23c0879f151c2f24dbd668ccc63247f4d558e55ca37fce5f56a586314c4fed844b171ce7628364abe93
|
7
|
+
data.tar.gz: cd31b8d6cadd2424e60fca4c66b04bd9f5172a2e41b64c781fc12ae0d4cce42afaf58c708683773b876431e3cb448a383012d3c4b9ceb3cfa75b4318171ae102
|
data/lib/cog/bundle.rb
CHANGED
@@ -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 =>
|
41
|
+
rescue Cog::Abort => exception
|
42
42
|
# Abort will end command execution and abort the pipeline
|
43
43
|
response = Cog::Response.new
|
44
|
-
response
|
44
|
+
response.content = exception.message
|
45
45
|
response.abort
|
46
46
|
response.send
|
47
|
-
rescue Cog::Stop =>
|
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'] =
|
50
|
+
response['body'] = exception.message
|
51
51
|
response.send
|
52
52
|
end
|
53
53
|
|
data/lib/cog/response.rb
CHANGED
@@ -17,16 +17,16 @@ class Cog
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def send
|
20
|
-
write "COGCMD_ACTION: abort"
|
21
|
-
write "COG_TEMPLATE: #{@template}"
|
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
|
25
|
+
case content
|
26
26
|
when String
|
27
|
-
write
|
27
|
+
write content
|
28
28
|
else
|
29
|
-
write "JSON\n" +
|
29
|
+
write "JSON\n" + content.to_json
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
data/lib/cog/version.rb
CHANGED