larva 1.2.0 → 1.3.0

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: 0bde0829b8aaeed8e30e47827c6b23fb29140ea8
4
- data.tar.gz: 863ec67e91be524556c62d623d805ee472bf8c23
3
+ metadata.gz: 253b6387b64a8f8bd27ee2b6e532f42c12890d90
4
+ data.tar.gz: 9cee9c21d012769f6b15f732f9a79a1ae6870dbc
5
5
  SHA512:
6
- metadata.gz: 2829b4320ee369b5c5e88bda04f2fd6748ce3f2112d8250c592c73fe0734dd193ff2eef6626297449d2ee612dc6676f6e93bcbf99a5bea329821ce0fdec56363
7
- data.tar.gz: ebf575ac928b7bd6861be17fd312a465fd89263f0afca433907775efda054e9a4ede98c6564f5199f900b9b80346ea580a4478d312ca008355b195b7b0e1a83d
6
+ metadata.gz: 78b99443b3b9ac3c933bb1562738b704340edc38aabe36653618fa087449784cf95733e06ad541df6ca49bac920c8cf3fda870f536df9c79a12ceb0736660ec6
7
+ data.tar.gz: 96c291367029f57c8091eb099dd1a017863a3248f43074ee8840649544880e1822b87b544856cbe588f1b53cfd1b43acfac9083886e464dc5fb59dc6a9de3351
@@ -1,3 +1,6 @@
1
+ # 1.3.0 / 2015-10-7
2
+ * [FEATURE] Read all values from propono.yml (@stevenbarragan)
3
+
1
4
  # 1.2.0 / 2015-08-27
2
5
  * [FEATURE] Interpolate erb on propono configuration yml (@stevenbarragan)
3
6
 
@@ -20,19 +20,9 @@ module Larva
20
20
  Filum.setup(@logfile)
21
21
  Filum.logger.info "Configuring Daemon"
22
22
 
23
- if propono_config = parse_config_file('propono.yml')
24
- Propono.config do |config|
25
- config.use_iam_profile = propono_config[:use_iam_profile]
26
- config.access_key = propono_config[:access_key]
27
- config.secret_key = propono_config[:secret_key]
28
- config.queue_region = propono_config[:region]
29
- config.application_name = propono_config[:application_name]
30
- config.queue_suffix = propono_config[:queue_suffix]
31
- config.udp_host = "pergo.meducation.net"
32
- config.udp_port = "9732"
33
- config.logger = Filum.logger
34
- end
35
- end
23
+ propono_config = parse_config_file('propono.yml')
24
+
25
+ propono_setup(propono_config)
36
26
 
37
27
  after_configure if respond_to?(:after_configure)
38
28
  end
@@ -43,7 +33,16 @@ module Larva
43
33
  hash = YAML::load(contents)
44
34
  hash.stringify_keys[@env].symbolize_keys
45
35
  rescue
46
- nil
36
+ Hash.new()
37
+ end
38
+
39
+ def propono_setup(propono_config)
40
+ Propono.config do |config|
41
+ config.queue_region = propono_config.delete(:region) # Backwards compatible with region key instead of queue_region
42
+ config.logger = Filum.logger
43
+
44
+ propono_config.each { |key, value| config.send("#{key}=", value) }
45
+ end
47
46
  end
48
47
  end
49
48
  end
@@ -1,3 +1,3 @@
1
1
  module Larva
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -4,9 +4,15 @@ development:
4
4
  region: eu-west-1
5
5
  application_name: development_larva_spawn
6
6
  queue_suffix:
7
+ max_retries: 1
8
+ udp_host: pergo.meducation.net
9
+ udp_port: '9732'
7
10
 
8
11
  production:
9
12
  use_iam_profile: true
10
13
  region: eu-west-1
11
14
  application_name: larva_spawn
12
15
  queue_suffix:
16
+ max_retries: 1
17
+ udp_host: pergo.meducation.net
18
+ udp_port: '9732'
@@ -37,6 +37,7 @@ module Larva
37
37
  assert_equal "pergo.meducation.net", Propono.config.udp_host
38
38
  assert_equal "9732", Propono.config.udp_port
39
39
  assert_equal Filum.logger, Propono.config.logger
40
+ assert_equal 1, Propono.config.max_retries
40
41
  end
41
42
 
42
43
  def test_propono_gets_config_with_env
@@ -47,6 +48,7 @@ module Larva
47
48
  assert_equal "pergo.meducation.net", Propono.config.udp_host
48
49
  assert_equal "9732", Propono.config.udp_port
49
50
  assert_equal Filum.logger, Propono.config.logger
51
+ assert_equal 1, Propono.config.max_retries
50
52
  end
51
53
  end
52
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: larva
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - iHiD
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-27 00:00:00.000000000 Z
11
+ date: 2015-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: propono