-
-
Save basicfeatures/4eb1f646730fc187d059d9da91385b82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tgz = File.open("ports.tar.gz", "rb") | |
Gem::Package.new("").extract_tar_gz(tgz, "") | |
categories = Pathname.glob("ports/*/").map { |i| i.basename.to_s } | |
categories.each do |category| | |
# puts "Creating #{ category }..." | |
# | |
# Category.create!( | |
# name: category | |
# ) | |
ports = Pathname.glob("ports/#{ category }/*/").map { |i| i.basename.to_s } | |
ports.each do |port| | |
# puts "Creating #{ port }..." | |
# | |
# Port.create!( | |
# name: port, | |
# category: category | |
# ) | |
description = File.read("ports/#{ category }/#{ port }/pkg/DESCR") | |
# Errno::ENOENT (No such file or directory @ rb_sysopen - ports/archivers/arc/pkg/DESCR) | |
end | |
end | |
# File.read("ports/archivers/arc/pkg/DESCR") | |
# => "This package creates..." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment