Sha256: 4617d35dddab3196584009a504254c3e3fa9ae2441e9e06367506b91abc4323d
Contents?: true
Size: 736 Bytes
Versions: 13
Compression:
Stored size: 736 Bytes
Contents
require 'rebuild' module Rebuild class Runner def initialize(repo_path, primary_scripts, scriptdir) @repo_path = repo_path @primary_scripts = primary_scripts @script_directory = scriptdir end def run return no_script_found if script_paths.empty? script_paths.each do |path| puts "Running #{path}..." system('sh', path) end end private def script_paths target = File.join(absolute_script_directory, '*.sh') Dir.glob(target) end def no_script_found puts "No *.sh found in #{absolute_script_directory}" end def absolute_script_directory File.join([@repo_path, @script_directory].compact) end end end
Version data entries
13 entries across 13 versions & 1 rubygems