Skip to content

Commit

Permalink
Merge pull request #82 from esaulkov/dotenv
Browse files Browse the repository at this point in the history
feature: allow erb syntax in conf file
  • Loading branch information
bibendi committed May 23, 2016
2 parents 410dee3 + faa3bed commit 69866a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/resque/integration/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ def to_god
private
def load(path)
if File.exists?(path)
config = YAML.load(File.read(path))
input = File.read(path)
input = ERB.new(input).result if defined?(ERB)
config = YAML.load(input)

@configuration.merge!(config)
end
Expand Down
1 change: 1 addition & 0 deletions spec/resque/integration/configuration_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
let(:config) do
File.stub(:exists? => true)
File.stub(:read)
ERB.stub_chain(:new, :result)
YAML.stub(:load => config_yaml)
described_class.new('path/to/config.yml')
end
Expand Down

0 comments on commit 69866a2

Please sign in to comment.