module Falkor::Installable

Public Instance Methods

download() click to toggle source
# File lib/falkor/concerns/installable.rb, line 5
def download
  return yard_filepath if Dir.exist? yard_filepath

  block =
    if block_given?
      Proc.new
    else
      proc {}
    end

  generate_documentation(extract(download_source(&block), &block), &block)
end

Private Instance Methods

download_source() { |:downloading, progress| ... } click to toggle source
# File lib/falkor/concerns/installable.rb, line 20
def download_source
  Falkor::Download.new(url, file_name).download do |progress|
    yield :downloading, progress
  end
end
extract(file_path) { |:extracting, progress| ... } click to toggle source
# File lib/falkor/concerns/installable.rb, line 26
def extract(file_path)
  Falkor::Extract::TarGz.
    new(file_path, has_root_dir: true).
    extract do |progress|
      yield :extracting, progress
    end
end
generate_documentation(file_path) { |:generating, progress, description| ... } click to toggle source
# File lib/falkor/concerns/installable.rb, line 34
def generate_documentation(file_path)
  Falkor::Yard::Documentation.
    new(file_path, yard_filepath).
    generate do |progress, description|
      yield :generating, progress, description
    end
end
store() click to toggle source
# File lib/falkor/concerns/installable.rb, line 42
def store
  @store ||= begin
    reg_store = YARD::RegistryStore.new
    reg_store.load(download)
    reg_store
  end
end