robot_sweatshop 0.1.4 → 0.1.5
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/kintama/README.md +0 -2
- data/kintama/job_assembler_spec.rb +6 -0
- data/lib/job/assembler.rb +5 -1
- data/robot_sweatshop.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4c125a8f67b9ce641d746be4fea9d5811924675
|
4
|
+
data.tar.gz: b15915e3189e482a6130437040c6c8625e5dfdc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0cc634d9cd96a474729a12c5a8881fa83627ee6233b3d36e2923f43893f49593398ea2d8d98a663eb986b7f94b4b2ea4a483710f412677e040d485430be9cc02
|
7
|
+
data.tar.gz: 69d52e4e53a8cfdc7acc50d9bc6456f0524fabe58b1c33cf392f87f67b54b411997f714cff1572aa6526776c8257185de461185285c627d5e5ddd11ccbb7fb0e
|
data/kintama/README.md
CHANGED
@@ -36,6 +36,12 @@ describe 'the Job Assembler' do
|
|
36
36
|
assert_kind_of String, response['job_name']
|
37
37
|
end
|
38
38
|
|
39
|
+
should 'convert objects into JSON strings' do
|
40
|
+
response = @client.request "mirror-#{@jobs_queue}"
|
41
|
+
response = JSON.parse response
|
42
|
+
assert_kind_of Hash, JSON.parse(response['context']['converts_to_string'])
|
43
|
+
end
|
44
|
+
|
39
45
|
should 'only enqueue string objects to context' do
|
40
46
|
response = @client.request "mirror-#{@jobs_queue}"
|
41
47
|
response = JSON.parse response
|
data/lib/job/assembler.rb
CHANGED
@@ -25,12 +25,16 @@ def load_config(for_job_name:)
|
|
25
25
|
YAML.load_file job_config_path
|
26
26
|
end
|
27
27
|
|
28
|
+
def serialize(value)
|
29
|
+
value.is_a?(Hash) ? JSON.generate(value) : value.to_s
|
30
|
+
end
|
31
|
+
|
28
32
|
def assemble_job(data)
|
29
33
|
job_config = load_config for_job_name: data['job_name']
|
30
34
|
return nil unless job_config
|
31
35
|
if job_config['branch_whitelist'].include? data['payload']['branch']
|
32
36
|
context = job_config['environment'].merge(data['payload'])
|
33
|
-
context.each { |key, value| context[key] = value
|
37
|
+
context.each { |key, value| context[key] = serialize value }
|
34
38
|
{
|
35
39
|
commands: job_config['commands'],
|
36
40
|
context: context,
|
data/robot_sweatshop.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: robot_sweatshop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Scott
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|