add docs. add fail statment
This commit is contained in:
parent
c44be45ce4
commit
1673677df0
|
@ -229,6 +229,8 @@ module GitHubChangelogGenerator
|
||||||
puts "Generated log placed in #{`pwd`.strip!}/#{output_filename}"
|
puts "Generated log placed in #{`pwd`.strip!}/#{output_filename}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# The full cycle of generation for whole project
|
||||||
|
# @return [String] The complete change log
|
||||||
def generate_log_for_all_tags
|
def generate_log_for_all_tags
|
||||||
fetch_tags_dates
|
fetch_tags_dates
|
||||||
|
|
||||||
|
@ -261,6 +263,7 @@ module GitHubChangelogGenerator
|
||||||
log
|
log
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Async fetching of all tags dates
|
||||||
def fetch_tags_dates
|
def fetch_tags_dates
|
||||||
if @options[:verbose]
|
if @options[:verbose]
|
||||||
print "Fetching tag dates...\r"
|
print "Fetching tag dates...\r"
|
||||||
|
@ -529,10 +532,13 @@ module GitHubChangelogGenerator
|
||||||
log
|
log
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Try to find tag date in local hash.
|
||||||
|
# Otherwise fFetch tag time and put it to local hash file.
|
||||||
|
# @param [String] tag_name name of the tag
|
||||||
|
# @param [Hash] tag_times_hash the hash of tag times
|
||||||
|
# @return [Time] time of specified tag
|
||||||
def get_time_of_tag(tag_name, tag_times_hash = @tag_times_hash)
|
def get_time_of_tag(tag_name, tag_times_hash = @tag_times_hash)
|
||||||
if tag_name.nil?
|
fail ChangelogGeneratorError, "tag_name is nil".red if tag_name.nil?
|
||||||
return nil
|
|
||||||
end
|
|
||||||
|
|
||||||
if tag_times_hash[tag_name["name"]]
|
if tag_times_hash[tag_name["name"]]
|
||||||
return @tag_times_hash[tag_name["name"]]
|
return @tag_times_hash[tag_name["name"]]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user