MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / executeGemListCommand

Function executeGemListCommand

src/cli/UpdateCommand.cpp:140–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138 }
139
140 void executeGemListCommand(ScriptEngineInstance& rubyEngine) {
141
142 std::string cmd = R"ruby(
143begin
144 embedded = []
145 user = []
146 Gem::Specification.find_all.each do |spec|
147 if spec.gem_dir.chars.first == ':'
148 embedded << spec
149 else
150 user << spec
151 end
152 end
153
154 embedded.each do |spec|
155 safe_puts "#{spec.name} (#{spec.version}) '#{spec.gem_dir}'"
156 end
157
158 user.each do |spec|
159 safe_puts "#{spec.name} (#{spec.version}) '#{spec.gem_dir}'"
160 end
161
162rescue => e
163 $logger.error "Error listing gems: #{e.message} in #{e.backtrace.join("\n")}"
164 exit e.exit_code
165end
166 )ruby";
167 rubyEngine->exec(cmd);
168 }
169
170 void executeRubyRepl(ScriptEngineInstance& rubyEngine) {
171

Callers 1

mainFunction · 0.85

Calls 1

execMethod · 0.45

Tested by

no test coverage detected