reissue 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -12
- data/README.md +7 -0
- data/Rakefile +1 -1
- data/lib/reissue/printer.rb +1 -1
- data/lib/reissue/rake.rb +35 -1
- data/lib/reissue/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7a30f436a8c3bdf476c8ef3a7547536e292b3b81cf207ff8efe92404eacf2e9
|
4
|
+
data.tar.gz: 20d5e0d023af7778e0de3d71859088b5baa216bc00c7ef09a46732e1dcc0712a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fea5c4c4d7c7c4d7abcd43d038e9566de875892ee2cda0e95730f69c4108fd3a0304f99ec5ab3bcdd17b104719280b7610061973217eb9fc1277d265cb017238
|
7
|
+
data.tar.gz: 24a0fcfb969d6ba3640e3594a268cd192aa5b7316b49e88aa7059f918bfdb9fb0728aaf81df11cd3a61950ffea47af6c30d07725c12c6bdeac5ff742f08991e9
|
data/CHANGELOG.md
CHANGED
@@ -5,26 +5,24 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
7
7
|
|
8
|
-
## [0.2.
|
8
|
+
## [0.2.2] - 2024-09-06
|
9
9
|
|
10
10
|
### Added
|
11
11
|
|
12
|
-
-
|
12
|
+
- Add a `reissue:branch` task to create a new branch for the next version
|
13
|
+
- Add a `reissue:push` task to push the new branch to the remote repository
|
13
14
|
|
14
|
-
###
|
15
|
+
### Fixed
|
15
16
|
|
16
|
-
-
|
17
|
+
- Require the 'date' library in tests to ensure the Date constant is present
|
18
|
+
- Ensure that `updated_paths` are always enumerable
|
17
19
|
|
18
|
-
## [0.2.
|
20
|
+
## [0.2.1] - 2024-07-29
|
19
21
|
|
20
22
|
### Added
|
21
23
|
|
22
|
-
-
|
23
|
-
|
24
|
-
### Removed
|
25
|
-
|
26
|
-
- Reissue::Parser implementation
|
24
|
+
- Release notes and the checksum for the 0.2.0 version
|
27
25
|
|
28
|
-
###
|
26
|
+
### Changed
|
29
27
|
|
30
|
-
-
|
28
|
+
- Return the new version from the reissue task
|
data/README.md
CHANGED
@@ -52,6 +52,10 @@ This will add the following rake tasks:
|
|
52
52
|
the latest version.
|
53
53
|
- `rake reissue:reformat[version_limit]` - Reformat the CHANGELOG.md file and
|
54
54
|
optionally limit the number of versions to maintain.
|
55
|
+
- `rake reissue:branch[branch-name]` - Create a new branch for the next version.
|
56
|
+
Controlled by the `push_finalize` and `commit_finalize` options.
|
57
|
+
- `rake reissue:push` - Push the changes to the remote repository. Controlled
|
58
|
+
by the `push_finalize` and `commit_finalize` options.
|
55
59
|
|
56
60
|
This will also update the `build` task from rubygems to first run
|
57
61
|
`reissue:finalize` and then build the gem, ensuring that your changelog is
|
@@ -105,6 +109,9 @@ Reissue::Task.create :your_name_and_namespace do |task|
|
|
105
109
|
|
106
110
|
# Optional: Whether or not to commit the results of the finalize task. Defaults to true.
|
107
111
|
task.commit_finalize = false
|
112
|
+
|
113
|
+
# Optional: Whether to push the changes automatically. Defaults to false.
|
114
|
+
task.push_finalize = :branch # or false, or true to push the working branch
|
108
115
|
end
|
109
116
|
```
|
110
117
|
|
data/Rakefile
CHANGED
data/lib/reissue/printer.rb
CHANGED
@@ -28,7 +28,7 @@ module Reissue
|
|
28
28
|
changes_string = changes.map do |section, section_changes|
|
29
29
|
format_section(section, section_changes)
|
30
30
|
end.join("\n\n")
|
31
|
-
[version_string, changes_string].
|
31
|
+
[version_string, changes_string].reject { |str| str.empty? }.join("\n\n")
|
32
32
|
end.then do |data|
|
33
33
|
if data.empty?
|
34
34
|
"## [0.0.0] - Unreleased"
|
data/lib/reissue/rake.rb
CHANGED
@@ -32,7 +32,11 @@ module Reissue
|
|
32
32
|
attr_accessor :changelog_file
|
33
33
|
|
34
34
|
# Additional paths to add to the commit.
|
35
|
-
|
35
|
+
attr_writer :updated_paths
|
36
|
+
|
37
|
+
def updated_paths
|
38
|
+
Array(@updated_paths)
|
39
|
+
end
|
36
40
|
|
37
41
|
# Whether to commit the changes. Default: true.
|
38
42
|
attr_accessor :commit
|
@@ -40,6 +44,14 @@ module Reissue
|
|
40
44
|
# Whether to commit the finalize change to the changelog. Default: true.
|
41
45
|
attr_accessor :commit_finalize
|
42
46
|
|
47
|
+
# Whether to branch and push the changes. Default: :branch.
|
48
|
+
# Requires commit_finialize to be true.
|
49
|
+
#
|
50
|
+
# Set this to false to disable pushing.
|
51
|
+
# Set this to true to push to the current branch.
|
52
|
+
# Set this to :branch to push to a new branch.
|
53
|
+
attr_accessor :push_finalize
|
54
|
+
|
43
55
|
def initialize(name = :reissue)
|
44
56
|
@name = name
|
45
57
|
@description = "Prepare the code for work on a new version."
|
@@ -48,10 +60,19 @@ module Reissue
|
|
48
60
|
@changelog_file = "CHANGELOG.md"
|
49
61
|
@commit = true
|
50
62
|
@commit_finalize = true
|
63
|
+
@push_finalize = false
|
51
64
|
@version_limit = 2
|
52
65
|
@version_redo_proc = nil
|
53
66
|
end
|
54
67
|
|
68
|
+
def finalize_with_branch?
|
69
|
+
push_finalize == :branch
|
70
|
+
end
|
71
|
+
|
72
|
+
def push_finalize?
|
73
|
+
!!push_finalize
|
74
|
+
end
|
75
|
+
|
55
76
|
def define
|
56
77
|
desc description
|
57
78
|
task name, [:segment] do |task, args|
|
@@ -94,12 +115,25 @@ module Reissue
|
|
94
115
|
version, date = Reissue.finalize(date, changelog_file:)
|
95
116
|
finalize_message = "Finalize the changelog for version #{version} on #{date}"
|
96
117
|
if commit_finalize
|
118
|
+
Rake::Task["#{name}:branch"].invoke("reissue/#{version}") if finalize_with_branch?
|
97
119
|
system("git add -u")
|
98
120
|
system("git commit -m '#{finalize_message}'")
|
121
|
+
Rake::Task["#{name}:push"].invoke if push_finalize?
|
99
122
|
else
|
100
123
|
system("echo '#{finalize_message}'")
|
101
124
|
end
|
102
125
|
end
|
126
|
+
|
127
|
+
desc "Create a new branch for the next version."
|
128
|
+
task "#{name}:branch", [:branch] do |task, args|
|
129
|
+
raise "No branch name specified" unless args[:branch]
|
130
|
+
system("git checkout -b #{args[:branch]}")
|
131
|
+
end
|
132
|
+
|
133
|
+
desc "Push the current branch to the remote repository."
|
134
|
+
task "#{name}:push" do
|
135
|
+
system("git push origin HEAD")
|
136
|
+
end
|
103
137
|
end
|
104
138
|
end
|
105
139
|
end
|
data/lib/reissue/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reissue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jim Gay
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|