Class: TengineRailsPlugin::Railtie

Inherits:
Rails::Railtie
  • Object
show all
Defined in:
lib/tengine_rails_plugin.rb

Instance Method Summary collapse

Instance Method Details

#expandpath(app, str) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/tengine_rails_plugin.rb', line 5

def expandpath app, str
  app.paths["config"].expanded.each do |d|
    yml = File.expand_path(str, d)
    if File.exist?(yml)
      yield yml
    else
      str = "#{yml} not found, write one please."
      Rails.logger.error(str)
      STDERR.puts(str) if STDERR.isatty
    end
  end
end