Merge branch 'release/1.3.9'

This commit is contained in:
Petr Korolev 2015-03-06 16:47:30 +02:00
commit a35d08f6c7
5 changed files with 45 additions and 33 deletions

View File

@ -139,7 +139,7 @@ Here is a [wikipage list of alternatives](https://github.com/skywinder/Github-Ch
### Projects using this library
[Wikipage with list of projects](https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator)
*If you are using `github_changelog_generator` for generation change log in your project or know of project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
*If you are using `github_changelog_generator` for generation change log in your project or know another project that uses it, please add it to [this] (https://github.com/skywinder/Github-Changelog-Generator/wiki/Projects-using-Github-Changelog-Generator) list.*
## Am I missed some essential feature?

View File

@ -2,16 +2,28 @@
## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD)
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...HEAD)
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.3...HEAD)
**Merged pull requests:**
- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
- Add automatically generated change log file. [\#5](https://github.com/skywinder/changelog_test/pull/5) ([skywinder](https://github.com/skywinder))
## [v0.0.3](https://github.com/skywinder/changelog_test/tree/v0.0.3) (2015-03-04)
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...v0.0.3)
**Merged pull requests:**
- fix \#3. hotfix. Should appear in v0.0.3 [\#4](https://github.com/skywinder/changelog_test/pull/4) ([skywinder](https://github.com/skywinder))
## [v0.0.2](https://github.com/skywinder/changelog_test/tree/v0.0.2) (2015-03-04)
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.1...v0.0.2)
**Merged pull requests:**
- Here is a test hotfix should appear in v.0.0.2 [\#2](https://github.com/skywinder/changelog_test/pull/2) ([skywinder](https://github.com/skywinder))
## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)

View File

@ -593,11 +593,23 @@ module GitHubChangelogGenerator
end
# Async fetching events:
threads = []
fetch_events_async(@issues + @pull_requests)
#to clear line from prev print
print " \r"
if @options[:verbose]
puts 'Fetching events for issues and PR: Done!'
end
end
def fetch_events_async(issues)
i = 0
@issues.each { |issue|
max_thread_number = 50
threads = []
issues.each_slice(max_thread_number) { |issues_slice|
issues_slice.each { |issue|
threads << Thread.new {
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: issue['number']
issue[:events] = obj.body
@ -605,24 +617,9 @@ module GitHubChangelogGenerator
i +=1
}
}
@pull_requests.each { |pull_request|
threads << Thread.new {
obj = @github.issues.events.list user: @options[:user], repo: @options[:project], issue_number: pull_request['number']
pull_request[:events] = obj.body
print "Fetching events for issues and PR: #{i+1}/#{@issues.count + @pull_requests.count}\r"
i +=1
}
}
threads.each { |thr| thr.join }
#to clear line from prev print
print " \r"
if @options[:verbose]
puts "Fetching events for issues and PR: Done! #{i}/#{@issues.count + @pull_requests.count}"
end
threads = []
}
end
end

View File

@ -129,17 +129,20 @@ module GitHubChangelogGenerator
end
if !options[:user] && !options[:project]
remote = `git remote -vv`.split("\n")
# try to find repo in format: origin git@github.com:skywinder/Github-Changelog-Generator.git (fetch)
remote.select { |v| v.include? options[:branch] }
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)(?:\.git).*/.match(remote[0])
remote = `git config --get remote.#{options[:branch]}.url`
# try to find repo in format:
# origin git@github.com:skywinder/Github-Changelog-Generator.git (fetch)
# git@github.com:skywinder/Github-Changelog-Generator.git
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)(?:\.git).*/.match(remote)
if match && match[1] && match[2]
puts "Detected user:#{match[1]}, project:#{match[2]}"
options[:user], options[:project] = match[1], match[2]
else
# try to find repo in format: origin https://github.com/skywinder/ChangelogMerger (fetch)
match = /.*\/((?:-|\w|\.)*)\/((?:-|\w|\.)*).*/.match(remote[0])
# try to find repo in format:
# origin https://github.com/skywinder/ChangelogMerger (fetch)
# https://github.com/skywinder/ChangelogMerger
match = /.*\/((?:-|\w|\.)*)\/((?:-|\w|\.)*).*/.match(remote)
if match && match[1] && match[2]
puts "Detected user:#{match[1]}, project:#{match[2]}"
options[:user], options[:project] = match[1], match[2]

View File

@ -1,3 +1,3 @@
module GitHubChangelogGenerator
VERSION = '1.3.8'
VERSION = '1.3.9'
end