changelog_merger 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 17ff77f84acef90485063fb0863318e6a52fe1b6
4
- data.tar.gz: a2e50440ca95b346cbfc9781d36348306ebc5969
3
+ metadata.gz: 720e02f4c54c3515b964669d13813b6b774f75d1
4
+ data.tar.gz: da90361ab3203505ce23d0a17e5e69f3643d4889
5
5
  SHA512:
6
- metadata.gz: 24b938c984fd17cec6d807fdae91c239688cdda6db6ad99d08446366d53a97f8015336b9850225328a3de0330f45490ee7fe0a2fd3c0c5986e0393605f6389db
7
- data.tar.gz: 978a512b59d395a6fee94ec6fe25e449b5e7b29383b62494846aecd270209ddf31dba831661bc215a6886526f8e1670774fa2f911725a68aa648fe39ffac0de9
6
+ metadata.gz: e97e4fa8dd54eddfa60687bb3cb7b5069b4493b26dd7d04a93528216a078dfe914a24a6b6ebdfec42862c8a64285ab6ab95a0b0d44b5da9eb4b89d060ecb9ded
7
+ data.tar.gz: ac7e3dfd7060ed93a82b8f0805823671de368563cbacdf1e85cec353910f42e1f75ad31ced8f692b36c55fddbcb11bf48900d3d8be38a36d6cbdca48a4bf0786
@@ -11,16 +11,21 @@ module ChangelogMerger
11
11
  end
12
12
 
13
13
  def run_generator
14
- go_to_work_dir
15
- clone_repo_and_cd
16
- generate_change_log
17
- add_commit_push
14
+ if @options[:run_wo_pr]
15
+ generate_change_log
16
+ execute_line("open #{@options[:output]}")
17
+ else
18
+ go_to_work_dir
19
+ clone_repo_and_cd
20
+ generate_change_log
21
+ add_commit_push
22
+ end
18
23
  end
19
24
 
20
25
  def add_commit_push
21
26
  execute_line('hub fork')
22
27
  execute_line('git checkout -b add-change-log-file')
23
- execute_line('git add CHANGELOG.md')
28
+ execute_line("git add #{@options[:output]}")
24
29
  execute_line("git commit -v -m '#{@options[:message]}'")
25
30
  execute_line('git push skywinder')
26
31
  # execute_line('git push')
@@ -28,7 +33,7 @@ module ChangelogMerger
28
33
  end
29
34
 
30
35
  def generate_change_log
31
- execute_line("github_changelog_generator #{@options[:repo]}")
36
+ execute_line("github_changelog_generator #{@options[:repo]} -o #{@options[:output]}")
32
37
  end
33
38
 
34
39
  def clone_repo_and_cd
@@ -9,14 +9,24 @@ module ChangelogMerger
9
9
  # :include_labels => %w(bug enhancement),
10
10
 
11
11
  options = {:message => 'Added automatically generated change log file',
12
+ :output => 'CHANGELOG.md'
12
13
  # :dry_run => true
13
14
  }
14
15
 
15
16
  parser = OptionParser.new { |opts|
16
17
  opts.banner = 'Usage: changelog_merger [options]'
17
- opts.on('-r', '--repo REPO', 'destination repo in format user/repo') do |last|
18
+ opts.on('-r', '--repo [REPO]', 'destination repo in format user/repo') do |last|
18
19
  options[:repo] = last
19
20
  end
21
+ opts.on('-d', '--dry-run', 'dry run') do |last|
22
+ options[:dry_run] = last
23
+ end
24
+ opts.on('-x', 'just generate log and open it') do |last|
25
+ options[:run_wo_pr] = last
26
+ end
27
+ opts.on('-o', '--output [NAME]', 'Output file. Default is CHANGELOG.md') do |last|
28
+ options[:output] = last
29
+ end
20
30
  opts.on('-t', '--token [TOKEN]', 'To make more than 50 requests per hour your GitHub token required. You can generate it here: https://github.com/settings/tokens/new') do |last|
21
31
  options[:token] = last
22
32
  end
@@ -44,6 +54,10 @@ module ChangelogMerger
44
54
  begin
45
55
  parser.parse!
46
56
 
57
+ if ARGV.count == 1
58
+ options[:repo] = ARGV[0]
59
+ end
60
+
47
61
  mandatory = [:repo] # Enforce the presence of
48
62
  missing = mandatory.select { |param| options[param].nil? } # the -t and -f switches
49
63
  unless missing.empty?
@@ -70,11 +84,35 @@ module ChangelogMerger
70
84
  options[:pr_message] = "Add automatically generated change log file.
71
85
 
72
86
  Hi, as I can see, you are carefully fill tags and labels for issues in your repo.
73
- I created a [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator), that generate change log file based on tags, issues and merged pull requests (and split them to separate lists according labels) from GitHub issue tracker.
74
- [This Change Log](https://github.com/skywinder/#{options[:project]}/blob/add-change-log-file/CHANGELOG.md) was automatically generated by this script.
75
- It helps to easily found what and when was fixed and implemented.
76
- You can easily update this file in future by running script: `github_changelog_generator` in your repo folder.
77
- Hope you find this commit as useful."
87
+
88
+ And special for such cases - I created a [github_changelog_generator](https://github.com/skywinder/github-changelog-generator), that generate change log file based on **tags**, **issues** and merged **pull requests** (and split them to separate lists according labels) from :octocat: GitHub Issue Tracker.
89
+
90
+ By using this script your Change Log will look like this: [Click me!](https://github.com/skywinder/#{options[:project]}/blob/add-change-log-file/#{options[:output]})
91
+
92
+ ***What’s the point of a change log?***
93
+ To make it easier for users and contributors to see precisely what notable changes have been made between each release (or version) of the project.
94
+
95
+ And now you don't need to spend a lot of :hourglass_flowing_sand: for filling it manually!
96
+
97
+ Some essential features of **github_changelog_generator**:
98
+
99
+ - Generate **neat** Change Log file according basic [change log guidelines](http://keepachangelog.com). :gem:
100
+
101
+ - **Distinguish** issues **according labels**:
102
+ - Merged pull requests (all `merged` pull-requests)
103
+ - Bug fixes (by label `bug` in issue)
104
+ - Enhancements (by label `enhancement` in issue)
105
+ - Issues (closed issues `w/o any labels`)
106
+
107
+ - it **exclude** not-related to changelog issues (any issue, that has label `question` `duplicate` `invalid` `wontfix` ) :scissors:
108
+
109
+ - You can set which labels should be included/excluded and apply a lot of other customisations, to fit changelog for your personal style :tophat: (*look `github_changelog_generator --help` for details)*
110
+
111
+ You can easily update this file in future by simply run script: `github_changelog_generator #{options[:repo]}` in your repo folder and it make your Change Log file up-to-date again!
112
+
113
+ Since now you don't have to fill your `CHANGELOG.md` manually: just run script, relax and take a cup of :coffee: before your next release!
114
+
115
+ Hope you find this commit as useful. :wink:"
78
116
 
79
117
  if options[:verbose]
80
118
  puts 'Performing task with options:'
@@ -1,3 +1,3 @@
1
1
  module ChangelogMerger
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: changelog_merger
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Petr Korolev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-03-05 00:00:00.000000000 Z
11
+ date: 2015-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler