Skip to content

Commit

Permalink
Added ERB support to fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Tsadok committed May 5, 2010
1 parent 851ca99 commit 1d823d8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/tiny_mce/configuration.rb
Expand Up @@ -19,7 +19,12 @@ def self.default_options
def self.config_file_options
@@config_file_options ||= begin
tiny_mce_yaml_filepath = File.join(Rails.root.to_s, 'config', 'tiny_mce.yml')
(YAML::load(IO.read(tiny_mce_yaml_filepath)) rescue nil) || Hash.new
fixture_content = IO.read(tiny_mce_yaml_filepath) rescue nil
#Fixtures can be dynamic
if defined?(ERB)
fixture_content = ERB.new(fixture_content).result rescue nil
end
(YAML::load(fixture_content) rescue nil) || Hash.new
end
end

Expand Down

0 comments on commit 1d823d8

Please sign in to comment.