Sha256: 76fe793abd1d11a28ceefa0f203772b62d35cf01d0aa603f826ee8ea78397c14

Contents?: true

Size: 771 Bytes

Versions: 21

Compression:

Stored size: 771 Bytes

Contents

module PgObjects
  ##
  # Use to set custom configuration:
  #
  #   PgObjects.configure do |config|
  #     # use relative from RAILS_ROOT
  #     config.before_path = 'db/alternate/before'
  #     # or full (not recommended)
  #     config.after_path = '/var/tmp/alternate/after'
  #     config.extensions = ['sql', 'txt']
  #     # suppress output to console
  #     config.silent = true
  #   end
  class << self
    def configure
      yield config
    end

    def config
      @config ||= Config.new
    end
  end

  class Config
    attr_accessor :before_path, :after_path, :extensions, :silent

    def initialize
      @before_path = 'db/objects/before'
      @after_path = 'db/objects/after'
      @extensions = ['sql']
      @silent = false
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
pg_objects-1.2.0 lib/pg_objects/config.rb
pg_objects-1.0.3 lib/pg_objects/config.rb
pg_objects-1.0.2 lib/pg_objects/config.rb
pg_objects-1.0.1 lib/pg_objects/config.rb
pg_objects-1.0.0 lib/pg_objects/config.rb
pg_objects-0.5.13 lib/pg_objects/config.rb
pg_objects-0.5.12 lib/pg_objects/config.rb
pg_objects-0.5.11 lib/pg_objects/config.rb
pg_objects-0.5.10 lib/pg_objects/config.rb
pg_objects-0.5.9 lib/pg_objects/config.rb
pg_objects-0.5.8 lib/pg_objects/config.rb
pg_objects-0.5.7 lib/pg_objects/config.rb
pg_objects-0.5.6 lib/pg_objects/config.rb
pg_objects-0.5.5 lib/pg_objects/config.rb
pg_objects-0.5.4 lib/pg_objects/config.rb
pg_objects-0.5.3 lib/pg_objects/config.rb
pg_objects-0.5.2 lib/pg_objects/config.rb
pg_objects-0.4.4 lib/pg_objects/config.rb
pg_objects-0.4.3 lib/pg_objects/config.rb
pg_objects-0.4.2 lib/pg_objects/config.rb