Sha256: 0571dab71b581d2ffb33490343bab7c12a4082447ea8c9bb7b34fbe41cb2b69b

Contents?: true

Size: 625 Bytes

Versions: 1

Compression:

Stored size: 625 Bytes

Contents

require 'shellwords'

module Dynosaur
  class Process
    def initialize(task:, args: [], opts: {})
      @rake_command = Utils::RakeCommand.new(task: task, args: args)
      after_initialize(opts)
    end

    def running?
      klass = self.class.const_get('Finder')
      finder = klass.new(rake_command: rake_command)
      finder.exists?
    end

    def start
      fail NotImplementedError, 'This method must be implemented in a subclass'
    end

    private

    attr_reader :rake_command

    def after_initialize(opts)
      # Do nothing so subclasses don't have to override if they want a no-op
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dynosaur-0.2.0 lib/dynosaur/process.rb