github-changelog-generator/changelog_generator.rb

25 lines
500 B
Ruby
Raw Normal View History

2014-11-03 11:57:10 +00:00
#!/usr/bin/env ruby
# encoding: UTF-8
2014-11-04 16:42:13 +00:00
require_relative 'log_generator'
2014-11-05 11:27:28 +00:00
require_relative 'parser'
2014-11-03 11:57:10 +00:00
2014-11-05 11:27:28 +00:00
def run_generator options
generator = LogGenerator.new(options)
2014-11-03 11:57:10 +00:00
2014-11-05 11:27:28 +00:00
tag_time = generator.find_prev_tag_date
pull_requests = generator.get_all_closed_pull_requests
2014-11-03 11:57:10 +00:00
2014-11-04 17:45:10 +00:00
pull_requests.delete_if { |req|
t = Time.parse(req[:closed_at]).utc
t < tag_time
}
2014-11-03 11:57:10 +00:00
2014-11-04 17:45:10 +00:00
generator.compund_changelog(tag_time, pull_requests)
2014-11-05 11:27:28 +00:00
end
if __FILE__ == $0
options = Parser.new.options
run_generator(options)
2014-11-04 17:45:10 +00:00
end