require 'prick/version.rb' require 'pg_conn' require 'indented_io' require 'constrain' include Constrain require 'forward_to' include ForwardTo require 'fixture_fox' module Prick class Error < RuntimeError; end class Failure < RuntimeError; end end require_relative 'prick/constants.rb' require_relative 'prick/ext/expand_variables.rb' require_relative 'prick/local/command.rb' require_relative 'prick/local/git.rb' require_relative 'prick/local/timer.rb' require_relative 'prick/local/ansi.rb' require_relative 'prick/local/fmt.rb' require_relative 'prick/environment.rb' require_relative 'prick/state.rb' require_relative 'prick/prick_version.rb' require_relative 'prick/diff.rb' module Prick def mesg(*msgs) = Prick.mesg(*msgs) def verb(*msgs) = Prick.verb(*msgs) def self.mesg(*msgs) puts msgs.join(" ") if !$quiet end def self.verb(*msgs) puts msgs.join(" ") if $verbose && !$quiet end end require_relative 'prick/subcommand/subcommand.rb' require_relative 'prick/subcommand/prick-bash.rb' require_relative 'prick/subcommand/prick-build.rb' require_relative 'prick/subcommand/prick-clean.rb' require_relative 'prick/subcommand/prick-create.rb' require_relative 'prick/subcommand/prick-drop.rb' require_relative 'prick/subcommand/prick-fox.rb' require_relative 'prick/subcommand/prick-init.rb' require_relative 'prick/subcommand/prick-list.rb' require_relative 'prick/subcommand/prick-make.rb' require_relative 'prick/subcommand/prick-migrate.rb' require_relative 'prick/subcommand/prick-release.rb' require_relative 'prick/subcommand/prick-run.rb' require_relative 'prick/subcommand/prick-set.rb' require_relative 'prick/subcommand/prick-setup.rb' require_relative 'prick/subcommand/prick-snapshot.rb' require_relative 'prick/subcommand/prick-teardown.rb' require_relative 'prick/subcommand/prick-touch.rb' module Prick @state = nil def self.state?() !@state.nil? end def self.state() @state or raise ArgumentError end def self.state=(state) @state = state end def self.error(*args) raise Prick::Error.new *args end def self.failure(*args) raise Prick::Failure.new *args end def self.owner_conn = state.connection def self.super_conn = State.connection # def self.conn = owner_conn # Return list of prick databases. If a block is given it is called with a # connection to each of the databases def self.databases(&block) databases = super_conn.values %( select datname from pg_database where datistemplate = false order by datname ) databases.select! { |database| PgConn.new(database) { |conn| is_prick_database = conn.exist?(%( select 1 from information_schema.tables where table_schema = 'prick' and table_name = 'builds' limit 1 )) yield(database, conn) if is_prick_database && block_given? is_prick_database } } databases end module SubCommand def self.owner_conn = Prick.owner_conn def self.super_conn = Prick.super_conn # def self.conn = Prick.conn end end