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

Function register_file

tools/create_class.rb:144–166  ·  view source on GitHub ↗
(sources_cmake, filename)

Source from the content-addressed store, hash-verified

142end
143
144def register_file(sources_cmake, filename)
145 contentsArray = File.readlines(sources_cmake)
146
147 block = false
148 insert_idx = -1
149 contentsArray.each_with_index {|val, index|
150 if block
151 if val.chop().strip == ")"
152 insert_idx = index
153 break
154 end
155 else
156 if val.chop().strip == "set(sources_list" or val.chop().strip == "set(sources_list_h"
157 block = true
158 end
159 end
160 }
161
162 contentsArray.insert(insert_idx, filename)
163 File.open(sources_cmake, 'w') do |file|
164 file.puts contentsArray
165 end
166end
167
168def register(openms_path, lib_name, path, clazz)
169 include_cmake = "#{openms_path}/src/#{lib_name}/include/OpenMS/#{path}/sources.cmake"

Callers 1

registerFunction · 0.85

Calls 3

chopMethod · 0.80
insertMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected