MCPcopy Create free account
hub / github.com/OpenMS/OpenMS / create_sources

Function create_sources

tools/create_class.rb:123–142  ·  view source on GitHub ↗
(openms_path, lib_name, path, clazz, maintainer)

Source from the content-addressed store, hash-verified

121end
122
123def create_sources(openms_path, lib_name, path, clazz, maintainer)
124
125 license = getLicense(openms_path)
126
127 # write the header file
128 header_guard = path.gsub("/", "_") + "_" + clazz.upcase + "_H"
129 template = ERB.new(getTemplate("header"))
130
131 doc = template.result(binding)
132 header_file = "#{openms_path}/src/#{lib_name}/include/OpenMS/#{path}/#{clazz}.h"
133 File.open(header_file, 'w') {|f| f.write(doc) }
134
135 # write the source file
136 header = "#{path}/#{clazz}.h"
137 template = ERB.new(getTemplate("source"))
138
139 doc = template.result(binding)
140 source_file = "#{openms_path}/src/#{lib_name}/source/#{path}/#{clazz}.cpp"
141 File.open(source_file, 'w') {|f| f.write(doc) }
142end
143
144def register_file(sources_cmake, filename)
145 contentsArray = File.readlines(sources_cmake)

Callers 1

create_class.rbFile · 0.85

Calls 4

getLicenseFunction · 0.85
getTemplateFunction · 0.85
openMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected