Sha256: 5a67880dca861834f8f2de341e49ee399b9172e87c90334423097808de7e9457
Contents?: true
Size: 1.05 KB
Versions: 1
Compression:
Stored size: 1.05 KB
Contents
require 'active_support/core_ext/hash' module Arql class App def initialize(options) @options = options Connection.open(connect_options) @definition = Definition.new end def connect_options if use_db_cmd_options? { adapter: @options.db_adapter, host: @options.db_host, username: @options.db_user, password: @options.db_password || '', database: @options.db_name, encoding: @options.db_encoding, pool: @options.db_pool, port: @options.db_port } else config[:db][@options.env] end end def config @config ||= YAML.load(IO.read(@options.config_file)).with_indifferent_access end def run! if @options.code.present? eval(@options.code) elsif @options.args.present? @options.args.each { |rb| load(rb) } else run_repl! end end def run_repl! Repl.new end def use_db_cmd_options? @options.db_host.present? end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
arql-0.1.0 | lib/arql/app.rb |