Sha256: 831b16076fe4ba161bfe8c9fb3078c3ac425f29fdae2b8995c3a27f2bcc65268

Contents?: true

Size: 691 Bytes

Versions: 2

Compression:

Stored size: 691 Bytes

Contents

require_relative 'hsql/version'
require_relative 'hsql/template'
require_relative 'hsql/file'
require_relative 'hsql/query'
require 'mustache'

module HSQL
  # This is used to indicate when a source file is malformed.
  class FormatError < StandardError
  end

  # Given the contents of a SQL file with YAML front matter (see README for an
  # example) this will return a HSQL::File object providing access to the parts
  # of that file.
  def self.parse(string, environment)
    fail ArgumentError, 'The environment argument is required' unless environment
    File.new(string, environment).parse!
  end

  def self.parse_file(file, environment)
    parse(file.read, environment)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hsql-0.2.1 lib/hsql.rb
hsql-0.2.0 lib/hsql.rb