Class: Pgtk::PgsqlTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Pgtk::PgsqlTask
- Defined in:
- lib/pgtk/pgsql_task.rb
Overview
Pgsql rake task.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2019-2024 Yegor Bugayenko
- License
-
MIT
Instance Attribute Summary collapse
-
#dbname ⇒ Object
Returns the value of attribute dbname.
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#fresh_start ⇒ Object
Returns the value of attribute fresh_start.
-
#name ⇒ Object
Returns the value of attribute name.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#quiet ⇒ Object
Returns the value of attribute quiet.
-
#user ⇒ Object
Returns the value of attribute user.
-
#yaml ⇒ Object
Returns the value of attribute yaml.
Instance Method Summary collapse
-
#initialize(*args, &task_block) ⇒ PgsqlTask
constructor
A new instance of PgsqlTask.
Constructor Details
#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 |
# 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' @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 |
Instance Attribute Details
#dbname ⇒ Object
Returns the value of attribute dbname.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def dbname @dbname end |
#dir ⇒ Object
Returns the value of attribute dir.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def dir @dir end |
#fresh_start ⇒ Object
Returns the value of attribute fresh_start.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def fresh_start @fresh_start end |
#name ⇒ Object
Returns the value of attribute name.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def port @port end |
#quiet ⇒ Object
Returns the value of attribute quiet.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def quiet @quiet end |
#user ⇒ Object
Returns the value of attribute user.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def user @user end |
#yaml ⇒ Object
Returns the value of attribute yaml.
39 40 41 |
# File 'lib/pgtk/pgsql_task.rb', line 39 def yaml @yaml end |