Sha256: 6bfe3c7dffe8b5457781baa2828b09aa7f70af8285681eb65f0949f5422d09ea

Contents?: true

Size: 436 Bytes

Versions: 2

Compression:

Stored size: 436 Bytes

Contents

require 'events'

module PrLog
  # Event emitting command base class
  class Command
    include Events::Emitter

    pattr_initialize :config

    def self.perform(options)
      command = new(Configuration.setup(options))
      yield(command) if block_given?
      command.perform
    end

    def perform
      raise(NotImplementedError)
    end

    private

    def project
      @project ||= Project.new(config)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pr_log-0.3.0 lib/pr_log/command.rb
pr_log-0.2.0 lib/pr_log/command.rb