module Copywriter::Regex

Public Instance Methods

accepted_name?(filename) click to toggle source

Returns true if this is a file that we will update, (otherwise false).

@return [Boolean] True if name is accepted. False if otherwise.

# File lib/github-copywriter/regex.rb, line 17
def accepted_name?(filename)
    filename = File.basename(filename)

    names      = ["readme", "license"]
    extensions = [".md", ".txt", ".html"]

    if names.include?      filename.downcase               then return true end
    if extensions.include? File.extname(filename.downcase) then return true end

    return false
end