Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
99d20bd8a9 | ||
|
|
f0e713d6ef | ||
|
|
8dc50cf483 | ||
|
|
90c455ada4 | ||
|
|
088824aa05 | ||
|
|
96977c8384 | ||
|
|
1940974c4c | ||
|
|
1fced7278e | ||
|
|
eb9bd59f26 | ||
|
|
41f43932e0 | ||
|
|
4ba7bbcc90 | ||
|
|
8505d340af | ||
|
|
f3c05bd01c | ||
|
|
4bcf49175b | ||
|
|
6c28db6d4a | ||
|
|
6f8aee6a4b | ||
|
|
3e3cc15592 | ||
|
|
d5edb1f606 | ||
|
|
e6d0c3d791 | ||
|
|
c1d28d486f | ||
|
|
fa713af816 | ||
|
|
17f7127de1 | ||
|
|
e1a264e2c9 | ||
|
|
e4b79e75ca | ||
|
|
c7a767451d | ||
|
|
01f44b8311 | ||
|
|
c0015a2c22 | ||
|
|
49cb6589f7 | ||
|
|
e139f839c9 | ||
|
|
a7a75a181e | ||
|
|
6efa421816 | ||
|
|
e8d59fe66a | ||
|
|
6b5cf5ab2e | ||
|
|
de6763aa3a | ||
|
|
5f019482d2 | ||
|
|
6da115c4b0 | ||
|
|
657ce0e838 | ||
|
|
5304e4faf8 | ||
|
|
e6bb728355 | ||
|
|
135c48a494 | ||
|
|
6bad92e899 | ||
|
|
ad4c20d8d8 | ||
|
|
a5d9766aef | ||
|
|
a0cfaa66a2 | ||
|
|
d16f4f7cb5 | ||
|
|
1d6d6ab400 | ||
|
|
5b07fc9614 | ||
|
|
3437fbf278 | ||
|
|
ba4db0e5f4 | ||
|
|
abac1013f1 | ||
|
|
28247edc7f |
75
CHANGELOG.md
75
CHANGELOG.md
@@ -1,16 +1,57 @@
|
||||
# Changelog
|
||||
|
||||
## [1.2.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2)
|
||||
## [1.2.6](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.6)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.5...1.2.6)
|
||||
#### 21/01/15
|
||||
- *Merged pull-request:* fix link tag format [\#45](https://github.com/skywinder/Github-Changelog-Generator/pull/45) ([sugamasao](https://github.com/sugamasao))
|
||||
|
||||
## [1.2.5](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.5)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.4...1.2.5)
|
||||
#### 15/01/15
|
||||
- *Merged pull-request:* PrettyPrint class is included using lowercase 'pp' [\#43](https://github.com/skywinder/Github-Changelog-Generator/pull/43) ([schwing](https://github.com/schwing))
|
||||
|
||||
- *Merged pull-request:* support enterprise github via command line options [\#42](https://github.com/skywinder/Github-Changelog-Generator/pull/42) ([glenlovett](https://github.com/glenlovett))
|
||||
|
||||
- *Implemented enhancement:* Use milestone to specify in which version bug was fixed [\#22](https://github.com/skywinder/Github-Changelog-Generator/issues/22)
|
||||
|
||||
- *Fixed bug:* Error when trying to generate log for repo without tags [\#32](https://github.com/skywinder/Github-Changelog-Generator/issues/32)
|
||||
|
||||
## [1.2.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.4)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.3...1.2.4)
|
||||
#### 16/12/14
|
||||
- *Merged pull-request:* Fix crash when user is NULL [\#40](https://github.com/skywinder/Github-Changelog-Generator/pull/40) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Merged pull-request:* Implement async fetching [\#39](https://github.com/skywinder/Github-Changelog-Generator/pull/39) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Implemented enhancement:* Add ability to run with one parameter instead -u -p [\#38](https://github.com/skywinder/Github-Changelog-Generator/issues/38)
|
||||
|
||||
- *Implemented enhancement:* Detailed output [\#33](https://github.com/skywinder/Github-Changelog-Generator/issues/33)
|
||||
|
||||
- *Fixed bug:* Docs lacking or basic behavior not as advertised [\#30](https://github.com/skywinder/Github-Changelog-Generator/issues/30)
|
||||
|
||||
- *Fixed bug:* Crash when try generate log for rails [\#35](https://github.com/skywinder/Github-Changelog-Generator/issues/35)
|
||||
|
||||
## [1.2.3](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.3)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.2...1.2.3)
|
||||
#### 16/12/14
|
||||
## [1.2.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.2)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.1...1.2.2)
|
||||
#### 10/12/14
|
||||
- *Merged pull-request:* Add a Bitdeli Badge to README [\#36](https://github.com/skywinder/Github-Changelog-Generator/pull/36) ([bitdeli-chef](https://github.com/bitdeli-chef))
|
||||
|
||||
## [1.2.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1)
|
||||
- *Fixed bug:* Encapsulate \[ \> \* \_ \ \] signs in issues names [\#34](https://github.com/skywinder/Github-Changelog-Generator/issues/34)
|
||||
|
||||
## [1.2.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.1)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.2.0...1.2.1)
|
||||
#### 22/11/14
|
||||
- *Merged pull-request:* Issues for last tag not in list [\#29](https://github.com/skywinder/Github-Changelog-Generator/pull/29) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Merged pull-request:* Disable default --filter-pull-requests option. [\#28](https://github.com/skywinder/Github-Changelog-Generator/pull/28) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.2.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0)
|
||||
- *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20)
|
||||
|
||||
## [1.2.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.2.0)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.4...1.2.0)
|
||||
#### 19/11/14
|
||||
- *Merged pull-request:* Add filter for pull-requests labels. \(option --filter-pull-requests\) [\#27](https://github.com/skywinder/Github-Changelog-Generator/pull/27) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
@@ -20,21 +61,22 @@
|
||||
|
||||
- *Merged pull-request:* Don't receive issues in case of --no-isses flag specied [\#24](https://github.com/skywinder/Github-Changelog-Generator/pull/24) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.1.4] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4)
|
||||
## [1.1.4](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.4)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.2...1.1.4)
|
||||
#### 18/11/14
|
||||
- *Merged pull-request:* Sort tags by date [\#23](https://github.com/skywinder/Github-Changelog-Generator/pull/23) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Implemented enhancement:* Implement ability to retrieve GitHub token from ENV variable \(to not put it to script directly\) [\#19](https://github.com/skywinder/Github-Changelog-Generator/issues/19)
|
||||
|
||||
- *Fixed bug:* Script fills changelog only for first 30 tags. [\#20](https://github.com/skywinder/Github-Changelog-Generator/issues/20)
|
||||
|
||||
## [1.1.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2)
|
||||
## [1.1.2](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.2)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.1...1.1.2)
|
||||
#### 12/11/14
|
||||
- *Merged pull-request:* Fix bug with dot signs in project name [\#18](https://github.com/skywinder/Github-Changelog-Generator/pull/18) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Merged pull-request:* Fix bug with dot signs in user name [\#17](https://github.com/skywinder/Github-Changelog-Generator/pull/17) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.1.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1)
|
||||
## [1.1.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.1)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.1.0...1.1.1)
|
||||
#### 10/11/14
|
||||
- *Merged pull-request:* Remove duplicates of issues and pull-requests with same number [\#15](https://github.com/skywinder/Github-Changelog-Generator/pull/15) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
@@ -42,7 +84,8 @@
|
||||
|
||||
- *Merged pull-request:* Add ability to add or exclude issues without any labels [\#13](https://github.com/skywinder/Github-Changelog-Generator/pull/13) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.1.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0)
|
||||
## [1.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.1.0)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.1...1.1.0)
|
||||
#### 10/11/14
|
||||
- *Implemented enhancement:* Detect username and project form origin [\#11](https://github.com/skywinder/Github-Changelog-Generator/issues/11)
|
||||
|
||||
@@ -50,11 +93,13 @@
|
||||
|
||||
- *Fixed bug:* Bug with wrong credentials in 1.0.1 [\#12](https://github.com/skywinder/Github-Changelog-Generator/issues/12)
|
||||
|
||||
## [1.0.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1)
|
||||
## [1.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.1)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/1.0.0...1.0.1)
|
||||
#### 10/11/14
|
||||
- *Merged pull-request:* Implement support of different tags. [\#8](https://github.com/skywinder/Github-Changelog-Generator/pull/8) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [1.0.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0)
|
||||
## [1.0.0](https://github.com/skywinder/Github-Changelog-Generator/tree/1.0.0)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.1.0...1.0.0)
|
||||
#### 07/11/14
|
||||
- *Merged pull-request:* Add support for issues in CHANGELOG [\#7](https://github.com/skywinder/Github-Changelog-Generator/pull/7) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
@@ -66,15 +111,17 @@
|
||||
|
||||
- *Fixed bug:* Last tag not appeared in changelog [\#5](https://github.com/skywinder/Github-Changelog-Generator/issues/5)
|
||||
|
||||
## [0.1.0] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0)
|
||||
## [0.1.0](https://github.com/skywinder/Github-Changelog-Generator/tree/0.1.0)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.2...0.1.0)
|
||||
#### 07/11/14
|
||||
- *Merged pull-request:* Add changelog generation for last tag [\#2](https://github.com/skywinder/Github-Changelog-Generator/pull/2) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
- *Merged pull-request:* Add option \(-o --output\) to specify name of the output file. [\#1](https://github.com/skywinder/Github-Changelog-Generator/pull/1) ([skywinder](https://github.com/skywinder))
|
||||
|
||||
## [0.0.2] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2)
|
||||
## [0.0.2](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.2)
|
||||
[Full Changelog](https://github.com/skywinder/Github-Changelog-Generator/compare/0.0.1...0.0.2)
|
||||
#### 06/11/14
|
||||
## [0.0.1] (https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1)
|
||||
## [0.0.1](https://github.com/skywinder/Github-Changelog-Generator/tree/0.0.1)
|
||||
#### 06/11/14
|
||||
|
||||
|
||||
|
||||
10
README.md
10
README.md
@@ -16,15 +16,15 @@ You're almost done!
|
||||
## Usage
|
||||
**It's really simple**:
|
||||
|
||||
- If your **git remote** `origin` refer to your GitHub repo, then just go to your project folder just run:
|
||||
- If your **git remote** `origin` refer to your GitHub repo, then just go to your project folder and run:
|
||||
|
||||
github_changelog_generator
|
||||
|
||||
- or from anywhere:
|
||||
|
||||
github_changelog_generator -u github-username -p github-project
|
||||
github_changelog_generator -u github_username -p github_project
|
||||
|
||||
As output you will get `CHANGELOG.md` file with *pretty Markdown-formatted* changelog.
|
||||
As output you will get `CHANGELOG.md` file with pretty *Markdown-formatted* changelog.
|
||||
|
||||
### Params:
|
||||
Type `github_changelog_generator --help` for detailed usage.
|
||||
@@ -57,7 +57,9 @@ And:
|
||||
- Run with key `-t [your-16-digit-token]`
|
||||
- Or set environment variable `CHANGELOG_GITHUB_TOKEN` and specify there your token.
|
||||
|
||||
i.e. add to your `~/.bash_profile` or `~/.zshrc` or any other place to load ENV variables string `export CHANGELOG_GITHUB_TOKEN="your-40-digit-github-token"'`
|
||||
i.e. add to your `~/.bash_profile` or `~/.zshrc` or any other place to load ENV variables string :
|
||||
|
||||
export CHANGELOG_GITHUB_TOKEN="your-40-digit-github-token"
|
||||
|
||||
So, if you got error like this:
|
||||
>! /Library/Ruby/Gems/2.0.0/gems/github_api-0.12.2/lib/github_api/response/raise_error.rb:14:in `on_complete'
|
||||
|
||||
@@ -28,12 +28,12 @@ module GitHubChangelogGenerator
|
||||
|
||||
github_token
|
||||
|
||||
if @github_token.nil?
|
||||
@github = Github.new per_page: PER_PAGE_NUMBER
|
||||
else
|
||||
@github = Github.new oauth_token: @github_token,
|
||||
per_page: PER_PAGE_NUMBER
|
||||
end
|
||||
github_options = {per_page: PER_PAGE_NUMBER}
|
||||
github_options[:oauth_token] = @github_token unless @github_token.nil?
|
||||
github_options[:endpoint] = options[:github_endpoint] unless options[:github_endpoint].nil?
|
||||
github_options[:site] = options[:github_endpoint] unless options[:github_site].nil?
|
||||
|
||||
@github = Github.new github_options
|
||||
|
||||
@generator = Generator.new(@options)
|
||||
|
||||
@@ -231,19 +231,63 @@ module GitHubChangelogGenerator
|
||||
|
||||
def generate_log_between_tags(older_tag, newer_tag)
|
||||
|
||||
if newer_tag.nil?
|
||||
puts "Can't find tag -> terminate"
|
||||
exit 1
|
||||
end
|
||||
|
||||
newer_tag_time = self.get_time_of_tag(newer_tag)
|
||||
newer_tag_name = newer_tag['name']
|
||||
|
||||
if older_tag.nil?
|
||||
older_tag_name = nil
|
||||
filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time)
|
||||
filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time)
|
||||
else
|
||||
older_tag_time = self.get_time_of_tag(older_tag)
|
||||
older_tag_name = older_tag['name']
|
||||
filtered_pull_requests = delete_by_time(@pull_requests, :merged_at, newer_tag_time, older_tag_time)
|
||||
filtered_issues = delete_by_time(@issues, :closed_at, newer_tag_time, older_tag_time)
|
||||
end
|
||||
|
||||
self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time)
|
||||
|
||||
if @options[:filter_issues_by_milestone]
|
||||
#delete excess irrelevant issues (according milestones)
|
||||
filtered_issues.select! { |issue|
|
||||
if issue.milestone.nil?
|
||||
true
|
||||
else
|
||||
#check, that this milestone in tag list:
|
||||
milestone_is_tag = @all_tags.find { |tag|
|
||||
tag.name == issue.milestone.title
|
||||
}
|
||||
milestone_is_tag.nil?
|
||||
end
|
||||
|
||||
}
|
||||
|
||||
#add missed issues (according milestones)
|
||||
issues_to_add = @issues.select { |issue|
|
||||
if issue.milestone.nil?
|
||||
false
|
||||
else
|
||||
#check, that this milestone in tag list:
|
||||
milestone_is_tag = @all_tags.find { |tag|
|
||||
tag.name == issue.milestone.title
|
||||
}
|
||||
|
||||
if milestone_is_tag.nil?
|
||||
false
|
||||
else
|
||||
issue.milestone.title == newer_tag_name
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
filtered_issues |= issues_to_add
|
||||
end
|
||||
|
||||
self.create_log(filtered_pull_requests, filtered_issues, newer_tag_name, newer_tag_time, older_tag_name)
|
||||
|
||||
end
|
||||
|
||||
@@ -269,18 +313,28 @@ module GitHubChangelogGenerator
|
||||
}
|
||||
end
|
||||
|
||||
# @param [Array] pull_requests
|
||||
# @param [Array] issues
|
||||
# @param [String] tag_name
|
||||
# @param [String] tag_time
|
||||
# @return [String]
|
||||
def create_log(pull_requests, issues, tag_name, tag_time)
|
||||
# @param [Array] pull_requests
|
||||
# @param [Array] issues
|
||||
# @param [String] newer_tag_name
|
||||
# @param [String] newer_tag_time
|
||||
# @param [String] older_tag_name
|
||||
# @return [String]
|
||||
def create_log(pull_requests, issues, newer_tag_name, newer_tag_time, older_tag_name = nil)
|
||||
|
||||
github_site = options[:github_site] || 'https://github.com'
|
||||
|
||||
project_url = "#{github_site}/#{@options[:user]}/#{@options[:project]}"
|
||||
|
||||
# Generate tag name and link
|
||||
log = "## [#{tag_name}] (https://github.com/#{@options[:user]}/#{@options[:project]}/tree/#{tag_name})\n"
|
||||
log = "## [#{newer_tag_name}](#{project_url}/tree/#{newer_tag_name})\n"
|
||||
|
||||
if @options[:compare_link] && older_tag_name
|
||||
# Generate compare link
|
||||
log += "[Full Changelog](#{project_url}/compare/#{older_tag_name}...#{newer_tag_name})\n"
|
||||
end
|
||||
|
||||
#Generate date string:
|
||||
time_string = tag_time.strftime @options[:format]
|
||||
time_string = newer_tag_time.strftime @options[:format]
|
||||
log += "#### #{time_string}\n"
|
||||
|
||||
if @options[:pulls]
|
||||
|
||||
@@ -10,10 +10,10 @@ module GitHubChangelogGenerator
|
||||
|
||||
merge = "#{@options[:merge_prefix]}#{encapsulated_title} [\\##{pull_request[:number]}](#{pull_request.html_url})"
|
||||
if @options[:author]
|
||||
if !pull_request.user.nil?
|
||||
merge += " ([#{pull_request.user.login}](#{pull_request.user.html_url}))\n\n"
|
||||
else
|
||||
if pull_request.user.nil?
|
||||
merge += " ({Null user})\n\n"
|
||||
else
|
||||
merge += " ([#{pull_request.user.login}](#{pull_request.user.html_url}))\n\n"
|
||||
end
|
||||
else
|
||||
merge += "\n\n"
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'optparse'
|
||||
require 'PP'
|
||||
require 'pp'
|
||||
require_relative 'version'
|
||||
|
||||
module GitHubChangelogGenerator
|
||||
class Parser
|
||||
def self.parse_options
|
||||
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil}
|
||||
options = {:tag1 => nil, :tag2 => nil, :format => '%d/%m/%y', :output => 'CHANGELOG.md', :labels => %w(bug enhancement), :pulls => true, :issues => true, :verbose => true, :add_issues_wo_labels => true, :merge_prefix => '*Merged pull-request:* ', :author => true, :pull_request_labels => nil, :filter_issues_by_milestone => true, :compare_link => true}
|
||||
|
||||
parser = OptionParser.new { |opts|
|
||||
opts.banner = 'Usage: changelog_generator [options]'
|
||||
@@ -37,15 +37,27 @@ module GitHubChangelogGenerator
|
||||
opts.on('--[no-]pull-requests', 'Include pull-requests to changelog. Default is true') do |v|
|
||||
options[:pulls] = v
|
||||
end
|
||||
opts.on('--[no-]filter-issues-by-milestone', 'Use milestone to detect when issue was resolved. Default is true') do |last|
|
||||
options[:filter_issues_by_milestone] = last
|
||||
end
|
||||
opts.on('--[no-]author', 'Add author of pull-request in the end. Default is true') do |author|
|
||||
options[:last] = author
|
||||
end
|
||||
opts.on('--[no-]compare-link', 'Include compare link between older version and newer version. Default is true') do |v|
|
||||
options[:compare_link] = v
|
||||
end
|
||||
opts.on('--labels x,y,z', Array, 'Issues with that labels will be included to changelog. Default is \'bug,enhancement\'') do |list|
|
||||
options[:labels] = list
|
||||
end
|
||||
opts.on('--labels-pr x,y,z', Array, 'Only pull requests with specified labels will be included to changelog. Default is nil') do |list|
|
||||
options[:pull_request_labels] = list
|
||||
end
|
||||
opts.on('--github-site [URL]', 'The Enterprise Github site on which your project is hosted.') do |last|
|
||||
options[:github_site] = last
|
||||
end
|
||||
opts.on('--github-api [URL]', 'The enterprise endpoint to use for your Github API.') do |last|
|
||||
options[:github_endpoint] = last
|
||||
end
|
||||
opts.on('-v', '--version', 'Print version number') do |v|
|
||||
puts "Version: #{GitHubChangelogGenerator::VERSION}"
|
||||
exit
|
||||
@@ -59,8 +71,9 @@ module GitHubChangelogGenerator
|
||||
parser.parse!
|
||||
|
||||
if ARGV[0] && !ARGV[1]
|
||||
github_site = options[:github_site] ? options[:github_site] : 'github.com'
|
||||
# this match should parse https://github.com/skywinder/Github-Changelog-Generator and skywinder/Github-Changelog-Generator to user and name
|
||||
match = /(?:.+github\.com\/)?(.+)\/(.+)/.match(ARGV[0])
|
||||
match = /(?:.+#{Regexp.escape(github_site)}\/)?(.+)\/(.+)/.match(ARGV[0])
|
||||
|
||||
if match[2].nil?
|
||||
exit
|
||||
@@ -72,7 +85,7 @@ module GitHubChangelogGenerator
|
||||
|
||||
if !options[:user] && !options[:project]
|
||||
remote = `git remote -vv`.split("\n")
|
||||
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)(?:\.git)?.*/.match(remote[0])
|
||||
match = /.*(?:[:\/])((?:-|\w|\.)*)\/((?:-|\w|\.)*)?(?:\.git).*/.match(remote[0])
|
||||
|
||||
if match && match[1] && match[2]
|
||||
puts "Detected user:#{match[1]}, project:#{match[2]}"
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
module GitHubChangelogGenerator
|
||||
VERSION = '1.2.3'
|
||||
VERSION = '1.2.7'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user