brew/Library/Homebrew/metafiles.rb

24 lines
658 B
Ruby
Raw Normal View History

class Metafiles
# https://github.com/github/markup#markups
EXTENSIONS = %w[
.adoc .asc .asciidoc .creole .html .markdown .md .mdown .mediawiki .mkdn
.org .pod .rdoc .rst .rtf .textile .txt .wiki
].freeze
2014-06-07 17:45:13 -05:00
BASENAMES = %w[
about authors changelog changes copying copyright history license licence
news notes notice readme todo
].freeze
2014-06-07 17:49:07 -05:00
def self.list?(file)
return false if %w[.DS_Store INSTALL_RECEIPT.json].include?(file)
!copy?(file)
end
2014-06-07 23:40:26 -05:00
def self.copy?(file)
file = file.downcase
ext = File.extname(file)
file = File.basename(file, ext) if EXTENSIONS.include?(ext)
BASENAMES.include?(file)
end
end