Class: Workshop::Tools
- Inherits:
-
Object
- Object
- Workshop::Tools
- Defined in:
- lib/workshop/tools.rb
Instance Attribute Summary collapse
-
#hardware_directory ⇒ Object
Returns the value of attribute hardware_directory.
Instance Method Summary collapse
- #avr_ar ⇒ Object
- #avr_gcc ⇒ Object
- #avr_gpp ⇒ Object
- #avr_objcopy ⇒ Object
- #avrdude ⇒ Object
- #avrdude_config ⇒ Object
- #bin_directory ⇒ Object
- #compiler(filename) ⇒ Object
- #compiler_for_extendion ⇒ Object
- #etc_directory ⇒ Object
-
#initialize(hardware_directory) ⇒ Tools
constructor
A new instance of Tools.
- #tools_directory ⇒ Object
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_directory ⇒ Object
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_ar ⇒ Object
29 30 31 |
# File 'lib/workshop/tools.rb', line 29 def avr_ar bin_directory + '/avr-ar' end |
#avr_gcc ⇒ Object
21 22 23 |
# File 'lib/workshop/tools.rb', line 21 def avr_gcc bin_directory + '/avr-gcc' end |
#avr_gpp ⇒ Object
25 26 27 |
# File 'lib/workshop/tools.rb', line 25 def avr_gpp bin_directory + '/avr-g++' end |
#avr_objcopy ⇒ Object
33 34 35 |
# File 'lib/workshop/tools.rb', line 33 def avr_objcopy bin_directory + '/avr-objcopy' end |
#avrdude ⇒ Object
37 38 39 |
# File 'lib/workshop/tools.rb', line 37 def avrdude bin_directory + '/avrdude' end |
#avrdude_config ⇒ Object
41 42 43 |
# File 'lib/workshop/tools.rb', line 41 def avrdude_config etc_directory + '/avrdude.conf' end |
#bin_directory ⇒ Object
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_extendion ⇒ Object
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_directory ⇒ Object
17 18 19 |
# File 'lib/workshop/tools.rb', line 17 def etc_directory tools_directory + '/avr/etc' end |
#tools_directory ⇒ Object
9 10 11 |
# File 'lib/workshop/tools.rb', line 9 def tools_directory hardware_directory + '/tools' end |