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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 393c324cbb7b6e08af8e413b4b06528c44ee90eb
4
- data.tar.gz: 6c1fe318fa7dae41b1158d3cef1722ed1481e059
3
+ metadata.gz: a4c125a8f67b9ce641d746be4fea9d5811924675
4
+ data.tar.gz: b15915e3189e482a6130437040c6c8625e5dfdc2
5
5
  SHA512:
6
- metadata.gz: a35f0cb0f3be15dd8d0510b816a8195bc86bb0f8ad7e97dfa2ac0f2d1c888197c048b28fcf0444693a2dd032b12c2f25ab84779fb974392b503b60e03696c7f7
7
- data.tar.gz: d61b7e2ee77d29d1ad63a189b88c2e4def7c0f2155167eb510c43ae07b56b9218462acf885bd562bdc7bb924ee4df16c1d35e8010cd97155c37b6d24aaa6f0cf
6
+ metadata.gz: 0cc634d9cd96a474729a12c5a8881fa83627ee6233b3d36e2923f43893f49593398ea2d8d98a663eb986b7f94b4b2ea4a483710f412677e040d485430be9cc02
7
+ data.tar.gz: 69d52e4e53a8cfdc7acc50d9bc6456f0524fabe58b1c33cf392f87f67b54b411997f714cff1572aa6526776c8257185de461185285c627d5e5ddd11ccbb7fb0e
data/kintama/README.md CHANGED
@@ -1,3 +1 @@
1
1
  You can run individual `_spec.rb` files with Ruby or `run_all.rb` to go through each.
2
-
3
- _Warning_: You must run http-in manually. Sinatra is a pain to start and stop programmatically. All other processes will be started by the helper.
@@ -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.to_s }
37
+ context.each { |key, value| context[key] = serialize value }
34
38
  {
35
39
  commands: job_config['commands'],
36
40
  context: context,
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'robot_sweatshop'
3
- gem.version = '0.1.4'
3
+ gem.version = '0.1.5'
4
4
  gem.licenses = 'MIT'
5
5
  gem.authors = ['Justin Scott']
6
6
  gem.email = 'jvscott@gmail.com'
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
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-13 00:00:00.000000000 Z
11
+ date: 2015-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra