Class: Spud::BuildTools::Make::Task

Inherits:
Task
  • Object
show all
Defined in:
lib/spud/build_tools/make/task.rb

Instance Attribute Summary

Attributes inherited from Task

#filename, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Task

#args, #initialize

Constructor Details

This class inherits a constructor from Spud::BuildTools::Task

Class Method Details

.mount!Object



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/spud/build_tools/make/task.rb', line 7

def self.mount!
  return unless File.exist?('Makefile')

  if `command -v make`.empty?
    puts 'Makefile detected, but no installation of `make` exists. Skipping make...'
    return
  end

  source = File.read('Makefile')
  source.scan(/^(\S+):.*/).map(&:first).each do |name|
    new(name: name, filename: 'Makefile')
  end
end

Instance Method Details

#invokeObject



21
22
23
# File 'lib/spud/build_tools/make/task.rb', line 21

def invoke(*)
  system('make', name)
end