Sha256: ab2f33aef87e1117bf4bdd63800d45236317322dd38b18101555e773c68b9219
Contents?: true
Size: 447 Bytes
Versions: 16
Compression:
Stored size: 447 Bytes
Contents
require 'erb' require 'active_support/all' # Helper file for generating classes module GeneratorHelpers def self.inject_extension(extension_path, file_path) # Inject Ruby Patient model extensions template = File.read(extension_path) renderer = ERB.new(template, nil, '-') rb_model = File.read(file_path) rb_model.gsub!(/end/, renderer.result(binding)) File.open(file_path, 'w') { |file| file.write(rb_model) } end end
Version data entries
16 entries across 16 versions & 1 rubygems