Class: DefaultRunnerPlugin

Inherits:
Object
  • Object
show all
Extended by:
Plugin, PluginType
Defined in:
lib/mvn2/plugin/default_runner.plugin.rb

Class Method Summary collapse

Class Method Details

.def_actionsObject



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/mvn2/plugin/default_runner.plugin.rb', line 22

def self.def_actions
  register(:after_run, order: 1000) { |_, _|
    runner = Plugins.get_var :runner
    if runner == :default
      output = Plugins.get_var :output
      IO.write(Plugins.get(:log_file_name), output) if Plugins.get(:log_file_enable)
      output.each_line { |l|
        tmp = Plugins.get :line_filter, l
        puts tmp unless tmp.nil?
      }
      found = Plugins.get_var :found
      output.each_line { |line| puts line } unless found
    end
  }
end

.def_runnersObject



9
10
11
12
13
14
15
16
17
18
# File 'lib/mvn2/plugin/default_runner.plugin.rb', line 9

def self.def_runners
  register(:runner_enable, key: :default) { |_| true }

  register(:runner, key: :default, priority: 0) { |_, cmd|
    output = `#{cmd}`
    result = $?.success?
    Plugins.set_var :output, output
    result
  }
end