Class: Rpub::Commands::Package

Inherits:
Rpub::Command show all
Defined in:
lib/rpub/commands/package.rb

Instance Attribute Summary

Attributes inherited from Rpub::Command

#args, #options

Instance Method Summary (collapse)

Methods inherited from Rpub::Command

#initialize

Constructor Details

This class inherits a constructor from Rpub::Command

Instance Method Details

- (Object) run



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/rpub/commands/package.rb', line 4

def run
  Compile.new(args, options)
  if context.config.package_file
    Rpub::Compressor.open(context.config.package_file) do |zip|
      zip.store_file book.filename, source.read(book.filename)
      Array(context.config.package).each do |file|
        zip.compress_file file, source.read(file)
      end
    end
  end
end