github_changelog_generator 1.15.0.pre.rc → 1.16.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE +1 -1
- data/README.md +134 -81
- data/Rakefile +1 -1
- data/bin/git-generate-changelog +1 -1
- data/lib/github_changelog_generator.rb +10 -6
- data/lib/github_changelog_generator/argv_parser.rb +224 -0
- data/lib/github_changelog_generator/generator/entry.rb +218 -0
- data/lib/github_changelog_generator/generator/generator.rb +120 -121
- data/lib/github_changelog_generator/generator/generator_fetcher.rb +138 -23
- data/lib/github_changelog_generator/generator/generator_processor.rb +60 -27
- data/lib/github_changelog_generator/generator/generator_tags.rb +25 -21
- data/lib/github_changelog_generator/generator/section.rb +124 -0
- data/lib/github_changelog_generator/helper.rb +1 -1
- data/lib/github_changelog_generator/octo_fetcher.rb +250 -96
- data/lib/github_changelog_generator/options.rb +39 -4
- data/lib/github_changelog_generator/parser.rb +70 -209
- data/lib/github_changelog_generator/parser_file.rb +35 -16
- data/lib/github_changelog_generator/reader.rb +2 -2
- data/lib/github_changelog_generator/ssl_certs/cacert.pem +851 -1680
- data/lib/github_changelog_generator/task.rb +4 -4
- data/lib/github_changelog_generator/version.rb +1 -1
- data/man/git-generate-changelog.1 +160 -74
- data/man/git-generate-changelog.1.html +159 -95
- data/man/git-generate-changelog.html +36 -24
- data/man/git-generate-changelog.md +156 -93
- data/spec/files/config_example +5 -0
- data/spec/files/github-changelog-generator.md +114 -114
- data/spec/{install-gem-in-bundler.gemfile → install_gem_in_bundler.gemfile} +2 -0
- data/spec/spec_helper.rb +2 -6
- data/spec/unit/generator/entry_spec.rb +766 -0
- data/spec/unit/generator/generator_processor_spec.rb +103 -41
- data/spec/unit/generator/generator_spec.rb +47 -0
- data/spec/unit/generator/generator_tags_spec.rb +51 -24
- data/spec/unit/generator/section_spec.rb +34 -0
- data/spec/unit/octo_fetcher_spec.rb +247 -197
- data/spec/unit/options_spec.rb +24 -0
- data/spec/unit/parse_file_spec.rb +2 -2
- data/spec/unit/parser_spec.rb +50 -0
- data/spec/unit/reader_spec.rb +4 -4
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_commits/when_API_is_valid/returns_commits.json +1 -0
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_commits_before/when_API_is_valid/returns_commits.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issue_with_proper_key/values.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issues.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_issues_with_labels.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_pull_request_with_proper_key/values.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_issues_and_pr/when_API_call_is_valid/returns_pull_requests_with_labels.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid/returns_correct_pull_request_keys.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_closed_pull_requests/when_API_call_is_valid/returns_pull_requests.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_commit/when_API_call_is_valid.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_commit/when_API_call_is_valid/returns_commit.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_date_of_tag/when_API_call_is_valid.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_date_of_tag/when_API_call_is_valid/returns_date.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_events_async/when_API_call_is_valid.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_fetch_events_async/when_API_call_is_valid/populates_issues.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid/should_return_tags.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_API_call_is_valid/should_return_tags_count.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_wrong_token_provided.json +1 -1
- data/spec/vcr/GitHubChangelogGenerator_OctoFetcher/_github_fetch_tags/when_wrong_token_provided/should_raise_Unauthorized_error.json +1 -1
- metadata +56 -20
- data/bin/ghclgen +0 -5
- data/lib/github_changelog_generator/generator/generator_generation.rb +0 -181
- data/spec/unit/generator/generator_generation_spec.rb +0 -73
@@ -1,73 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module GitHubChangelogGenerator
|
4
|
-
describe Generator do
|
5
|
-
describe "#get_string_for_issue" do
|
6
|
-
let(:issue) do
|
7
|
-
{ "title" => "Bug in code" }
|
8
|
-
end
|
9
|
-
|
10
|
-
it "formats an issue according to options" do
|
11
|
-
expect do
|
12
|
-
described_class.new.get_string_for_issue(issue)
|
13
|
-
end.not_to raise_error
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe "#parse_by_sections" do
|
18
|
-
def label(name)
|
19
|
-
{ "name" => name }
|
20
|
-
end
|
21
|
-
|
22
|
-
def issue(title, labels)
|
23
|
-
{ "title" => "issue #{title}", "labels" => labels.map { |l| label(l) } }
|
24
|
-
end
|
25
|
-
|
26
|
-
def pr(title, labels)
|
27
|
-
{ "title" => "pr #{title}", "labels" => labels.map { |l| label(l) } }
|
28
|
-
end
|
29
|
-
|
30
|
-
def get_titles(issues)
|
31
|
-
issues.map { |issue| issue["title"] }
|
32
|
-
end
|
33
|
-
|
34
|
-
let(:options) do
|
35
|
-
{
|
36
|
-
bug_labels: ["bug"],
|
37
|
-
enhancement_labels: ["enhancement"],
|
38
|
-
breaking_labels: ["breaking"]
|
39
|
-
}
|
40
|
-
end
|
41
|
-
|
42
|
-
let(:issues) do
|
43
|
-
[
|
44
|
-
issue("no labels", []),
|
45
|
-
issue("enhancement", ["enhancement"]),
|
46
|
-
issue("bug", ["bug"]),
|
47
|
-
issue("breaking", ["breaking"]),
|
48
|
-
issue("all the labels", %w[enhancement bug breaking])
|
49
|
-
]
|
50
|
-
end
|
51
|
-
|
52
|
-
let(:pull_requests) do
|
53
|
-
[
|
54
|
-
pr("no labels", []),
|
55
|
-
pr("enhancement", ["enhancement"]),
|
56
|
-
pr("bug", ["bug"]),
|
57
|
-
pr("breaking", ["breaking"]),
|
58
|
-
pr("all the labels", %w[enhancement bug breaking])
|
59
|
-
]
|
60
|
-
end
|
61
|
-
|
62
|
-
it "works" do
|
63
|
-
sections = described_class.new(options).parse_by_sections(issues, pull_requests)
|
64
|
-
|
65
|
-
expect(get_titles(sections[:issues])).to eq(["issue no labels"])
|
66
|
-
expect(get_titles(sections[:enhancements])).to eq(["issue enhancement", "issue all the labels", "pr enhancement", "pr all the labels"])
|
67
|
-
expect(get_titles(sections[:bugs])).to eq(["issue bug", "pr bug"])
|
68
|
-
expect(get_titles(sections[:breaking])).to eq(["issue breaking", "pr breaking"])
|
69
|
-
expect(get_titles(pull_requests)).to eq(["pr no labels"])
|
70
|
-
end
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|