Class: Workshop::Tools

Inherits:
Object
  • Object
show all
Defined in:
lib/workshop/tools.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hardware_directory) ⇒ Tools

Returns a new instance of Tools.



5
6
7
# File 'lib/workshop/tools.rb', line 5

def initialize(hardware_directory)
  self.hardware_directory = hardware_directory
end

Instance Attribute Details

#hardware_directoryObject

Returns the value of attribute hardware_directory.



3
4
5
# File 'lib/workshop/tools.rb', line 3

def hardware_directory
  @hardware_directory
end

Instance Method Details

#avr_arObject



29
30
31
# File 'lib/workshop/tools.rb', line 29

def avr_ar
  bin_directory + '/avr-ar'
end

#avr_gccObject



21
22
23
# File 'lib/workshop/tools.rb', line 21

def avr_gcc
  bin_directory + '/avr-gcc'
end

#avr_gppObject



25
26
27
# File 'lib/workshop/tools.rb', line 25

def avr_gpp
  bin_directory + '/avr-g++'
end

#avr_objcopyObject



33
34
35
# File 'lib/workshop/tools.rb', line 33

def avr_objcopy
  bin_directory + '/avr-objcopy'
end

#avrdudeObject



37
38
39
# File 'lib/workshop/tools.rb', line 37

def avrdude
  bin_directory + '/avrdude'
end

#avrdude_configObject



41
42
43
# File 'lib/workshop/tools.rb', line 41

def avrdude_config
  etc_directory + '/avrdude.conf'
end

#bin_directoryObject



13
14
15
# File 'lib/workshop/tools.rb', line 13

def bin_directory
  tools_directory + '/avr/bin'
end

#compiler(filename) ⇒ Object



52
53
54
# File 'lib/workshop/tools.rb', line 52

def compiler(filename)
  compiler_for_extendion[File.extname(filename)]
end

#compiler_for_extendionObject



45
46
47
48
49
50
# File 'lib/workshop/tools.rb', line 45

def compiler_for_extendion
  @_extension_map ||= {
    '.c' => avr_gcc,
    '.cpp' => avr_gpp
  }
end

#etc_directoryObject



17
18
19
# File 'lib/workshop/tools.rb', line 17

def etc_directory
  tools_directory + '/avr/etc'
end

#tools_directoryObject



9
10
11
# File 'lib/workshop/tools.rb', line 9

def tools_directory
  hardware_directory + '/tools'
end