release-notes 2.0.0 → 3.0.0

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
  SHA256:
3
- metadata.gz: 3db50bbc2d93a02a0f3734d38418ed4cfb9ccf7b51cfd0eb33e78ac9c26fa2f4
4
- data.tar.gz: 886d3f94f4b06ba7bf4d7c9b3bd67802c4ffe48a885e84067489d56b8c804dda
3
+ metadata.gz: 31ee4556cc27e70fe6a0ff59e5e243afb02b265e616ca781f6b233a1938ca7c3
4
+ data.tar.gz: 140afbc526063d8df64f56a54e35d96ffe2ff4745905643a6559f9bc7c73667c
5
5
  SHA512:
6
- metadata.gz: f31ea87a15850deaf208c6dba14eed22e9bc844318e7ac40b4781e1f351d6a71ff6dfa56decdf759b764aeb3edfecff9ac9a932bbd197bb74927fc802f6134f1
7
- data.tar.gz: 2c7d83dbcba108213ac4d464cdb998a3e88da136d5850969ba98e77686de3b338d9066827757f1424b4dc4fbcb4bdb41577c72445ce1d7f3245481729d4852f3
6
+ metadata.gz: 90acbf098787bd9968b148844dc308ce28dd7b2633e163ba349eea114ac3e26c15e3a61eddb52ff8e6d0dc2bce1b934d20f95c0ed134244a87196744a2ab2cab
7
+ data.tar.gz: 8b5507ba334994659166eec6c5396dc6fabc1c0289638fdbd4bc56937d6728bd952b43a8247f4bf0866d162ef2b1983c3baa3b6b39e505dc84f29e88d0843df0
@@ -1,7 +1,6 @@
1
1
  sudo: false
2
2
  language: ruby
3
3
  rvm:
4
- - 2.4.5
5
4
  - 2.5.3
6
5
  - 2.6.0
7
6
  cache: bundler
@@ -1,12 +1,43 @@
1
1
  # Release Notes
2
2
 
3
+ ## v2.0.0
4
+
5
+ **Implemented enhancements:**
6
+
7
+ - Add our own release notes
8
+ - Add travis test for ruby 2.6.0
9
+ - Fix error when tracking commits
10
+ - Add ruby gems doc link
11
+ - Add integration test for file that already exists
12
+ - Add confiugration to not dupe commits
13
+ - Add first round of integration tests for default configuration :tada:
14
+ - Fix fact that we aren't writing first tags' commits
15
+
16
+ **Fixed bugs:**
17
+
18
+ - Yet another fix on bin/publish. Close block
19
+ - Fix cops
20
+ - Fix bin/publish to actually update version.rb
21
+ - Remove extraneous binstub from last commit
22
+ - Fix cognitive method complexity in log.rb
23
+ - Remove note about multiple commits.
24
+ - Fix link to CONTRIBUTING.md in README
25
+ - Remove empty (duped) messages from array
26
+ - Fix cops
27
+ - Fix force_rewrite bug to allow appending new commits to old relase notes
28
+ - Remove :nocov: labels now that we have integration testing
29
+ - Fix git tags reference
30
+
31
+ **Miscellaneous:**
32
+
33
+ - Update code of conduct to 1.4.0 of contributor covenant
34
+ - Refactor - set prettify_messages to false by default
35
+
3
36
  ## v1.3.0
4
37
 
5
38
  **Implemented enhancements:**
6
39
 
7
40
  - Add Configuration#header_title
8
- - More updates to README
9
- - Update README to explain how grep works
10
41
  - Add logo
11
42
  - Remove System#invert_log ;B
12
43
 
@@ -16,7 +47,8 @@
16
47
 
17
48
  **Miscellaneous:**
18
49
 
19
- - Bump release-notes to 1.3.0
50
+ - More updates to README
51
+ - Update README to explain how grep works
20
52
 
21
53
  ## v1.2.1
22
54
 
@@ -24,10 +56,6 @@
24
56
 
25
57
  - Fix cognitive complexity of split_words ;F
26
58
 
27
- **Miscellaneous:**
28
-
29
- - Bump release-notes to 1.2.1
30
-
31
59
  ## v1.2.0
32
60
 
33
61
  **Implemented enhancements:**
@@ -39,34 +67,22 @@
39
67
  - Fix log_all option and invert-grep ;B
40
68
  - Fix travis - actually run rspec tests ;B
41
69
 
42
- **Miscellaneous:**
43
-
44
- - Bump release-notes to 1.2.0
45
-
46
70
  ## v1.1.2
47
71
 
48
- **Implemented enhancements:**
49
-
50
- - Update binstub to support config file in config/ folder
51
-
52
72
  **Miscellaneous:**
53
73
 
54
- - Bump release-notes to 1.1.2
74
+ - Update binstub to support config file in config/ folder
55
75
 
56
76
  ## v1.1.1
57
77
 
58
- **Implemented enhancements:**
59
-
60
- - Update README
61
- - Update binstub to check non-rails config file
62
-
63
78
  **Fixed bugs:**
64
79
 
65
80
  - Fix README
66
81
 
67
82
  **Miscellaneous:**
68
83
 
69
- - Bump release-notes to 1.1.1
84
+ - Update README
85
+ - Update binstub to check non-rails config file
70
86
 
71
87
  ## v1.1.0
72
88
 
@@ -74,46 +90,40 @@
74
90
 
75
91
  - Light refactoring and add binstub and non-rails install
76
92
 
77
- **Miscellaneous:**
93
+ ## v1.0.1
78
94
 
79
- - Bump release-notes to 1.1.0
95
+ **Fixed bugs:**
80
96
 
81
- ## v1.0.1
97
+ - Update README.md
98
+ - Remove environment from rake task
99
+ - Fix contributing.md
100
+
101
+ ## v1.0.0
82
102
 
83
103
  **Implemented enhancements:**
84
104
 
85
- - Update README.md
86
105
  - Updates to README, CONTRIBUTING and add bin/test
87
- - Update README and install template
88
106
 
89
107
  **Fixed bugs:**
90
108
 
91
- - Remove environment from rake task
92
- - Fix contributing.md
93
109
  - Fix linking/writing of none linked lines and frozen string modification
94
110
  - Fix guard clause for rubocop
95
111
 
96
112
  **Miscellaneous:**
97
113
 
98
- - Bump release-notes to 1.0.1
99
- - Bump release-notes to 1.0.0
114
+ - Update README and install template
100
115
 
101
116
  ## v1.0.0.pre
102
117
 
103
- ## v1.0.0
104
-
105
118
  **Implemented enhancements:**
106
119
 
107
- - Update README
108
120
  - Add log_all option for configuration
109
121
  - Add force_rewrite option to configuration
110
122
  - Fix linking not adding the issue number correctly
111
123
  - Add GH templates
112
124
  - Add test around puts on rake task
113
- - Refactor link.rb and increase test coverage
114
125
  - Add rubocop & fix cops
115
126
  - ignore .ruby-version since it's irrelevant and add different rubies to travis
116
- - ruby version update -> 2.5.3
117
127
  - Update README
118
128
 
119
129
  **Fixed bugs:**
@@ -121,27 +131,31 @@
121
131
  - Fix cops and depreciation warnings
122
132
  - Fix spelling error
123
133
  - Reduce cyclomatic complexity of Write.rb
134
+ - Refactor link.rb and increase test coverage
124
135
  - Remove extra new line on output
125
136
  - Remove extra header underline on output md file
126
137
  - fix readme typo
127
138
 
128
139
  **Miscellaneous:**
129
140
 
130
- - Bump release-notes to 1.0.0.pre
131
- - Utilize bundler caching on travis
141
+ - Update README
142
+ - ruby version update -> 2.5.3
132
143
 
133
144
  ## v0.1.0
134
145
 
135
146
  **Implemented enhancements:**
136
147
 
137
- - Update prettify class
138
- - update readme
139
- - Update to linking commit messages
140
148
  - Minor updates to layout of gem
141
- - more readme updates
142
149
  - add docs badge to readme
143
150
  - add yard config
144
- - update readme
145
151
  - WIP adding test coverage to code climate
146
152
  - Add badges to README
147
153
  - Add some initial tests
154
+
155
+ **Miscellaneous:**
156
+
157
+ - Update prettify class
158
+ - update readme
159
+ - Update to linking commit messages
160
+ - more readme updates
161
+ - update readme
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
55
55
  ## Enforcement
56
56
 
57
57
  Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
- reported by contacting the project maintainer at dvmonroe6@gmail.com. All
58
+ reported by contacting the project maintainer at shackl3ton@pm.me. All
59
59
  complaints will be reviewed and investigated and will result in a response that
60
60
  is deemed necessary and appropriate to the circumstances. The project team is
61
61
  obligated to maintain confidentiality with regard to the reporter of an incident.
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2016 Drew Monroe
3
+ Copyright (c) 2019 Drew Monroe
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -3,9 +3,10 @@
3
3
  require "active_support"
4
4
  require "active_support/core_ext/time"
5
5
 
6
- require "release/notes/date_format"
6
+ require "release/notes/configurable"
7
+ require "release/notes/date_formatter"
7
8
  require "release/notes/link"
8
- require "release/notes/pretty_print"
9
+ require "release/notes/prettify"
9
10
 
10
11
  require "release/notes/version"
11
12
  require "release/notes/configuration"
@@ -14,24 +15,30 @@ require "release/notes/system"
14
15
 
15
16
  require "release/notes/write"
16
17
  require "release/notes/log"
18
+ require "release/notes/tag"
19
+ require "release/notes/commits"
17
20
 
18
21
  require "release/notes/railtie" if defined?(Rails)
19
22
  require "release/notes/install" unless defined?(Rails)
20
23
 
21
24
  module Release
22
25
  module Notes
26
+ NEWLINE = "\n"
27
+
23
28
  class << self
24
29
  def generate
25
30
  log.perform
26
31
  end
27
32
 
28
- def log
29
- Release::Notes::Log.new
30
- end
31
-
32
33
  def root
33
34
  File.expand_path("..", __dir__)
34
35
  end
36
+
37
+ private
38
+
39
+ def log
40
+ Log.new
41
+ end
35
42
  end
36
43
  end
37
44
  end
@@ -0,0 +1,141 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Release
4
+ module Notes
5
+ class Commits
6
+ include Configurable
7
+ REGEX_DELIMETER = /(?=-)/
8
+
9
+ attr_reader :title, :value
10
+ delegate :digest_title, prefix: :writer, to: :@writer
11
+
12
+ #
13
+ # Release::Notes::Commits initializer method
14
+ #
15
+ # @param [String] title - a label (**Implemented enhancements.**)
16
+ # @param [String] value - all commits and commit subjects (sha - message\n)
17
+ # @param [Release::Notes::Writer] writer - Writer obeject containing the message header (v2.0.0)
18
+ #
19
+ def initialize(title:, value:, writer:, tagger:)
20
+ @title = title
21
+ @value = value
22
+ @writer = writer
23
+
24
+ @tagger = tagger
25
+ end
26
+
27
+ #
28
+ # Perform method
29
+ #
30
+ # @return [File] File with array of git sha's
31
+ #
32
+ def perform
33
+ choose_messages_by_hash.tap do |obj|
34
+ next if obj.empty?
35
+
36
+ @tagger._hashes += obj.keys
37
+ output_unique_messages(obj.values)
38
+ end
39
+
40
+ self
41
+ end
42
+
43
+ private
44
+
45
+ #
46
+ # Determine what messages will be added to final output
47
+ #
48
+ # @return [Array] non-duplicated log messages
49
+ #
50
+ def choose_messages_by_hash
51
+ split_commits.tap do |obj|
52
+ remove_duplicate_hashes(obj)
53
+ end
54
+ end
55
+
56
+ #
57
+ # Create the commits hash
58
+ #
59
+ # @param [Array] arr - Array where [0] is a commit hash and [1] is the first formatted commit message for...
60
+ # @param [Hash] hsh - Hash of formatted commit messages to be injected per sha
61
+ #
62
+ # @return [String] Commit message
63
+ #
64
+ def create_commits_hash(arr, hsh)
65
+ hsh[arr[0].strip] = arr[1..-1].join
66
+ end
67
+
68
+ #
69
+ # Determines whether key has already been added to the release_notes
70
+ #
71
+ # @param [String] key - commit sha
72
+ #
73
+ # @return [Boolean] Is this a duplicate commit message?
74
+ #
75
+ def duplicate_commit?(key)
76
+ config_single_label && @tagger._hashes.include?(key)
77
+ end
78
+
79
+ #
80
+ # Transforms an array of messages into a single
81
+ #
82
+ # @param [Array] arr - array formatted log messages
83
+ #
84
+ # @return [String] formatted log messages
85
+ #
86
+ def join_messages(arr)
87
+ "#{arr.join(NEWLINE)}#{NEWLINE}"
88
+ end
89
+
90
+ #
91
+ # Log messages without duplicates
92
+ #
93
+ # @param [Array] messages - Array of git commit subjects
94
+ #
95
+ # @return [String] - formatted messages
96
+ #
97
+ def output_unique_messages(messages)
98
+ writer_digest_title(title: title, log_message: join_messages(messages))
99
+ end
100
+
101
+ #
102
+ # Remove duplicate log messages
103
+ #
104
+ # @param [Hash] obj - Commit sha's and messages
105
+ #
106
+ # @return [Array] Array of unique git sha's
107
+ #
108
+ def remove_duplicate_hashes(obj)
109
+ obj.keys.each { |key| obj.delete(key) if duplicate_commit?(key) }
110
+ end
111
+
112
+ #
113
+ # Split commits by sha
114
+ #
115
+ # @return [Hash] Commit and message
116
+ #
117
+ def split_commits
118
+ split_values do |arr, obj|
119
+ arr.split(REGEX_DELIMETER).tap do |split_arr|
120
+ create_commits_hash(split_arr, obj) # "- Add our own release notes"
121
+ end
122
+ end
123
+ end
124
+
125
+ #
126
+ # Split messages by sha
127
+ #
128
+ # @param [Proc] &_block - optional block
129
+ #
130
+ # @return [Hash] commits and commit sha's
131
+ #
132
+ # NEWLINE = "\n"
133
+ #
134
+ def split_values(&_block)
135
+ value.split(NEWLINE).each_with_object({}) do |arr, obj|
136
+ yield arr, obj
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Release
4
+ module Notes
5
+ module Configurable
6
+ delegate :timezone, :grep_insensitive?, :regex_type,
7
+ :include_merges?, :link_to_labels, :link_to_sites, :link_to_humanize,
8
+ :log_all, :header_title, :header_title_type, :features,
9
+ :bugs, :misc, :feature_title,
10
+ :bug_title, :misc_title, :log_all_title, :single_label,
11
+ :output_file, :temp_file, :link_commits?, :all_labels,
12
+ :prettify_messages?, :release_notes_exist?,
13
+ :force_rewrite, prefix: :config, to: :"Release::Notes.configuration"
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Release
4
+ module Notes
5
+ class DateFormatter
6
+ include Configurable
7
+ attr_reader :date
8
+ HUMANIZED = "%B %d, %Y %r %Z"
9
+
10
+ #
11
+ # Format the date
12
+ #
13
+ # @param [Date] date - parse date or return the current date/time
14
+ #
15
+ def initialize(date = nil)
16
+ Time.zone = config_timezone
17
+ @date = date.present? ? Time.zone.parse(date) : Time.zone.now
18
+ end
19
+
20
+ #
21
+ # Format date
22
+ #
23
+ # @return [String] Month Day, Year, Time AM/PM Time Zone
24
+ # ex: "January 17, 2019 10:22:53 PM EST"
25
+ #
26
+ def humanize
27
+ date.strftime(HUMANIZED)
28
+ end
29
+ end
30
+ end
31
+ end