maitredee 0.9.0 → 0.10.1

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
  SHA256:
3
- metadata.gz: d8ab48c3eedbdfd585222799791ca1b6a4a8c0e5a6ef6c24495a391b83599224
4
- data.tar.gz: 4bb3669032410bead0eef5f87b1754f01ea916f5e0d408d19f8f72524bccf2d5
3
+ metadata.gz: 5140585e2de3476dde09da11d0679d7e53fe6ca1c3848751751d80f9d849fb9d
4
+ data.tar.gz: d62ec6bfa4d2eafc4e35f5b8146ef454dc1d52e0f93ae5ac335ab6b90fd89980
5
5
  SHA512:
6
- metadata.gz: e61d350335b57239f0ea3334b90b24ffc2bd9fcc85eeeab741ffeb50fd4803acf679f95876512293500f707dfd1a993c957f0b59a96062732651f93889b7588f
7
- data.tar.gz: 78952421e2d1e4bb0e7ec5bc312c552de4cc58d03880743100c518a08c0b397976afc6aca319e7db86294194470a1e6b8e9000f6c2b1a6cce68ef1b910aecb84
6
+ metadata.gz: f7723db7092eaa156cf4026b78d9c3962bce00c7eba71baf03366d723d188875bf2cbda263edc3874d0d8c52395144c1f645da91e6abc4bdea91abde42150895
7
+ data.tar.gz: 131c3811fa4750331028112a002836267c110826076ae679366646d3b2dcf563ebe56a8141502e10d1cc763758ccb0ddec90a22e41e753b481ad379ccf0ee0a0
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maitredee (0.9.0)
4
+ maitredee (0.10.1)
5
5
  activesupport
6
6
  aws-sdk-sns
7
7
  aws-sdk-sqs
@@ -34,19 +34,20 @@ GEM
34
34
  minitest (~> 5.1)
35
35
  tzinfo (~> 1.1)
36
36
  aws-eventstream (1.0.2)
37
- aws-partitions (1.144.0)
38
- aws-sdk-core (3.46.2)
39
- aws-eventstream (~> 1.0)
37
+ aws-partitions (1.146.0)
38
+ aws-sdk-core (3.48.2)
39
+ aws-eventstream (~> 1.0, >= 1.0.2)
40
40
  aws-partitions (~> 1.0)
41
- aws-sigv4 (~> 1.0)
41
+ aws-sigv4 (~> 1.1)
42
42
  jmespath (~> 1.0)
43
- aws-sdk-sns (1.9.0)
44
- aws-sdk-core (~> 3, >= 3.39.0)
45
- aws-sigv4 (~> 1.0)
46
- aws-sdk-sqs (1.10.0)
47
- aws-sdk-core (~> 3, >= 3.39.0)
48
- aws-sigv4 (~> 1.0)
49
- aws-sigv4 (1.0.3)
43
+ aws-sdk-sns (1.12.0)
44
+ aws-sdk-core (~> 3, >= 3.48.2)
45
+ aws-sigv4 (~> 1.1)
46
+ aws-sdk-sqs (1.13.0)
47
+ aws-sdk-core (~> 3, >= 3.48.2)
48
+ aws-sigv4 (~> 1.1)
49
+ aws-sigv4 (1.1.0)
50
+ aws-eventstream (~> 1.0, >= 1.0.2)
50
51
  builder (3.2.3)
51
52
  byebug (10.0.2)
52
53
  coderay (1.1.2)
@@ -145,4 +146,4 @@ DEPENDENCIES
145
146
  yard
146
147
 
147
148
  BUNDLED WITH
148
- 1.17.2
149
+ 1.17.3
@@ -122,7 +122,8 @@ module Maitredee
122
122
  def default_shoryuken_options
123
123
  @default_shoryuken_options ||= {
124
124
  body_parser: :json,
125
- auto_delete: true
125
+ auto_delete: true,
126
+ retry_intervals: ->(attempts) { ((attempts - 1) ** 4) + 15 + (rand(30) * (attempts)) }
126
127
  }
127
128
  end
128
129
 
@@ -27,11 +27,27 @@ module Maitredee
27
27
  method_option :verbose, aliases: '-v', type: :boolean, desc: 'Print more verbose output'
28
28
  method_option :delay, aliases: '-D', type: :numeric, desc: 'Number of seconds to pause fetching from an empty queue'
29
29
  def start
30
- opts = options.to_h.symbolize_keys
30
+ cli_opts = options.to_h.symbolize_keys
31
31
 
32
- say '[DEPRECATED] Please use --config instead of --config-file', :yellow if opts[:config_file]
32
+ say '[DEPRECATED] Please use --config instead of --config-file', :yellow if cli_opts[:config_file]
33
33
 
34
- opts[:config_file] = opts.delete(:config) if opts[:config]
34
+ cli_opts[:config_file] = cli_opts.delete(:config) if cli_opts[:config]
35
+
36
+ config_file_opts = {}
37
+ if cli_opts[:config_file]
38
+ path = cli_opts.delete(:config_file)
39
+ fail ArgumentError, "The supplied config file #{path} does not exist" unless File.exist?(path)
40
+
41
+ config_file_opts = YAML.load(ERB.new(IO.read(path)).result)
42
+ config_file_opts.deep_symbolize_keys!
43
+ end
44
+
45
+ opts = config_file_opts.merge(cli_opts)
46
+
47
+ opts[:subscribers] = []
48
+ opts[:subscribers] += cli_opts[:subscribers] if cli_opts[:subscribers]
49
+ opts[:subscribers] += config_file_opts[:subscribers] if config_file_opts[:subscribers]
50
+ opts[:subscribers].uniq!
35
51
 
36
52
  if opts[:rails]
37
53
  opts.delete(:rails)
@@ -42,40 +58,17 @@ module Maitredee
42
58
  require_workers(opts.delete(:require))
43
59
  end
44
60
 
45
- if opts[:config_file]
46
- path = opts.delete(:config_file)
47
- fail ArgumentError, "The supplied config file #{path} does not exist" unless File.exist?(path)
48
-
49
- if (result = YAML.load(ERB.new(IO.read(path)).result))
50
- file = Tempfile.new(['maitredee-to-shoryuken', '.yml'])
51
-
52
- result.deep_symbolize_keys!
53
-
54
- if result[:rails]
55
- load_rails
56
- end
57
-
58
- if result[:subscribers]
59
- subscribers = result.delete(:subscribers)
60
- result[:queues] = subscribers.map(&:constantize).map(&:queue_resource_name)
61
- end
62
-
63
- file.write(YAML.dump(result))
64
- file.flush
65
-
66
- opts[:config_file] = file.path
67
- end
68
- end
69
-
70
61
  if opts[:subscribers]
71
62
  opts[:queues] = opts.delete(:subscribers).map(&:constantize).map(&:queue_resource_name)
72
63
  end
73
64
 
74
65
  fail_task "You should set a logfile if you're going to daemonize" if opts[:daemon] && opts[:logfile].nil?
75
66
 
76
- Shoryuken::Runner.instance.run(opts.freeze)
67
+ file = Tempfile.new(['maitredee-to-shoryuken', '.yml'])
68
+ file.write(YAML.dump(opts))
69
+ file.flush
77
70
 
78
- opts
71
+ Shoryuken::Runner.instance.run(config_file: file.path)
79
72
  end
80
73
 
81
74
  desc 'version', 'Prints version'
@@ -1,3 +1,3 @@
1
1
  module Maitredee
2
- VERSION = "0.9.0"
2
+ VERSION = "0.10.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maitredee
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Plated Devs
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-15 00:00:00.000000000 Z
11
+ date: 2019-03-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -286,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  - !ruby/object:Gem::Version
287
287
  version: '0'
288
288
  requirements: []
289
- rubygems_version: 3.0.1
289
+ rubygems_version: 3.0.2
290
290
  signing_key:
291
291
  specification_version: 4
292
292
  summary: Opinionated pub/sub framework