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

Version Path
cqm-models-4.2.0 lib/generator_helpers.rb
cqm-models-3.1.2 lib/generator_helpers.rb
cqm-models-4.1.1 lib/generator_helpers.rb
cqm-models-4.1.0 lib/generator_helpers.rb
cqm-models-4.0.2 lib/generator_helpers.rb
cqm-models-4.0.1 lib/generator_helpers.rb
cqm-models-4.0.0 lib/generator_helpers.rb
cqm-models-3.1.1 lib/generator_helpers.rb
cqm-models-3.1.0 lib/generator_helpers.rb
cqm-models-3.0.6 lib/generator_helpers.rb
cqm-models-3.0.5 lib/generator_helpers.rb
cqm-models-3.0.4 lib/generator_helpers.rb
cqm-models-3.0.3 lib/generator_helpers.rb
cqm-models-3.0.2 lib/generator_helpers.rb
cqm-models-3.0.1 lib/generator_helpers.rb
cqm-models-3.0.0 lib/generator_helpers.rb