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 (yegor256@gmail.com)
- Copyright
-
Copyright © 2019-2026 Yegor Bugayenko
- License
-
MIT
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#dbname ⇒ Object
Returns the value of attribute dbname.
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#docker ⇒ Object
Returns the value of attribute docker.
-
#fresh ⇒ Object
Returns the value of attribute fresh.
-
#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) {|Pgtk::PgsqlTask, Object| ... } ⇒ PgsqlTask
constructor
Initialize a new PostgreSQL server task.
Constructor Details
#initialize(*args) {|Pgtk::PgsqlTask, Object| ... } ⇒ PgsqlTask
Initialize a new PostgreSQL server task.
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/pgtk/pgsql_task.rb', line 30 def initialize(*args, &task_block) super() @docker ||= :maybe @name = args.shift || :pgsql @fresh = 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.verbose(true) do yield(*[self, task_args].slice(0, task_block.arity)) if block_given? run end end end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def config @config end |
#dbname ⇒ Object
Returns the value of attribute dbname.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def dbname @dbname end |
#dir ⇒ Object
Returns the value of attribute dir.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def dir @dir end |
#docker ⇒ Object
Returns the value of attribute docker.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def docker @docker end |
#fresh ⇒ Object
Returns the value of attribute fresh.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def fresh @fresh end |
#name ⇒ Object
Returns the value of attribute name.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def name @name end |
#password ⇒ Object
Returns the value of attribute password.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def port @port end |
#quiet ⇒ Object
Returns the value of attribute quiet.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def quiet @quiet end |
#user ⇒ Object
Returns the value of attribute user.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def user @user end |
#yaml ⇒ Object
Returns the value of attribute yaml.
24 25 26 |
# File 'lib/pgtk/pgsql_task.rb', line 24 def yaml @yaml end |