Sha256: c47539ef8c4f6145f8e633a043f2598e39b85624006a32fef80d16578df72600

Contents?: true

Size: 591 Bytes

Versions: 11

Compression:

Stored size: 591 Bytes

Contents

module Lolcommits
  class Plugin
    attr_accessor :default, :name, :runner, :options

    def configuration
      config = runner.config.user_configuration
      return Hash.new if config.nil?
      config[self.name] || Hash.new
    end

    def initialize(runner)
      self.runner = runner
      self.options = ['enabled']
    end

    def is_enabled?
      enabled_config = configuration['enabled']
      return self.default if enabled_config.nil? || enabled_config == ''
      return enabled_config
    end


    def execute
      if is_enabled?
        run
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
lolcommits-0.4.0 lib/lolcommits/plugin.rb
lolcommits-0.4.0.pre2 lib/lolcommits/plugin.rb
lolcommits-0.4.0.pre1 lib/lolcommits/plugin.rb
lolcommits-0.3.4 lib/lolcommits/plugin.rb
lolcommits-0.3.3 lib/lolcommits/plugin.rb
lolcommits-0.3.2 lib/lolcommits/plugin.rb
lolcommits-0.3.2.pre1 lib/lolcommits/plugin.rb
lolcommits-0.3.1 lib/lolcommits/plugin.rb
lolcommits-0.3.0 lib/lolcommits/plugin.rb
lolcommits-0.3.0.pre2 lib/lolcommits/plugin.rb
lolcommits-0.3.0.pre1 lib/lolcommits/plugin.rb