Created
October 24, 2015 01:38
-
-
Save devynspencer/8c2230962e03583169c8 to your computer and use it in GitHub Desktop.
Package repository model
This file contains hidden or 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
class Repository | |
attr_reader :id, :created_at, :packages, :checksum | |
def initialize | |
@id = id | |
@created_at = Time.now | |
@packages = packages | |
@checksum = '' | |
end | |
def packages=(repository) | |
# reposync ... repository | |
# createrepo | |
Dir.glob '**/*.rpm' | |
end | |
def search(*query) | |
@packages.map { &:match['/.*p.*\.rpm/'] } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment