Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
06575c9ab2 | ||
|
|
aa88122d48 | ||
|
|
a69c2b5343 | ||
|
|
7fc862a100 | ||
|
|
87f95140d9 | ||
|
|
75ae6f4a3a | ||
|
|
31c13e8d1d | ||
|
|
a46fe7470b | ||
|
|
27fa9e8e02 | ||
|
|
b15f6b2837 | ||
|
|
0706f89c02 | ||
|
|
419e7e78ad | ||
|
|
6159ebba2f | ||
|
|
3a200e943c | ||
|
|
4dc5a094d2 | ||
|
|
07d52c9465 | ||
|
|
0b1f0319db |
12
CHANGELOG.md
12
CHANGELOG.md
@@ -1,5 +1,17 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
|
## [1.3.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.6) (2015-03-05)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.5...1.3.6)
|
||||||
|
|
||||||
|
## [1.3.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.5) (2015-03-04)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.4...1.3.5)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- Pull Requests in Wrong Tag [\#60](https://github.com/skywinder/Github-Changelog-Generator/issues/60)
|
||||||
|
|
||||||
## [1.3.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.4) (2015-03-03)
|
## [1.3.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.3.4) (2015-03-03)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.3...1.3.4)
|
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.3.3...1.3.4)
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|||||||
spec.email = %q{sky4winder+github_changelog_generator@gmail.com}
|
spec.email = %q{sky4winder+github_changelog_generator@gmail.com}
|
||||||
spec.date = `date +"%Y-%m-%d"`.strip!
|
spec.date = `date +"%Y-%m-%d"`.strip!
|
||||||
spec.summary = %q{Script, that automatically generate changelog from your tags, issues, labels and pull requests.}
|
spec.summary = %q{Script, that automatically generate changelog from your tags, issues, labels and pull requests.}
|
||||||
spec.description = %q{Script, that automatically generate changelog from your tags, issues, labels and pull requests.}
|
spec.description = %q{Changelog generation has never been so easy. Fully automate changelog generation - this gem generate change log file based on tags, issues and merged pull requests from Github issue tracker.}
|
||||||
spec.homepage = %q{https://github.com/skywinder/Github-Changelog-Generator}
|
spec.homepage = %q{https://github.com/skywinder/Github-Changelog-Generator}
|
||||||
spec.license = "MIT"
|
spec.license = "MIT"
|
||||||
|
|
||||||
|
|||||||
@@ -1,21 +1,17 @@
|
|||||||
# Change Log
|
# Change Log
|
||||||
|
|
||||||
## [v0.0.3](https://github.com/skywinder/changelog_test/tree/v0.0.3) (2015-03-04)
|
## [Unreleased](https://github.com/skywinder/changelog_test/tree/HEAD)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...v0.0.3)
|
[Full Changelog](https://github.com/skywinder/changelog_test/compare/v0.0.2...HEAD)
|
||||||
|
|
||||||
**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:**
|
**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))
|
- 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.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)
|
||||||
|
|
||||||
## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)
|
## [v0.0.1](https://github.com/skywinder/changelog_test/tree/v0.0.1) (2015-03-02)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -20,13 +20,7 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
@options = Parser.parse_options
|
@options = Parser.parse_options
|
||||||
|
|
||||||
if options[:verbose]
|
fetch_github_token
|
||||||
puts 'Input options:'
|
|
||||||
pp options
|
|
||||||
puts ''
|
|
||||||
end
|
|
||||||
|
|
||||||
github_token
|
|
||||||
|
|
||||||
github_options = {per_page: PER_PAGE_NUMBER}
|
github_options = {per_page: PER_PAGE_NUMBER}
|
||||||
github_options[:oauth_token] = @github_token unless @github_token.nil?
|
github_options[:oauth_token] = @github_token unless @github_token.nil?
|
||||||
@@ -113,11 +107,6 @@ module GitHubChangelogGenerator
|
|||||||
puts JSON.pretty_generate(json)
|
puts JSON.pretty_generate(json)
|
||||||
end
|
end
|
||||||
|
|
||||||
def exec_command(cmd)
|
|
||||||
exec_cmd = "cd #{$project_path} and #{cmd}"
|
|
||||||
%x[#{exec_cmd}]
|
|
||||||
end
|
|
||||||
|
|
||||||
def fetch_merged_at_pull_requests
|
def fetch_merged_at_pull_requests
|
||||||
if @options[:verbose]
|
if @options[:verbose]
|
||||||
print "Fetching merged dates...\r"
|
print "Fetching merged dates...\r"
|
||||||
@@ -240,7 +229,7 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
log = ''
|
log = ''
|
||||||
|
|
||||||
if @options[:unreleased]
|
if @options[:unreleased] && @all_tags.count != 0
|
||||||
unreleased_log = self.generate_log_between_tags(self.all_tags[0], nil)
|
unreleased_log = self.generate_log_between_tags(self.all_tags[0], nil)
|
||||||
if unreleased_log
|
if unreleased_log
|
||||||
log += unreleased_log
|
log += unreleased_log
|
||||||
@@ -250,8 +239,9 @@ module GitHubChangelogGenerator
|
|||||||
(1 ... self.all_tags.size).each { |index|
|
(1 ... self.all_tags.size).each { |index|
|
||||||
log += self.generate_log_between_tags(self.all_tags[index], self.all_tags[index-1])
|
log += self.generate_log_between_tags(self.all_tags[index], self.all_tags[index-1])
|
||||||
}
|
}
|
||||||
|
if @all_tags.count != 0
|
||||||
log += generate_log_between_tags(nil, self.all_tags.last)
|
log += generate_log_between_tags(nil, self.all_tags.last)
|
||||||
|
end
|
||||||
|
|
||||||
log
|
log
|
||||||
end
|
end
|
||||||
@@ -314,12 +304,8 @@ module GitHubChangelogGenerator
|
|||||||
tags
|
tags
|
||||||
end
|
end
|
||||||
|
|
||||||
def github_token
|
def fetch_github_token
|
||||||
if @options[:token]
|
env_var = @options[:token] ? @options[:token] : (ENV.fetch 'CHANGELOG_GITHUB_TOKEN', nil)
|
||||||
return @github_token ||= @options[:token]
|
|
||||||
end
|
|
||||||
|
|
||||||
env_var = ENV.fetch 'CHANGELOG_GITHUB_TOKEN', nil
|
|
||||||
|
|
||||||
unless env_var
|
unless env_var
|
||||||
puts "Warning: No token provided (-t option) and variable $CHANGELOG_GITHUB_TOKEN was not found.".yellow
|
puts "Warning: No token provided (-t option) and variable $CHANGELOG_GITHUB_TOKEN was not found.".yellow
|
||||||
@@ -389,7 +375,7 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
def delete_by_time(array, hash_key, older_tag = nil, newer_tag = nil)
|
def delete_by_time(array, hash_key, older_tag = nil, newer_tag = nil)
|
||||||
|
|
||||||
raise 'At least on of the tags should be not nil!' if (older_tag.nil? && newer_tag.nil?)
|
raise 'At least one of the tags should be not nil!' if (older_tag.nil? && newer_tag.nil?)
|
||||||
|
|
||||||
newer_tag_time = self.get_time_of_tag(newer_tag)
|
newer_tag_time = self.get_time_of_tag(newer_tag)
|
||||||
older_tag_time = self.get_time_of_tag(older_tag)
|
older_tag_time = self.get_time_of_tag(older_tag)
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ require_relative 'version'
|
|||||||
module GitHubChangelogGenerator
|
module GitHubChangelogGenerator
|
||||||
class Parser
|
class Parser
|
||||||
def self.parse_options
|
def self.parse_options
|
||||||
# :include_labels => %w(bug enhancement),
|
|
||||||
hash = {
|
options = {
|
||||||
:tag1 => nil,
|
:tag1 => nil,
|
||||||
:tag2 => nil,
|
:tag2 => nil,
|
||||||
:format => '%Y-%m-%d',
|
:format => '%Y-%m-%d',
|
||||||
@@ -26,9 +26,9 @@ module GitHubChangelogGenerator
|
|||||||
:filter_issues_by_milestone => true,
|
:filter_issues_by_milestone => true,
|
||||||
:compare_link => true,
|
:compare_link => true,
|
||||||
:unreleased => true,
|
:unreleased => true,
|
||||||
:unreleased_label => 'Unreleased'
|
:unreleased_label => 'Unreleased',
|
||||||
|
:branch => 'origin'
|
||||||
}
|
}
|
||||||
options = hash
|
|
||||||
|
|
||||||
parser = OptionParser.new { |opts|
|
parser = OptionParser.new { |opts|
|
||||||
opts.banner = 'Usage: github_changelog_generator [options]'
|
opts.banner = 'Usage: github_changelog_generator [options]'
|
||||||
@@ -130,11 +130,20 @@ module GitHubChangelogGenerator
|
|||||||
|
|
||||||
if !options[:user] && !options[:project]
|
if !options[:user] && !options[:project]
|
||||||
remote = `git remote -vv`.split("\n")
|
remote = `git remote -vv`.split("\n")
|
||||||
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)?(?:\.git).*/.match(remote[0])
|
# 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])
|
||||||
|
|
||||||
if match && match[1] && match[2]
|
if match && match[1] && match[2]
|
||||||
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
||||||
options[:user], options[:project] = match[1], 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])
|
||||||
|
if match && match[1] && match[2]
|
||||||
|
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
||||||
|
options[:user], options[:project] = match[1], match[2]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -149,6 +158,12 @@ module GitHubChangelogGenerator
|
|||||||
options[:tag2] = ARGV[1]
|
options[:tag2] = ARGV[1]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if options[:verbose]
|
||||||
|
puts 'Performing task with options:'
|
||||||
|
pp options
|
||||||
|
puts ''
|
||||||
|
end
|
||||||
|
|
||||||
options
|
options
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module GitHubChangelogGenerator
|
module GitHubChangelogGenerator
|
||||||
VERSION = '1.3.5'
|
VERSION = '1.3.8'
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user