Sha256: fa5778f4f664247458d98d8f9c5b73c25814c2020ec5e5a7cb27ecc38b11c19c
Contents?: true
Size: 587 Bytes
Versions: 31
Compression:
Stored size: 587 Bytes
Contents
# frozen_string_literal: true module Groundskeeper # Class to execute commands for other classes class Executable attr_reader :command @verbose = false class << self attr_writer :verbose end class << self attr_reader :verbose end def initialize(command) if `which #{command}`.empty? raise "#{command} not found, is it installed on your PATH?" end @command = command end def execute(arguments) puts "#{command} #{arguments}" if self.class.verbose `#{command} #{arguments}` end end end
Version data entries
31 entries across 31 versions & 1 rubygems