Sha256: 3720feb9c1feaadb90684318a6ad7427929ca637d554d6ee6a381c54796421dc

Contents?: true

Size: 633 Bytes

Versions: 2

Compression:

Stored size: 633 Bytes

Contents

class Mangos::Package
  attr_reader :path, :options

  def initialize(path, options)
    raise "path must be an instance of Pathname" unless path.is_a?(Pathname)

    @path = DecoratedPathname.new(path)
    @options = options
  end

  def update
    app_path.mkdir unless File.exists?(app_path)
    thumbnails_path.mkpath unless File.exists?(thumbnails_path)

    Mangos::Update.new(self, Mangos::Processor.new(self)).update
  end

  def app_path
    @path + ".mangos/"
  end

  def data_path
    app_path + "data.json"
  end

  def thumbnails_path
    app_path + "img/thumbnails/"
  end

  def force?
    @options[:force]
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mangos-0.2 lib/mangos/package.rb
mangos-0.1 lib/mangos/package.rb