This commit is contained in:
Adam
2016-03-24 12:22:33 +00:00
parent e5a619b167
commit 6a0ade1194
3 changed files with 8 additions and 34 deletions

View File

@@ -129,12 +129,12 @@ module GitHubChangelogGenerator
end
# @param [Array] all_tags all tags
# @return [Array] filtered tags according :exclude_tags option
# @return [Array] filtered tags according :exclude_tags or :exclude_tags_regex option
def filter_excluded_tags(all_tags)
if @options[:exclude_tags]
apply_exclude_tags(all_tags)
elsif @options[:exclude_tags_regex]
apply_exclude_tags_regex(all_tags)
if (@options[:exclude_tags].is_a?(Regexp) || @options[:exclude_tags_regex])
filter_tags_with_regex(all_tags)
elsif @options[:exclude_tags]
filter_exact_tags(all_tags)
else
all_tags
end
@@ -142,18 +142,6 @@ module GitHubChangelogGenerator
private
def apply_exclude_tags(all_tags)
if @options[:exclude_tags].is_a?(Regexp)
filter_tags_with_regex(all_tags)
else
filter_exact_tags(all_tags)
end
end
def apply_exclude_tags_regex(all_tags)
filter_tags_with_regex(all_tags)
end
def filter_tags_with_regex(all_tags)
warn_if_nonmatching_regex(all_tags)