postburner 1.0.0.pre.8 → 1.0.0.pre.10

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: 38a691a9f1e5d99c0d6f19cbe7c4c605bd1e570787d1cb7c8b5ee862b3efa84c
4
- data.tar.gz: 962f60d03662ee7dc119503f190d5f6376cd7be35a14b52c140d75141a837b0c
3
+ metadata.gz: 5d70db5c9a39d758ab94b917a9bddd996ccaa5de1520180ab07d0e228ea1ed24
4
+ data.tar.gz: a2df7d54ebf98e399d212d98f3aa7c3589f68ae7912b38b31bf060bbe1350928
5
5
  SHA512:
6
- metadata.gz: e4a3bdd33be9342b9e521ef806baff7e27375891f73487daba929aefc9abf1ac888dd037bf764b46c839b8f904e9b766558f1705d2eebbab612a9b27d1562577
7
- data.tar.gz: 69e36547fbc73cab99f8d9991a62825019f4d201e041fdf7cfb508fd885c0ce3dc6b6801f6e1897fe4037877b0649718b7089566b42a68d5e622302797a4c3ac
6
+ metadata.gz: 1346d6ad7b6edb4abaff3eaba39c0bb5572bb9042cec8c6e31876c8b202da6b841d995f567b990545d74adc5d45c5040752077af5acd785bdf1a9fcce4336299
7
+ data.tar.gz: a00d649a8f2dbf7e0c5ed0ab589b6d365cd3decc9dadf33bd8a1c73865ca5e5e390823ff98d707b620c714abf41ccd648729d283a8a950dfe6dd1313c759f2aa
@@ -1,4 +1,4 @@
1
1
  module Postburner
2
- class ApplicationJob < ActiveJob::Base
2
+ class ApplicationJob < ::ActiveJob::Base
3
3
  end
4
4
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'erb'
4
+
3
5
  module Postburner
4
6
  # Configuration system for Postburner workers and connections.
5
7
  #
@@ -54,7 +56,10 @@ module Postburner
54
56
  }
55
57
  end
56
58
 
57
- # Loads configuration from a YAML file.
59
+ # Loads configuration from a YAML file with ERB support.
60
+ #
61
+ # Supports ERB templating like Rails' database.yml, allowing environment
62
+ # variables and Ruby expressions in configuration.
58
63
  #
59
64
  # @param path [String] Path to YAML configuration file
60
65
  # @param env [String] Environment name (e.g., 'production', 'development')
@@ -73,10 +78,10 @@ module Postburner
73
78
  # @example Multiple workers (must specify)
74
79
  # config = Postburner::Configuration.load_yaml('config/postburner.yml', 'production', 'imports')
75
80
  #
76
- # @example config/postburner.yml example
81
+ # @example config/postburner.yml with ERB
77
82
  #
78
83
  # default: &default
79
- # beanstalk_url: beanstalk://localhost:11300
84
+ # beanstalk_url: <%= ENV.fetch('BEANSTALK_URL', 'beanstalk://localhost:11300') %>
80
85
  # default_priority: 131072 # change default priority from 65536 to 131072
81
86
  #
82
87
  # production: # <- environment config, i.e. defaults
@@ -97,7 +102,7 @@ module Postburner
97
102
  # - data_processing
98
103
  #
99
104
  def self.load_yaml(path, env = 'development', worker_name = nil)
100
- yaml = YAML.load_file(path, aliases: true)
105
+ yaml = YAML.load(ERB.new(File.read(path)).result, aliases: true)
101
106
  # env_config = top-level environment config (development:, production:, etc.)
102
107
  env_config = yaml[env.to_s] || yaml[env.to_sym]
103
108
 
@@ -1,3 +1,3 @@
1
1
  module Postburner
2
- VERSION = '1.0.0.pre.8'
2
+ VERSION = '1.0.0.pre.10'
3
3
  end
data/lib/postburner.rb CHANGED
@@ -121,8 +121,8 @@ module Postburner
121
121
  self.queue_strategy = Postburner::NiceQueue
122
122
 
123
123
  # Auto-detect Rails test mode and switch to TestQueue
124
- if defined?(Rails) && Rails.env.test? && defined?(ActiveJob::Base)
125
- if ActiveJob::Base.queue_adapter_name == :test
124
+ if defined?(Rails) && Rails.env.test? && defined?(::ActiveJob::Base)
125
+ if ::ActiveJob::Base.queue_adapter_name == :test
126
126
  self.queue_strategy = Postburner::TestQueue
127
127
  end
128
128
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postburner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.8
4
+ version: 1.0.0.pre.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Smith