Lines Matching refs:file

8 # A simple module only requires a source file, header file, and test file.
9 # Triad modules require a source, header, and test file for each triad type (like model, conductor, and hardware).
61 # Create default file paths if none were provided
145 # single file patterns (currently just 'test') can reject the other parts of the triad
199 files.each do |file|
200 all_files_exist = false unless File.exist?(file[:path])
205 files.each_with_index do |file, _i|
206 # If this file already exists, don't overwrite it.
207 if File.exist?(file[:path])
208 puts "File #{file[:path]} already exists!"
212 FileUtils.mkdir_p(File.dirname(file[:path]), verbose: false)
213 File.open(file[:path], 'w') do |f|
214 f.write("#{file[:boilerplate]}\n" % [file[:name]]) unless file[:boilerplate].nil?
215 f.write(file[:template] % [file[:name],
216 file[:includes].map { |ff| "#include \"#{ff}\"\n" }.join,
217 file[:name].upcase.tr('-', '_'),
218 file[:name].tr('-', '_'),
219 file[:test_define]])
222 `svn add \"#{file[:path]}\"`
224 puts "File #{file[:path]} created and added to source control"
226 puts "File #{file[:path]} created but FAILED adding to source control!"
229 puts "File #{file[:path]} created"
238 file = filespec[:path]
239 if File.exist?(file)
241 `svn delete \"#{file}\" --force`
242 puts "File #{file} deleted and removed from source control"
244 FileUtils.remove(file)
245 puts "File #{file} deleted"
248 puts "File #{file} does not exist so cannot be removed."
296 ' test - just a test file.',
298 ' -n"camel" sets the file naming convention.',
304 ' -y"my.yml" selects a different yaml config file for module generation',