Class: Rebuild::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/rebuild/runner.rb

Instance Method Summary collapse

Constructor Details

#initialize(repo_path, primary_scripts, scriptdir) ⇒ Runner

Returns a new instance of Runner.



6
7
8
9
10
# File 'lib/rebuild/runner.rb', line 6

def initialize(repo_path, primary_scripts, scriptdir)
  @repo_path        = repo_path
  @primary_scripts  = primary_scripts
  @script_directory = scriptdir
end

Instance Method Details

#runObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/rebuild/runner.rb', line 12

def run
  return no_script_found if script_paths.empty?

  ordered_scripts.each do |script|
    absolute_path = File.join(absolute_script_directory, script)
    Logger.info("Running #{absolute_path}...")
    system('sh', absolute_path)
  end

  Logger.finish("Finished to rebuild #{absolute_script_directory}")
end