Class: Pione::Package::PackageReader
- Inherits:
-
Object
- Object
- Pione::Package::PackageReader
- Defined in:
- lib/pione/package/package-reader.rb
Overview
PackageReader is a reader for packages.
Direct Known Subclasses
ArchivePackageReader, DirectoryPackageReader, GitPackageReader, SingleDocumentPackageReader
Class Method Summary collapse
-
.read(location) ⇒ Object
Read a pacakge from the location.
Instance Method Summary collapse
-
#initialize(location) ⇒ PackageReader
constructor
A new instance of PackageReader.
- #read ⇒ Object
Constructor Details
#initialize(location) ⇒ PackageReader
Returns a new instance of PackageReader.
21 22 23 24 25 |
# File 'lib/pione/package/package-reader.rb', line 21 def initialize(location) @location = location @local = nil @package_info = read_package_info end |
Class Method Details
.read(location) ⇒ Object
Read a pacakge from the location.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pione/package/package-reader.rb', line 7 def read(location) case PackageTypeClassifier.classify(location) when :directory DirectoryPackageReader.new(location).read when :git GitPackageReader.new(location).read when :archive ArchivePackageReader.new(location).read when :document SingleDocumentPackageReader.new(location).read end end |
Instance Method Details
#read ⇒ Object
27 28 29 |
# File 'lib/pione/package/package-reader.rb', line 27 def read raise NotImplementedError end |