Skip to content
This repository
branch: master
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 39 lines (31 sloc) 0.714 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
class Metafiles

  def initialize
    @exts = %w[.md .html .rtf .txt]
    @metafiles = %w[
about authors changelog changes copying copyright history license
licence news notes notice readme todo]
  end

  def + other
    @metafiles + other
  end

  def should_copy? file
    include? file
  end

  def should_list? file
    return false if %w[.DS_Store INSTALL_RECEIPT.json].include? file
    not include? file
  end

  private

  def include? p
    p = p.to_s # Might be a pathname
    p = p.downcase
    path = Pathname.new(p)
    if @exts.include? path.extname
      p = path.basename(path.extname)
    else
      p = path.basename
    end
    p = p.to_s
    return @metafiles.include? p
  end

end
Something went wrong with that request. Please try again.