Merge branch 'hotfix/update-changelog' into develop
This commit is contained in:
commit
b08f881fb1
24
CHANGELOG.md
24
CHANGELOG.md
|
@ -1,5 +1,29 @@
|
|||
# Change Log
|
||||
|
||||
## [1.13.1](https://github.com/skywinder/github-changelog-generator/tree/1.13.1) (2016-07-22)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.13.0...1.13.1)
|
||||
|
||||
**Implemented enhancements:**
|
||||
|
||||
- Don't constrain runtime deps. [\#400](https://github.com/skywinder/github-changelog-generator/pull/400) ([jkeiser](https://github.com/jkeiser))
|
||||
|
||||
**Fixed bugs:**
|
||||
|
||||
- `--user` flag should not be ignored [\#397](https://github.com/skywinder/github-changelog-generator/issues/397)
|
||||
- GHE not working with --github-site set to an enterprise site [\#395](https://github.com/skywinder/github-changelog-generator/issues/395)
|
||||
|
||||
**Closed issues:**
|
||||
|
||||
- Contributors Section [\#398](https://github.com/skywinder/github-changelog-generator/issues/398)
|
||||
|
||||
**Merged pull requests:**
|
||||
|
||||
- Ability to implicity set user and project from command line [\#401](https://github.com/skywinder/github-changelog-generator/pull/401) ([skywinder](https://github.com/skywinder))
|
||||
- Show how to use it with Rakefile [\#399](https://github.com/skywinder/github-changelog-generator/pull/399) ([edusantana](https://github.com/edusantana))
|
||||
- Adds documentation on using a GHE endpoint [\#396](https://github.com/skywinder/github-changelog-generator/pull/396) ([cormacmccarthy](https://github.com/cormacmccarthy))
|
||||
- Rake task usage: Added a missing option exclude\_tags\_regex [\#393](https://github.com/skywinder/github-changelog-generator/pull/393) ([perlun](https://github.com/perlun))
|
||||
- Parser: YARD docstrings and a rename, and RegExp named capture groups [\#391](https://github.com/skywinder/github-changelog-generator/pull/391) ([olleolleolle](https://github.com/olleolleolle))
|
||||
|
||||
## [1.13.0](https://github.com/skywinder/github-changelog-generator/tree/1.13.0) (2016-07-04)
|
||||
[Full Changelog](https://github.com/skywinder/github-changelog-generator/compare/1.12.1...1.13.0)
|
||||
|
||||
|
|
2
Gemfile
2
Gemfile
|
@ -10,4 +10,6 @@ group :test do
|
|||
gem "coveralls", "~>0.8", require: false
|
||||
gem "simplecov", "~>0.10", require: false
|
||||
gem "codeclimate-test-reporter", "~>0.4"
|
||||
# JSON 2.0.1 is ruby 2.0+
|
||||
gem "json", "< 2.0"
|
||||
end
|
||||
|
|
76
Gemfile.lock
76
Gemfile.lock
|
@ -1,24 +1,24 @@
|
|||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
github_changelog_generator (1.13.0)
|
||||
colorize (~> 0.7)
|
||||
github_api (~> 0.12)
|
||||
github_changelog_generator (1.13.1)
|
||||
colorize (>= 0.7)
|
||||
github_api (>= 0.12)
|
||||
rake (>= 10.0)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
addressable (2.4.0)
|
||||
ast (2.2.0)
|
||||
ast (2.3.0)
|
||||
childprocess (0.5.9)
|
||||
ffi (~> 1.0, >= 1.0.11)
|
||||
codeclimate-test-reporter (0.5.0)
|
||||
codeclimate-test-reporter (0.6.0)
|
||||
simplecov (>= 0.7.1, < 1.0.0)
|
||||
colorize (0.7.7)
|
||||
coveralls (0.8.13)
|
||||
json (~> 1.8)
|
||||
simplecov (~> 0.11.0)
|
||||
colorize (0.8.1)
|
||||
coveralls (0.8.14)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov (~> 0.12.0)
|
||||
term-ansicolor (~> 1.3)
|
||||
thor (~> 0.19.1)
|
||||
tins (~> 1.6.0)
|
||||
|
@ -28,59 +28,58 @@ GEM
|
|||
docile (1.1.5)
|
||||
faraday (0.9.2)
|
||||
multipart-post (>= 1.2, < 3)
|
||||
ffi (1.9.10)
|
||||
github_api (0.13.1)
|
||||
ffi (1.9.14)
|
||||
github_api (0.14.4)
|
||||
addressable (~> 2.4.0)
|
||||
descendants_tracker (~> 0.0.4)
|
||||
faraday (~> 0.8, < 0.10)
|
||||
hashie (>= 3.4)
|
||||
multi_json (>= 1.7.5, < 2.0)
|
||||
oauth2
|
||||
oauth2 (~> 1.0.0)
|
||||
hashie (3.4.4)
|
||||
iniparse (1.4.2)
|
||||
json (1.8.3)
|
||||
jwt (1.5.1)
|
||||
multi_json (1.12.0)
|
||||
jwt (1.5.4)
|
||||
multi_json (1.12.1)
|
||||
multi_xml (0.5.5)
|
||||
multipart-post (2.0.0)
|
||||
oauth2 (1.1.0)
|
||||
oauth2 (1.0.0)
|
||||
faraday (>= 0.8, < 0.10)
|
||||
jwt (~> 1.0, < 1.5.2)
|
||||
jwt (~> 1.0)
|
||||
multi_json (~> 1.3)
|
||||
multi_xml (~> 0.5)
|
||||
rack (>= 1.2, < 3)
|
||||
overcommit (0.33.0)
|
||||
rack (~> 1.2)
|
||||
overcommit (0.34.2)
|
||||
childprocess (~> 0.5.8)
|
||||
iniparse (~> 1.4)
|
||||
parser (2.3.1.0)
|
||||
parser (2.3.1.2)
|
||||
ast (~> 2.2)
|
||||
powerpack (0.1.1)
|
||||
rack (1.6.4)
|
||||
rainbow (2.1.0)
|
||||
rake (11.1.2)
|
||||
rspec (3.4.0)
|
||||
rspec-core (~> 3.4.0)
|
||||
rspec-expectations (~> 3.4.0)
|
||||
rspec-mocks (~> 3.4.0)
|
||||
rspec-core (3.4.4)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-expectations (3.4.0)
|
||||
rake (11.2.2)
|
||||
rspec (3.5.0)
|
||||
rspec-core (~> 3.5.0)
|
||||
rspec-expectations (~> 3.5.0)
|
||||
rspec-mocks (~> 3.5.0)
|
||||
rspec-core (3.5.1)
|
||||
rspec-support (~> 3.5.0)
|
||||
rspec-expectations (3.5.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-mocks (3.4.1)
|
||||
rspec-support (~> 3.5.0)
|
||||
rspec-mocks (3.5.0)
|
||||
diff-lcs (>= 1.2.0, < 2.0)
|
||||
rspec-support (~> 3.4.0)
|
||||
rspec-support (3.4.1)
|
||||
rubocop (0.39.0)
|
||||
parser (>= 2.3.0.7, < 3.0)
|
||||
rspec-support (~> 3.5.0)
|
||||
rspec-support (3.5.0)
|
||||
rubocop (0.41.2)
|
||||
parser (>= 2.3.1.1, < 3.0)
|
||||
powerpack (~> 0.1)
|
||||
rainbow (>= 1.99.1, < 3.0)
|
||||
ruby-progressbar (~> 1.7)
|
||||
unicode-display_width (~> 1.0, >= 1.0.1)
|
||||
ruby-progressbar (1.8.0)
|
||||
simplecov (0.11.2)
|
||||
ruby-progressbar (1.8.1)
|
||||
simplecov (0.12.0)
|
||||
docile (~> 1.1.0)
|
||||
json (~> 1.8)
|
||||
json (>= 1.8, < 3)
|
||||
simplecov-html (~> 0.10.0)
|
||||
simplecov-html (0.10.0)
|
||||
term-ansicolor (1.3.2)
|
||||
|
@ -88,7 +87,7 @@ GEM
|
|||
thor (0.19.1)
|
||||
thread_safe (0.3.5)
|
||||
tins (1.6.0)
|
||||
unicode-display_width (1.0.5)
|
||||
unicode-display_width (1.1.0)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
@ -98,6 +97,7 @@ DEPENDENCIES
|
|||
codeclimate-test-reporter (~> 0.4)
|
||||
coveralls (~> 0.8)
|
||||
github_changelog_generator!
|
||||
json (< 2.0)
|
||||
overcommit
|
||||
rake
|
||||
rspec (>= 3.2)
|
||||
|
|
|
@ -24,11 +24,11 @@ Gem::Specification.new do |spec|
|
|||
spec.require_paths = ["lib"]
|
||||
|
||||
spec.add_runtime_dependency "rake", ">= 10.0"
|
||||
spec.add_runtime_dependency("github_api", ["~> 0.12"])
|
||||
spec.add_runtime_dependency("colorize", ["~> 0.7"])
|
||||
spec.add_runtime_dependency "github_api", ">= 0.12"
|
||||
spec.add_runtime_dependency "colorize", ">= 0.7"
|
||||
|
||||
spec.add_development_dependency("overcommit", ">= 0.31")
|
||||
spec.add_development_dependency("rspec", ">= 3.2")
|
||||
spec.add_development_dependency "overcommit", ">= 0.31"
|
||||
spec.add_development_dependency "rspec", ">= 3.2"
|
||||
spec.add_development_dependency "bundler", ">= 1.7"
|
||||
spec.add_development_dependency("rubocop", ">= 0.31")
|
||||
spec.add_development_dependency "rubocop", ">= 0.31"
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ module GitHubChangelogGenerator
|
|||
parser = setup_parser(options)
|
||||
parser.parse!
|
||||
|
||||
user_and_project_from_git(options)
|
||||
fetch_user_and_project(options)
|
||||
|
||||
abort(parser.banner) unless options[:user] && options[:project]
|
||||
|
||||
|
@ -61,7 +61,7 @@ module GitHubChangelogGenerator
|
|||
opts.on("-b", "--base [NAME]", "Optional base file to append generated changes to.") do |last|
|
||||
options[:base] = last
|
||||
end
|
||||
opts.on("--bugs-label [LABEL]", "Setup custom label for bug-fixes section. Default is \"**Fixed bugs:**""") do |v|
|
||||
opts.on("--bugs-label [LABEL]", "Setup custom label for bug-fixes section. Default is \"**Fixed bugs:**\"") do |v|
|
||||
options[:bug_prefix] = v
|
||||
end
|
||||
opts.on("--enhancement-label [LABEL]", "Setup custom label for enhancements section. Default is \"**Implemented enhancements:**\"") do |v|
|
||||
|
@ -208,26 +208,36 @@ module GitHubChangelogGenerator
|
|||
end
|
||||
|
||||
# If `:user` or `:project` not set in options, try setting them
|
||||
def self.user_and_project_from_git(options)
|
||||
# Valid unnamed parameters:
|
||||
# 1) in 1 param: repo_name/project
|
||||
# 2) in 2 params: repo name project
|
||||
def self.fetch_user_and_project(options)
|
||||
if options[:user].nil? || options[:project].nil?
|
||||
detect_user_and_project(options, ARGV[0], ARGV[1])
|
||||
user, project = user_and_project_from_git(options, ARGV[0], ARGV[1])
|
||||
options[:user] ||= user
|
||||
options[:project] ||= project
|
||||
end
|
||||
end
|
||||
|
||||
# Sets `:user` and `:project` in `options` from CLI arguments or `git remote`
|
||||
def self.detect_user_and_project(options, arg0 = nil, arg1 = nil)
|
||||
options[:user], options[:project] = user_project_from_option(arg0, arg1, options[:github_site])
|
||||
return if options[:user] && options[:project]
|
||||
|
||||
# @param [String] arg0 first argument in cli
|
||||
# @param [String] arg1 second argument in cli
|
||||
# @return [Array<String>] user and project, or nil if unsuccessful
|
||||
def self.user_and_project_from_git(options, arg0 = nil, arg1 = nil)
|
||||
user, project = user_project_from_option(arg0, arg1, options[:github_site])
|
||||
unless user && project
|
||||
if ENV["RUBYLIB"] =~ /ruby-debug-ide/
|
||||
options[:user] = "skywinder"
|
||||
options[:project] = "changelog_test"
|
||||
user = "skywinder"
|
||||
project = "changelog_test"
|
||||
else
|
||||
remote = `git config --get remote.#{options[:git_remote]}.url`
|
||||
options[:user], options[:project] = user_project_from_remote(remote)
|
||||
user, project = user_project_from_remote(remote)
|
||||
end
|
||||
end
|
||||
|
||||
[user, project]
|
||||
end
|
||||
|
||||
# Returns GitHub username and project from CLI arguments
|
||||
#
|
||||
# @param arg0 [String] This parameter takes two forms: Either a full
|
||||
|
@ -245,7 +255,6 @@ module GitHubChangelogGenerator
|
|||
if arg0 && !arg1
|
||||
# this match should parse strings such "https://github.com/skywinder/Github-Changelog-Generator" or
|
||||
# "skywinder/Github-Changelog-Generator" to user and name
|
||||
puts arg0
|
||||
match = /(?:.+#{Regexp.escape(github_site)}\/)?(.+)\/(.+)/.match(arg0)
|
||||
|
||||
begin
|
||||
|
|
|
@ -46,7 +46,7 @@ module GitHubChangelogGenerator
|
|||
# mimick parse_options
|
||||
options = Parser.default_options
|
||||
|
||||
Parser.user_and_project_from_git(options)
|
||||
Parser.fetch_user_and_project(options)
|
||||
|
||||
OPTIONS.each do |o|
|
||||
v = instance_variable_get("@#{o}")
|
||||
|
|
|
@ -48,7 +48,7 @@ describe GitHubChangelogGenerator::ParserFile do
|
|||
header: "=== Changelog ==="))
|
||||
end
|
||||
|
||||
context "turns exclude-labels into an Array", bug: '#327' do
|
||||
context "turns exclude-labels into an Array", bug: "#327" do
|
||||
let(:file) do
|
||||
StringIO.new(<<EOF
|
||||
exclude-labels=73a91042-da6f-11e5-9335-1040f38d7f90,7adf83b4-da6f-11e5-ae18-1040f38d7f90
|
||||
|
|
|
@ -56,5 +56,25 @@ describe GitHubChangelogGenerator::Parser do
|
|||
it { is_expected.to be_a(Array) }
|
||||
it { is_expected.to match_array([nil, nil]) }
|
||||
end
|
||||
context "when all args is not nil" do
|
||||
subject { GitHubChangelogGenerator::Parser.user_project_from_option("skywinder/ActionSheetPicker-3.0", "blah", "https://codeclimate.com") }
|
||||
it { is_expected.to be_a(Array) }
|
||||
it { is_expected.to match_array([nil, nil]) }
|
||||
end
|
||||
end
|
||||
describe ".fetch_user_and_project" do
|
||||
before :each do
|
||||
ARGV = ["https://github.com/skywinder/github-changelog-generator"]
|
||||
end
|
||||
context do
|
||||
let(:valid_user) { "initialized_user" }
|
||||
let(:options) { { user: valid_user } }
|
||||
let(:options_before_change) { options.dup }
|
||||
it "should leave user unchanged" do
|
||||
expect { GitHubChangelogGenerator::Parser.fetch_user_and_project(options) }.to change { options }
|
||||
.from(options_before_change)
|
||||
.to(options_before_change.merge(project: "github-changelog-generator"))
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user