Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

Commit b063c14

Browse files
committed
Updating engine so it processes the user config file as ERB.
1 parent 0e4243e commit b063c14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/requirejs/rails/engine.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Engine < ::Rails::Engine
1717
# config parameters.
1818
config.requirejs.user_config_file = Pathname.new(app.paths["config"].first)+'requirejs.yml'
1919
if config.requirejs.user_config_file.exist?
20-
config.requirejs.user_config = YAML.load(config.requirejs.user_config_file.read)
20+
config.requirejs.user_config = YAML.load(ERB.new(config.requirejs.user_config_file.read).result)
2121
else
2222
config.requirejs.user_config = {}
2323
end
@@ -43,7 +43,7 @@ class Engine < ::Rails::Engine
4343
initializer "requirejs.manifest", :after => "sprockets.environment" do |app|
4444
config = app.config
4545
if config.requirejs.manifest_path.exist? && config.assets.digests
46-
rjs_digests = YAML.load_file(config.requirejs.manifest_path)
46+
rjs_digests = YAML.load(ERB.new(File.new(config.requirejs.manifest_path).read).result)
4747
config.assets.digests.merge!(rjs_digests)
4848
end
4949
end

0 commit comments

Comments
 (0)