diff --git a/runtime/lib/runtime.rb b/runtime/lib/runtime.rb index 7524aa1..2efec0f 100644 --- a/runtime/lib/runtime.rb +++ b/runtime/lib/runtime.rb @@ -35,6 +35,22 @@ module Runtime path end + # Find and read a runtime file. + # + # @param type [Symbol] + # Type of runtime file to find. See {#find} for available types. + # @param name [String] + # Name of the runtime file to locate. + # + # @return [String] + # Contents of the runtime file, or +nil+ if not found. + def read(type, name) + path = find(type, name) + if path + File.read(path, mode: "rb") + end + end + private # Return the default runtime paths.