Sha256: 19caa2fb1cb99b97187111cc1301ba9b0781a9c51aaec00e23a4472d1cf436d0

Contents?: true

Size: 652 Bytes

Versions: 15

Compression:

Stored size: 652 Bytes

Contents

module Stove
  class Runner
    include Logify

    attr_reader :cookbook
    attr_reader :options

    def initialize(cookbook, options = {})
      @cookbook = cookbook
      @options  = options
    end

    def run
      run_plugin :git
      run_plugin :community
    end

    private

    def run_plugin(name)
      if skip?(name)
        log.info { "Skipping plugin `:#{name}'" }
      else
        log.info { "Running plugin `:#{name}'" }
        klass = Plugin.const_get(Util.camelize(name))
        klass.new(cookbook, options).run
      end
    end

    def skip?(thing)
      key = "no_#{thing}".to_sym
      !!options[key]
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
stove-5.1.0 lib/stove/runner.rb
stove-5.0.0 lib/stove/runner.rb
stove-4.1.1 lib/stove/runner.rb
stove-4.1.0 lib/stove/runner.rb
stove-4.0.0 lib/stove/runner.rb
stove-3.2.8 lib/stove/runner.rb
wood-stove-3.2.9000 lib/stove/runner.rb
stove-3.2.7 lib/stove/runner.rb
stove-3.2.6 lib/stove/runner.rb
stove-3.2.5 lib/stove/runner.rb
stove-3.2.4 lib/stove/runner.rb
stove-3.2.3 lib/stove/runner.rb
stove-3.2.2 lib/stove/runner.rb
stove-3.2.1 lib/stove/runner.rb
stove-3.0.0 lib/stove/runner.rb