Method: Pgtk::PgsqlTask#initialize

Defined in:
lib/pgtk/pgsql_task.rb

#initialize(*args, &task_block) ⇒ PgsqlTask

Returns a new instance of PgsqlTask.



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/pgtk/pgsql_task.rb', line 41

def initialize(*args, &task_block)
  super()
  @name = args.shift || :pgsql
  @fresh_start = false
  @quiet = false
  @user = 'test'
  @config = {}
  @password = 'test'
  @dbname = 'test'
  @port = nil
  desc 'Start a local PostgreSQL server' unless ::Rake.application.last_description
  task(name, *args) do |_, task_args|
    RakeFileUtils.send(:verbose, true) do
      yield(*[self, task_args].slice(0, task_block.arity)) if block_given?
      run
    end
  end
end