class RightPublish::MsiRepo

Constants

DEFAULT_MSI_DIR
GEMS_SUBDIRECTORY
MSI_EXT
REPO_KEY
REPO_OPTIONS

Public Instance Methods

add(file_or_dir, target) click to toggle source
# File lib/right_publish/repos/msi.rb, line 10
def add(file_or_dir, target)
  msi_list = get_pkg_list(file_or_dir, MSI_EXT)

  # Copy MSI files to the repository
  destination = repo_config[:subdir]
  msi_list.each do |path|
    # RubyGems repos do not normally prune; it must be explicitly enabled.
    if repo_config[:prune]
      do_in_subdir(destination) { prune_all("#{pkg_parts(path)[:name]}-*.msi") }
    end

    install_file(path, destination)
  end

  # No index generation is necessary; MSI is not a distribution mechanism. The annotated
  # HTML will suffice to direct people to the proper download.
end
annotate(options={}) click to toggle source
Calls superclass method RightPublish::Repo#annotate
# File lib/right_publish/repos/msi.rb, line 28
def annotate(options={})
  options[:subdir] ||= repo_config[:subdir]
  options[:filter] = ['*.msi']
  super(options)
end

Protected Instance Methods

pkg_parts(name) click to toggle source
# File lib/right_publish/repos/msi.rb, line 36
def pkg_parts(name)
  result = {:name=>nil, :version=>nil}
  result[:name], result[:version] = /([A-Za-z0-9\-_]+)-([0-9\.]+)\.#{MSI_EXT}\Z/.match(name).captures
  result
end