Class: Mkduino::AutogenSh
- Inherits:
-
GeneratedFile
- Object
- GeneratedFile
- Mkduino::AutogenSh
- Defined in:
- lib/autogen_sh.rb
Instance Attribute Summary
Attributes inherited from GeneratedFile
#backup_directory, #output_directory, #output_filename, #user_updates_file
Instance Method Summary collapse
-
#initialize(output_filename = 'autogen.sh', options = {}) ⇒ AutogenSh
constructor
A new instance of AutogenSh.
- #write_autogen_sh ⇒ Object
Methods inherited from GeneratedFile
#apply_user_updates, #save_file, #save_user_updates, #write_file
Constructor Details
#initialize(output_filename = 'autogen.sh', options = {}) ⇒ AutogenSh
Returns a new instance of AutogenSh.
24 25 26 |
# File 'lib/autogen_sh.rb', line 24 def initialize output_filename = 'autogen.sh', = {} super output_filename, end |
Instance Method Details
#write_autogen_sh ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/autogen_sh.rb', line 27 def write_autogen_sh puts("Writing #{@output_filename}") write_file do |f| f.puts "#!/bin/sh\nif [ -e 'Makefile.am' ] ; then\necho \"Makefile.am Exists - reconfiguring...\"\nautoreconf --force --install -I config -I m4\necho\necho\necho \"************************************\"\necho \"** Now run mkdir build ; cd build ; ../configure --host=avr **\"\necho \"************************************\"\nexit\nfi\necho \"Lets get your project started!\"\n\necho '## Process this file with automake to produce Makefile.in' >> Makefile.am\necho No Makefile.am\n" end `chmod +x #{@output_directory}#{@output_filename}` end |