6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/hypertube-ruby-sdk/utils/runtime_logger.rb', line 6
def self.get_runtime_info(get_loaded_modules)
pieces = []
pieces << to_utf8("Ruby Managed Runtime Info:\n")
pieces << to_utf8("Ruby Version: #{RUBY_VERSION}\n")
pieces << to_utf8("Ruby Implementation: #{RUBY_ENGINE}\n")
pieces << to_utf8("Ruby Platform: #{RUBY_PLATFORM}\n")
pieces << to_utf8("Ruby Engine: #{RUBY_ENGINE}\n")
pieces << to_utf8("Ruby Engine Version: #{RUBY_ENGINE_VERSION}\n")
pieces << to_utf8("Current Directory: #{Dir.pwd}\n")
paths = $LOAD_PATH.map { |p| to_utf8(p.to_s) }.join(', ')
pieces << to_utf8('Ruby search path: ') + paths + to_utf8("\n")
if get_loaded_modules
loaded = $LOADED_FEATURES.map(&:to_s).reject { |feature| feature.include?('Binaries/Ruby') }.join(', ')
pieces << to_utf8('Ruby loaded modules (excluding RuntimeBridge classes): ' + loaded + "\n")
end
pieces.join
rescue StandardError => e
to_utf8('Ruby Managed Runtime Info: Error while fetching runtime info')
end
|