Merge pull request #8499 from Rylan12/copy-license-metafiles
metafiles: copy all license files
This commit is contained in:
commit
8d63afb13e
@ -4,15 +4,13 @@
|
|||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
module Metafiles
|
module Metafiles
|
||||||
|
LICENSES = Set.new(%w[copying copyright license licence]).freeze
|
||||||
# https://github.com/github/markup#markups
|
# https://github.com/github/markup#markups
|
||||||
EXTENSIONS = Set.new(%w[
|
EXTENSIONS = Set.new(%w[
|
||||||
.adoc .asc .asciidoc .creole .html .markdown .md .mdown .mediawiki .mkdn
|
.adoc .asc .asciidoc .creole .html .markdown .md .mdown .mediawiki .mkdn
|
||||||
.org .pod .rdoc .rst .rtf .textile .txt .wiki
|
.org .pod .rdoc .rst .rtf .textile .txt .wiki
|
||||||
]).freeze
|
]).freeze
|
||||||
BASENAMES = Set.new(%w[
|
BASENAMES = Set.new(%w[about authors changelog changes history news notes notice readme todo]).freeze
|
||||||
about authors changelog changes copying copyright history license licence
|
|
||||||
news notes notice readme todo
|
|
||||||
]).freeze
|
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
@ -24,6 +22,8 @@ module Metafiles
|
|||||||
|
|
||||||
def copy?(file)
|
def copy?(file)
|
||||||
file = file.downcase
|
file = file.downcase
|
||||||
|
return true if LICENSES.include? file.split(".").first
|
||||||
|
|
||||||
ext = File.extname(file)
|
ext = File.extname(file)
|
||||||
file = File.basename(file, ext) if EXTENSIONS.include?(ext)
|
file = File.basename(file, ext) if EXTENSIONS.include?(ext)
|
||||||
BASENAMES.include?(file)
|
BASENAMES.include?(file)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user