Sha256: 716d8852debf9edeb8867865e1abb7d8c5897364a7f4fe2057e43d3267850094
Contents?: true
Size: 837 Bytes
Versions: 1
Compression:
Stored size: 837 Bytes
Contents
module S3Repo ## # Repo object, represents an Arch repo inside an S3 bucket class Repo < Base def add_package(file) upload!(file) package = Package.new(client: client, key: file) metadata.add_package(package) package end def packages(cache = true) @packages = nil unless cache @packages ||= parse_packages end def metadata @metadata ||= Metadata.new(client: client) end private def upload!(file) client.put_object( bucket: bucket, key: file, body: File.open(file) { |fh| fh.read } ) end def parse_packages resp = client.list_objects(bucket: bucket).contents.map(&:key) resp.select! { |x| x.match(/.*\.pkg\.tar\.xz$/) } resp.map { |x| Package.new(client: client, key: x) } end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
s3repo-0.0.1 | lib/s3repo/repo.rb |