Class: ScoutApm::Instant::Util
- Inherits:
-
Object
- Object
- ScoutApm::Instant::Util
- Defined in:
- lib/scout_apm/instant/middleware.rb
Class Method Summary collapse
-
.read_asset(name, vars = {}) ⇒ Object
reads the literal contents of the file in assets/#name if any vars are supplied, do a simple string substitution of the vars for their values.
Class Method Details
.read_asset(name, vars = {}) ⇒ Object
reads the literal contents of the file in assets/#name if any vars are supplied, do a simple string substitution of the vars for their values
39 40 41 42 43 44 45 |
# File 'lib/scout_apm/instant/middleware.rb', line 39 def self.read_asset(name, vars = {}) contents = File.read(File.join(File.dirname(__FILE__), "assets", name)) if vars.any? vars.each_pair{|k,v| contents.gsub!(k.to_s,v.to_s)} end contents end |