Class: Pione::Package::SingleDocumentPackageReader

Inherits:
PackageReader
  • Object
show all
Defined in:
lib/pione/package/package-reader.rb

Overview

SingleDocumentPackageReader is a reader for single document package.

Instance Method Summary collapse

Methods inherited from PackageReader

read

Constructor Details

#initialize(location) ⇒ SingleDocumentPackageReader

Returns a new instance of SingleDocumentPackageReader.



185
186
187
# File 'lib/pione/package/package-reader.rb', line 185

def initialize(location)
  @location = location
end

Instance Method Details

#readObject



189
190
191
192
193
194
195
196
197
# File 'lib/pione/package/package-reader.rb', line 189

def read
  # copy to local
  local_location = @location.local

  # make package info by scanning annotations
  info = PackageScanner.new(local_location).scan

  return PackageHandler.new(local_location.dirname, info: info)
end