Class: Pgtk::LiquicheckTask

Inherits:
Rake::TaskLib
  • Object
show all
Defined in:
lib/pgtk/liquicheck_task.rb

Overview

Liquicheck rake task for check Liquibase XML files.

Author

Yegor Bugayenko ([email protected])

Copyright

Copyright © 2019-2025 Yegor Bugayenko

License

MIT

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args, &task_block) ⇒ LiquicheckTask

Returns a new instance of LiquicheckTask.



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/pgtk/liquicheck_task.rb', line 27

def initialize(*args, &task_block)
  super()
  @name = args.shift || :liquicheck
  @dir = 'liquibase'
  @pattern = '*/*.xml'
  desc 'Check the quality of Liquibase XML files' 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

#dirString

Base directory where Liquibase XML files will be stored

Returns:

  • (String)


21
22
23
# File 'lib/pgtk/liquicheck_task.rb', line 21

def dir
  @dir
end

#nameSymbol

Task name

Returns:

  • (Symbol)


17
18
19
# File 'lib/pgtk/liquicheck_task.rb', line 17

def name
  @name
end

#patternString

Migration XML files pattern

Returns:

  • (String)


25
26
27
# File 'lib/pgtk/liquicheck_task.rb', line 25

def pattern
  @pattern
end