lib/vanagon/component/source/http.rb
def extract(tar)
          if ARCHIVE_EXTENSIONS.include?(@extension)
            case @extension
            when ".tar.gz", ".tgz"
              return "gunzip -c '#{@file}' | '#{tar}' xf -"
            when ".zip"
              return "unzip '#{@file}' || 7za x -r -tzip -o'#{File.basename(@file, ".zip")}' '#{@file}'"
            end
          else
            # Extension does not appear to be an archive
            return ':'
          end
        end
# Gets the command to extract the archive given if needed (uses @extension)
#
# @param tar [String] the tar command to use
# @return [String, nil] command to extract the source
# @raise [RuntimeError] an exception is raised if there is no known extraction method for @extension
Gets the command to extract the archive given if needed (uses @extension)
Gets the command to extract the archive given if needed ( uses @extension )
def extract(tar)
          if ARCHIVE_EXTENSIONS.include?(@extension)
            case @extension
            when ".tar.gz", ".tgz"
              return "gunzip -c '#{@file}' | '#{tar}' xf -"
            when ".zip"
              return "unzip '#{@file}' || 7za x -r -tzip -o'#{File.basename(@file, ".zip")}' '#{@file}'"
            end
          else
            return ':'
          end
        end
def extract ( tar ) if ARCHIVE_EXTENSIONS . include? ( @extension ) case @extension when ".tar.gz" , ".tgz" return "gunzip -c '#{@file}' | '#{tar}' xf -" when ".zip" return "unzip '#{@file}' || 7za x -r -tzip -o'#{File.basename(@file, ".zip")}' '#{@file}'" end else return ':' end end
Gets the command to extract the archive given if needed (uses @extension)
Gets the command to extract the archive given if needed ( uses @extension )
# Extension does not appear to be an archive
command to extract the source
command to extract the source
String, nil
[RuntimeError] an exception is raised if there is no known extraction method for @extension
[ RuntimeError ] an exception is raised if there is no known extraction method for @extension
tar
the tar command to use
the tar command to use