Wrap in if __FILE__ == $0

This commit is contained in:
Petr Korolev 2014-11-04 19:45:10 +02:00
parent b3dfa00ec5
commit a52f961935

View File

@ -3,14 +3,16 @@
require_relative 'log_generator' require_relative 'log_generator'
generator = LogGenerator.new if __FILE__ == $0
generator = LogGenerator.new
tag_time = generator.findPrevTagDate tag_time = generator.findPrevTagDate
pull_requests = generator.getAllClosedPullRequests pull_requests = generator.getAllClosedPullRequests
pull_requests.delete_if { |req| pull_requests.delete_if { |req|
t = Time.parse(req[:closed_at]).utc t = Time.parse(req[:closed_at]).utc
t < tag_time t < tag_time
} }
generator.compund_changelog(tag_time, pull_requests) generator.compund_changelog(tag_time, pull_requests)
end