metafiles: convert Metafiles class to module
This commit is contained in:
parent
9628a613cf
commit
5b64fa6fb1
@ -1,6 +1,6 @@
|
|||||||
require "set"
|
require "set"
|
||||||
|
|
||||||
class Metafiles
|
module Metafiles
|
||||||
# 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
|
||||||
@ -11,12 +11,14 @@ class Metafiles
|
|||||||
news notes notice readme todo
|
news notes notice readme todo
|
||||||
].freeze
|
].freeze
|
||||||
|
|
||||||
def self.list?(file)
|
module_function
|
||||||
|
|
||||||
|
def list?(file)
|
||||||
return false if %w[.DS_Store INSTALL_RECEIPT.json].include?(file)
|
return false if %w[.DS_Store INSTALL_RECEIPT.json].include?(file)
|
||||||
!copy?(file)
|
!copy?(file)
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.copy?(file)
|
def copy?(file)
|
||||||
file = file.downcase
|
file = file.downcase
|
||||||
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user