Class: Spud::BuildTools::Make

Inherits:
BuildTool show all
Defined in:
lib/build_tools/make/make.rb

Constant Summary

Constants inherited from BuildTool

BuildTool::NAME

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BuildTool

#initialize

Constructor Details

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

Instance Attribute Details

#rulesObject (readonly)

Returns the value of attribute rules.



6
7
8
# File 'lib/build_tools/make/make.rb', line 6

def rules
  @rules
end

Instance Method Details

#mount!Object



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

def mount!
  @rules = {}
  return unless File.exist?('Makefile')

  source = File.read('Makefile')
  source.scan(/^(\S+):.*/).each do |match|
    name = match.first
    @rules[name] = Rule.new(name)
  end
end