Sha256: 1114430e828333c1d0051e2dae79289f64903161b117c932b6d863e1a6d88b86

Contents?: true

Size: 938 Bytes

Versions: 26

Compression:

Stored size: 938 Bytes

Contents

require 'everyday-plugins'
include EverydayPlugins
class DefaultRunnerPlugin
  extend Plugin
  extend PluginType

  register_variable :output

  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

  def_runners

  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_actions
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
mvn2-2.7.4 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.7.3 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.7.2 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.7.1 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.7.0 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.12 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.11 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.10 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.9 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.8 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.7 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.6 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.5 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.4 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.3 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.2 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.1 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.6.0 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.5.0 lib/mvn2/plugin/default_runner.plugin.rb
mvn2-2.4.2 lib/mvn2/plugin/default_runner.plugin.rb