Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v1_9_3_392) is shown here.
from_io(io, gem_path="(io)", security_policy = nil)
public
Reads a gem from io at gem_path using
security_policy and returns a Format representing the data from
the gem
# File lib/rubygems/format.rb, line 59
def self.from_io(io, gem_path="(io)", security_policy = nil)
format = new gem_path
Gem::Package.open io, 'r', security_policy do |pkg|
format.spec = pkg.metadata
format.file_entries = []
pkg.each do |entry|
size = entry.header.size
mode = entry.header.mode
format.file_entries << [{
"size" => size, "mode" => mode, "path" => entry.full_name,
},
entry.read
]
end
end
format
end