class Csv2Psql::ErbHelper

ERB Helper

Constants

BASE_DIR

Public Instance Methods

process(filename, ctx = {}) click to toggle source
# File lib/csv2psql/helpers/erb_helper.rb, line 16
def process(filename, ctx = {})
  ctx ||= {} # rubocop:disable Lint/UselessAssignment
  b = binding
  erb = ERB.new(File.read(filename), 0, '>')
  erb.filename = filename
  erb.result b
end
render(filename) click to toggle source
# File lib/csv2psql/helpers/erb_helper.rb, line 11
def render(filename)
  path = File.join(BASE_DIR, filename)
  File.read(path)
end
run() click to toggle source
# File lib/csv2psql/helpers/erb_helper.rb, line 24
def run
  FILES.each do |files|
    process(files)
  end
end